[MLton] refs in ssa
Matthew Fluet
fluet@cs.cornell.edu
Tue, 9 Mar 2004 10:17:45 -0500 (EST)
> > Can you post some code that demonstrates this? I'd be very surprised if
> > this were the case.
I actually meant could you post some code that when compiled you see
Ref_ref being applied to multiple arguments.
> | PrimApp{prim, targs, args} =>
> (case var of
> SOME var' => ...
> (case Prim.name prim
> of Ref_ref =>
> let val i = Vector.length(args)
> val _ = print(Int.toString i)
> val _ = if i = 0 then ()
> else setRefEnv(var', {var = Vector.sub(args, 0)})
> val _ = print("\n")
> in [stmt]
> end
> | _ => [stmt])
I'd check this code -- are you sure that "..." in the third line doesn't
define a variable named args that is being used within the Ref_ref case?
> skavena 107 $ ./mlton -flatten true zebra.batch.sml
When I look at zebra.flatten.pre.ssa and zebra.flatten.post.ssa, then
every Ref_ref is applied to exactly one argument.