diff options
author | Ian Lynagh <ian@well-typed.com> | 2012-10-09 00:27:28 +0100 |
---|---|---|
committer | Ian Lynagh <ian@well-typed.com> | 2012-10-09 12:32:04 +0100 |
commit | 0a768bcbe6f7238d0bcdddd85fe24c99189453a0 (patch) | |
tree | a1e75804cc73c1f88fb3deae9fa7aaf0aaa75753 /compiler/main/StaticFlags.hs | |
parent | 9c6223dd780b5a41be98702a583a1b7229841305 (diff) | |
download | haskell-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/main/StaticFlags.hs')
-rw-r--r-- | compiler/main/StaticFlags.hs | 36 |
1 files changed, 3 insertions, 33 deletions
diff --git a/compiler/main/StaticFlags.hs b/compiler/main/StaticFlags.hs index 598ea00848..4414f6b509 100644 --- a/compiler/main/StaticFlags.hs +++ b/compiler/main/StaticFlags.hs @@ -52,14 +52,6 @@ module StaticFlags ( opt_MaxWorkerArgs, opt_NoFlatCache, - -- Unfolding control - opt_UF_CreationThreshold, - opt_UF_UseThreshold, - opt_UF_FunAppDiscount, - opt_UF_DictDiscount, - opt_UF_KeenessFactor, - opt_UF_DearOp, - -- For the parser addOpt, removeOpt, v_opt_C_ready, @@ -114,7 +106,6 @@ removeOpt f = do lookUp :: FastString -> Bool lookup_def_int :: String -> Int -> Int -lookup_def_float :: String -> Float -> Float lookup_str :: String -> Maybe String -- holds the static opts while they're being collected, before @@ -146,10 +137,12 @@ lookup_def_int sw def = case (lookup_str sw) of Nothing -> def -- Use default Just xx -> try_read sw xx +{- +lookup_def_float :: String -> Float -> Float lookup_def_float sw def = case (lookup_str sw) of Nothing -> def -- Use default Just xx -> try_read sw xx - +-} try_read :: Read a => String -> String -> a -- (try_read sw str) tries to read s; if it fails, it @@ -265,29 +258,6 @@ opt_NoOptCoercion = lookUp (fsLit "-fno-opt-coercion") opt_NoFlatCache :: Bool opt_NoFlatCache = lookUp (fsLit "-fno-flat-cache") --- Unfolding control --- See Note [Discounts and thresholds] in CoreUnfold - -opt_UF_CreationThreshold, opt_UF_UseThreshold :: Int -opt_UF_DearOp, opt_UF_FunAppDiscount, opt_UF_DictDiscount :: Int -opt_UF_KeenessFactor :: Float - -opt_UF_CreationThreshold = lookup_def_int "-funfolding-creation-threshold" (750::Int) - -- This threshold must be reasonably high to take - -- account of possible discounts. - -- E.g. 450 is not enough in 'fulsom' for Interval.sqr to inline into Csg.calc - -- (The unfolding for sqr never makes it into the interface file.) - -opt_UF_UseThreshold = lookup_def_int "-funfolding-use-threshold" (60::Int) -opt_UF_FunAppDiscount = lookup_def_int "-funfolding-fun-discount" (60::Int) - -opt_UF_DictDiscount = lookup_def_int "-funfolding-dict-discount" (30::Int) - -- Be fairly keen to inline a fuction if that means - -- we'll be able to pick the right method from a dictionary - -opt_UF_KeenessFactor = lookup_def_float "-funfolding-keeness-factor" (1.5::Float) -opt_UF_DearOp = ( 40 :: Int) - ----------------------------------------------------------------------------- -- Tunneling our global variables into a new instance of the GHC library |