Commit eaeca51e authored by simonpj@microsoft.com's avatar simonpj@microsoft.com

Float constants to top-level even in first full laziness pass

This patch changes the compilation pipeline flags so that constants
are floated to the top level even in the first full laziness pass.
For some reason this was not done before.  Fixing this makes a big
improvement in 'spectral/rewrite', and has zero effect on any other
nofib benchmark.
parent 4f3c0ed5
......@@ -1000,8 +1000,8 @@ pprFloatOutSwitches sw = pp_not (floatOutLambdas sw) <+> text "lambdas" <> comma
pp_not False = text "not"
-- | Switches that specify the minimum amount of floating out
gentleFloatOutSwitches :: FloatOutSwitches
gentleFloatOutSwitches = FloatOutSwitches False False
-- gentleFloatOutSwitches :: FloatOutSwitches
-- gentleFloatOutSwitches = FloatOutSwitches False False
-- | Switches that do not specify floating out of lambdas, just of constants
constantsOnlyFloatOutSwitches :: FloatOutSwitches
......@@ -1103,7 +1103,14 @@ getCoreToDo dflags
-- so that overloaded functions have all their dictionary lambdas manifest
CoreDoSpecialising,
runWhen full_laziness (CoreDoFloatOutwards gentleFloatOutSwitches),
runWhen full_laziness (CoreDoFloatOutwards constantsOnlyFloatOutSwitches),
-- Was: gentleFloatOutSwitches
-- I have no idea why, but not floating constants to top level is
-- very bad in some cases.
-- Notably: p_ident in spectral/rewrite
-- Changing from "gentle" to "constantsOnly" improved
-- rewrite's allocation by 19%, and made 0.0% difference
-- to any other nofib benchmark
CoreDoFloatInwards,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment