[MLton-commit] r6752
Matthew Fluet
fluet at mlton.org
Tue Aug 19 15:14:51 PDT 2008
Eliminate Array_array0Const in SSA to SSA2; allows ConstantPropagation to be an optional pass
----------------------------------------------------------------------
U mlton/trunk/mlton/ssa/ssa-to-ssa2.fun
----------------------------------------------------------------------
Modified: mlton/trunk/mlton/ssa/ssa-to-ssa2.fun
===================================================================
--- mlton/trunk/mlton/ssa/ssa-to-ssa2.fun 2008-08-19 22:14:40 UTC (rev 6751)
+++ mlton/trunk/mlton/ssa/ssa-to-ssa2.fun 2008-08-19 22:14:50 UTC (rev 6752)
@@ -113,7 +113,26 @@
datatype z = datatype Prim.Name.t
in
case Prim.name prim of
- Array_sub => sub ()
+ Array_array0Const =>
+ let
+ val zeroVar = Var.newNoname ()
+ val zeroTy = S2.Type.word (S2.WordSize.seqIndex ())
+ val zeroExp =
+ (S2.Exp.Const o S2.Const.word)
+ (S2.WordX.zero (S2.WordSize.seqIndex ()))
+ in
+ Vector.new2
+ (S2.Statement.Bind
+ {exp = zeroExp,
+ ty = zeroTy,
+ var = SOME zeroVar},
+ S2.Statement.Bind
+ {exp = S2.Exp.PrimApp {args = Vector.new1 zeroVar,
+ prim = Prim.array},
+ ty = ty,
+ var = var})
+ end
+ | Array_sub => sub ()
| Array_update =>
Vector.new1
(S2.Statement.Update
More information about the MLton-commit
mailing list