summaryrefslogtreecommitdiff
path: root/compiler/simplCore/LiberateCase.lhs
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2012-10-09 00:27:28 +0100
committerIan Lynagh <ian@well-typed.com>2012-10-09 12:32:04 +0100
commit0a768bcbe6f7238d0bcdddd85fe24c99189453a0 (patch)
treea1e75804cc73c1f88fb3deae9fa7aaf0aaa75753 /compiler/simplCore/LiberateCase.lhs
parent9c6223dd780b5a41be98702a583a1b7229841305 (diff)
downloadhaskell-0a768bcbe6f7238d0bcdddd85fe24c99189453a0.tar.gz
Make the opt_UF_* static flags dynamic
I also removed the default values from the "Discounts and thresholds" note: most of them were no longer up-to-date. Along the way I added FloatSuffix to the argument parser, analogous to IntSuffix.
Diffstat (limited to 'compiler/simplCore/LiberateCase.lhs')
-rw-r--r--compiler/simplCore/LiberateCase.lhs13
1 files changed, 7 insertions, 6 deletions
diff --git a/compiler/simplCore/LiberateCase.lhs b/compiler/simplCore/LiberateCase.lhs
index 35bfb5fcc1..9f83043740 100644
--- a/compiler/simplCore/LiberateCase.lhs
+++ b/compiler/simplCore/LiberateCase.lhs
@@ -168,7 +168,7 @@ libCaseBind env (Rec pairs)
rhs_small_enough id rhs -- Note [Small enough]
= idArity id > 0 -- Note [Only functions!]
- && maybe True (\size -> couldBeSmallEnoughToInline size rhs)
+ && maybe True (\size -> couldBeSmallEnoughToInline (lc_dflags env) size rhs)
(bombOutSize env)
\end{code}
@@ -366,9 +366,7 @@ topLevel = 0
\begin{code}
data LibCaseEnv
= LibCaseEnv {
- lc_size :: Maybe Int, -- Bomb-out size for deciding if
- -- potential liberatees are too big.
- -- (passed in from cmd-line args)
+ lc_dflags :: DynFlags,
lc_lvl :: LibCaseLevel, -- Current level
-- The level is incremented when (and only when) going
@@ -405,13 +403,16 @@ data LibCaseEnv
initEnv :: DynFlags -> LibCaseEnv
initEnv dflags
- = LibCaseEnv { lc_size = liberateCaseThreshold dflags,
+ = LibCaseEnv { lc_dflags = dflags,
lc_lvl = 0,
lc_lvl_env = emptyVarEnv,
lc_rec_env = emptyVarEnv,
lc_scruts = [] }
+-- Bomb-out size for deciding if
+-- potential liberatees are too big.
+-- (passed in from cmd-line args)
bombOutSize :: LibCaseEnv -> Maybe Int
-bombOutSize = lc_size
+bombOutSize = liberateCaseThreshold . lc_dflags
\end{code}