[MLton] refs in ssa
Lukasz S Ziarek
lziarek@cs.purdue.edu
Tue, 9 Mar 2004 10:34:19 -0500 (EST)
On Tue, 9 Mar 2004, Matthew Fluet wrote:
>
> > > 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' => ...
the ... is just a check to see if the ty is a tuple type, if so I may be
dealing with a ref_dref and i have code there for the dereference op.
The code below is the else clause of my if statement. So I am fairly
certain I do not have any redefinitions of args.
> > (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.
That is exactly what I see as well. I am going to add this snippet of code
to the regular flattener and see if I get the same results. Maybe I do
have a scoping insue with my args variable.
Luke
>
> _______________________________________________
> MLton mailing list
> MLton@mlton.org
> http://www.mlton.org/mailman/listinfo/mlton
>