Add a new static flag -fno-opt-coercion
authorsimonpj@microsoft.com <unknown>
Thu, 31 Mar 2011 10:15:55 +0000 (10:15 +0000)
committersimonpj@microsoft.com <unknown>
Thu, 31 Mar 2011 10:15:55 +0000 (10:15 +0000)
This just disables the coercion optimiser, mainly for measurements in the paper

compiler/main/StaticFlagParser.hs
compiler/main/StaticFlags.hs
compiler/types/OptCoercion.lhs
docs/users_guide/flags.xml

index 803baba..54f0a92 100644 (file)
@@ -185,6 +185,7 @@ isStaticFlag f =
     "fsimple-list-literals",
     "fruntime-types",
     "fno-pre-inlining",
+    "fno-opt-coercion",
     "fexcess-precision",
     "static",
     "fhardwire-lib-paths",
index 96f8b4b..049b61f 100644 (file)
@@ -24,7 +24,7 @@ module StaticFlags (
        opt_PprCols,
        opt_PprCaseAsLet,
        opt_PprStyle_Debug, opt_TraceLevel,
-        opt_NoDebugOutput,
+        opt_NoDebugOutput, 
 
        -- Suppressing boring aspects of core dumps
        opt_SuppressAll,
@@ -52,6 +52,7 @@ module StaticFlags (
        opt_CprOff,
        opt_SimplNoPreInlining,
        opt_SimplExcessPrecision,
+       opt_NoOptCoercion,
        opt_MaxWorkerArgs,
 
        -- Unfolding control
@@ -266,7 +267,6 @@ opt_Fuel                        = lookup_def_int "-dopt-fuel" maxBound
 opt_NoDebugOutput   :: Bool
 opt_NoDebugOutput               = lookUp  (fsLit "-dno-debug-output")
 
-
 -- profiling opts
 opt_SccProfilingOn :: Bool
 opt_SccProfilingOn             = lookUp  (fsLit "-fscc-profiling")
@@ -320,6 +320,9 @@ opt_SimplNoPreInlining              = lookUp  (fsLit "-fno-pre-inlining")
 opt_SimplExcessPrecision :: Bool
 opt_SimplExcessPrecision       = lookUp  (fsLit "-fexcess-precision")
 
+opt_NoOptCoercion :: Bool
+opt_NoOptCoercion              = lookUp  (fsLit "-fno-opt-coercion")
+
 -- Unfolding control
 -- See Note [Discounts and thresholds] in CoreUnfold
 
index 0fff7ab..26f3295 100644 (file)
@@ -19,6 +19,7 @@ import Var
 import VarSet\r
 import VarEnv\r
 import PrelNames\r
+import StaticFlags     ( opt_NoOptCoercion )\r
 import Util\r
 import Outputable\r
 \end{code}\r
@@ -50,7 +51,9 @@ mkCoPredTy in the ForAll case, where this note appears.
 optCoercion :: TvSubst -> Coercion -> NormalCo\r
 -- ^ optCoercion applies a substitution to a coercion, \r
 --   *and* optimises it to reduce its size\r
-optCoercion env co = opt_co env False co\r
+optCoercion env co \r
+  | opt_NoOptCoercion = substTy env co\r
+  | otherwise         = opt_co env False co\r
 \r
 type NormalCo = Coercion\r
   -- Invariants: \r
index f5f949a..ad219cf 100644 (file)
@@ -1551,6 +1551,13 @@ phase <replaceable>n</replaceable></entry>
            </row>
 
            <row>
+             <entry><option>-fno-opt-coercion</option></entry>
+             <entry>Turn off the coercion optimiser</entry>
+             <entry>static</entry>
+             <entry>-</entry>
+           </row>
+
+           <row>
              <entry><option>-feager-blackholing</option></entry>
              <entry>Turn on <link linkend="parallel-compile-options">eager blackholing</link></entry>
              <entry>dynamic</entry>