[MLton-commit] r6274

Vesa Karvonen vesak at mlton.org
Sat Dec 15 02:32:41 PST 2007


Enabled a couple of minor optimizations.  Specifically, both IntInf_gcd
and Real_equal are commutative operations and both Real_abs and Real_neg
do not depend on the FP rounding mode and can be considered functional.

----------------------------------------------------------------------

U   mlton/trunk/mlton/atoms/prim.fun
U   mlton/trunk/mlton/ssa/common-subexp.fun

----------------------------------------------------------------------

Modified: mlton/trunk/mlton/atoms/prim.fun
===================================================================
--- mlton/trunk/mlton/atoms/prim.fun	2007-12-15 06:02:07 UTC (rev 6273)
+++ mlton/trunk/mlton/atoms/prim.fun	2007-12-15 10:32:40 UTC (rev 6274)
@@ -741,6 +741,7 @@
     | MLton_equal => true
     | Real_add _ => true
     | Real_mul _ => true
+    | Real_equal _ => true
     | Real_qequal _ => true
     | Word_add _ => true
     | Word_addCheck _ => true
@@ -834,7 +835,7 @@
        | Real_Math_sin _ => DependsOnState (* depends on rounding mode *)
        | Real_Math_sqrt _ => DependsOnState (* depends on rounding mode *)
        | Real_Math_tan _ => DependsOnState (* depends on rounding mode *)
-       | Real_abs _ => DependsOnState (* depends on rounding mode *)
+       | Real_abs _ => Functional
        | Real_add _ => DependsOnState (* depends on rounding mode *)
        | Real_castToWord _ => Functional
        | Real_div _ => DependsOnState (* depends on rounding mode *)
@@ -845,7 +846,7 @@
        | Real_mul _ => DependsOnState (* depends on rounding mode *)
        | Real_muladd _ => DependsOnState (* depends on rounding mode *)
        | Real_mulsub _ => DependsOnState (* depends on rounding mode *)
-       | Real_neg _ => DependsOnState (* depends on rounding mode *)
+       | Real_neg _ => Functional
        | Real_qequal _ => Functional
        | Real_rndToReal _ => DependsOnState (* depends on rounding mode *)
        | Real_rndToWord _ => Functional

Modified: mlton/trunk/mlton/ssa/common-subexp.fun
===================================================================
--- mlton/trunk/mlton/ssa/common-subexp.fun	2007-12-15 06:02:07 UTC (rev 6273)
+++ mlton/trunk/mlton/ssa/common-subexp.fun	2007-12-15 10:32:40 UTC (rev 6274)
@@ -82,6 +82,7 @@
                      if (case Prim.name prim of
                             IntInf_add => true
                           | IntInf_andb => true
+                          | IntInf_gcd => true
                           | IntInf_mul => true
                           | IntInf_orb => true
                           | IntInf_xorb => true




More information about the MLton-commit mailing list