summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsimonpj@microsoft.com <unknown>2011-03-31 10:15:55 +0000
committersimonpj@microsoft.com <unknown>2011-03-31 10:15:55 +0000
commit140fb024a9f585c4f1d75ca4bd6fe37a97bc2a4f (patch)
tree7e9140a5103cddc8be48c331ea1b081c04b63387
parent224b5e669cb545d6d49a1369c036dde516400081 (diff)
downloadhaskell-140fb024a9f585c4f1d75ca4bd6fe37a97bc2a4f.tar.gz
Add a new static flag -fno-opt-coercion
This just disables the coercion optimiser, mainly for measurements in the paper
-rw-r--r--compiler/main/StaticFlagParser.hs1
-rw-r--r--compiler/main/StaticFlags.hs7
-rw-r--r--compiler/types/OptCoercion.lhs5
-rw-r--r--docs/users_guide/flags.xml7
4 files changed, 17 insertions, 3 deletions
diff --git a/compiler/main/StaticFlagParser.hs b/compiler/main/StaticFlagParser.hs
index 803babaf50..54f0a92115 100644
--- a/compiler/main/StaticFlagParser.hs
+++ b/compiler/main/StaticFlagParser.hs
@@ -185,6 +185,7 @@ isStaticFlag f =
"fsimple-list-literals",
"fruntime-types",
"fno-pre-inlining",
+ "fno-opt-coercion",
"fexcess-precision",
"static",
"fhardwire-lib-paths",
diff --git a/compiler/main/StaticFlags.hs b/compiler/main/StaticFlags.hs
index 96f8b4b715..049b61fedb 100644
--- a/compiler/main/StaticFlags.hs
+++ b/compiler/main/StaticFlags.hs
@@ -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
diff --git a/compiler/types/OptCoercion.lhs b/compiler/types/OptCoercion.lhs
index 0fff7abc59..26f3295b28 100644
--- a/compiler/types/OptCoercion.lhs
+++ b/compiler/types/OptCoercion.lhs
@@ -19,6 +19,7 @@ import Var
import VarSet
import VarEnv
import PrelNames
+import StaticFlags ( opt_NoOptCoercion )
import Util
import Outputable
\end{code}
@@ -50,7 +51,9 @@ mkCoPredTy in the ForAll case, where this note appears.
optCoercion :: TvSubst -> Coercion -> NormalCo
-- ^ optCoercion applies a substitution to a coercion,
-- *and* optimises it to reduce its size
-optCoercion env co = opt_co env False co
+optCoercion env co
+ | opt_NoOptCoercion = substTy env co
+ | otherwise = opt_co env False co
type NormalCo = Coercion
-- Invariants:
diff --git a/docs/users_guide/flags.xml b/docs/users_guide/flags.xml
index f5f949a100..ad219cfa4e 100644
--- a/docs/users_guide/flags.xml
+++ b/docs/users_guide/flags.xml
@@ -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>