summaryrefslogtreecommitdiff
path: root/compiler/main/StaticFlags.hs
diff options
context:
space:
mode:
authorsimonpj@microsoft.com <unknown>2008-06-05 12:44:23 +0000
committersimonpj@microsoft.com <unknown>2008-06-05 12:44:23 +0000
commita3f24157839605f19e869fdde8cd73266fecf4ac (patch)
tree3a5794e3b447df97b446e1361843cf3f5185b078 /compiler/main/StaticFlags.hs
parent1b1190e01d0c65043628d2532988d9b1b4a78384 (diff)
downloadhaskell-a3f24157839605f19e869fdde8cd73266fecf4ac.tar.gz
Desugar multiple polymorphic bindings more intelligently
Occasionally people write very large recursive groups of definitions. In general we desugar these to a single definition that binds tuple, plus lots of tuple selectors. But that code has quadratic size, which can be bad. This patch adds a new case to the desugaring of bindings, for the situation where there are lots of polymorphic variables, but no dictionaries. (Dictionaries force us into the general case.) See Note [Abstracting over tyvars only]. The extra behaviour can be disabled with the (static) flag -fno-ds-multi-tyvar in case we want to experiment with switching it on or off. There is essentially-zero effect on the nofib suite though. I was provoked into doing this by Trac #1136. In fact I'm not sure it's the real cause of the problem there, but it's a good idea anyway.
Diffstat (limited to 'compiler/main/StaticFlags.hs')
-rw-r--r--compiler/main/StaticFlags.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler/main/StaticFlags.hs b/compiler/main/StaticFlags.hs
index 6fa6032bb0..6d826cb72b 100644
--- a/compiler/main/StaticFlags.hs
+++ b/compiler/main/StaticFlags.hs
@@ -39,6 +39,7 @@ module StaticFlags (
opt_Parallel,
-- optimisation opts
+ opt_DsMultiTyVar,
opt_NoStateHack,
opt_SpecInlineJoinPoints,
opt_CprOff,
@@ -320,8 +321,13 @@ opt_Parallel :: Bool
opt_Parallel = lookUp (fsLit "-fparallel")
-- optimisation opts
+opt_DsMultiTyVar :: Bool
+opt_DsMultiTyVar = not (lookUp (fsLit "-fno-ds-multi-tyvar"))
+ -- On by default
+
opt_SpecInlineJoinPoints :: Bool
opt_SpecInlineJoinPoints = lookUp (fsLit "-fspec-inline-join-points")
+
opt_NoStateHack :: Bool
opt_NoStateHack = lookUp (fsLit "-fno-state-hack")
opt_CprOff :: Bool
@@ -410,6 +416,7 @@ isStaticFlag f =
"dno-black-holing",
"fno-method-sharing",
"fno-state-hack",
+ "fno-ds-multi-tyvar",
"fruntime-types",
"fno-pre-inlining",
"fexcess-precision",