-- optimisation opts
| Opt_Strictness
+ | Opt_FullLaziness
| Opt_CSE
| Opt_IgnoreInterfacePragmas
| Opt_OmitInterfacePragmas
Opt_Strictness,
-- strictness is on by default, but this only
-- applies to -O.
- Opt_CSE,
- -- similarly for CSE.
+ Opt_CSE, -- similarly for CSE.
+ Opt_FullLaziness, -- ...and for full laziness
+
Opt_DoLambdaEtaExpansion,
-- This one is important for a tiresome reason:
-- we want to make sure that the bindings for data
buildCoreToDo :: DynFlags -> [CoreToDo]
buildCoreToDo dflags = core_todo
where
- opt_level = optLevel dflags
- max_iter = maxSimplIterations dflags
- strictness = dopt Opt_Strictness dflags
- cse = dopt Opt_CSE dflags
- rule_check = ruleCheck dflags
+ opt_level = optLevel dflags
+ max_iter = maxSimplIterations dflags
+ strictness = dopt Opt_Strictness dflags
+ full_laziness = dopt Opt_FullLaziness dflags
+ cse = dopt Opt_CSE dflags
+ rule_check = ruleCheck dflags
core_todo =
if opt_level == 0 then
-- so that overloaded functions have all their dictionary lambdas manifest
CoreDoSpecialising,
- CoreDoFloatOutwards (FloatOutSw False False),
+ if full_laziness then CoreDoFloatOutwards (FloatOutSw False False)
+ else CoreDoNothing,
+
CoreDoFloatInwards,
CoreDoSimplify (SimplPhase 2) [
MaxSimplifierIterations max_iter
],
- CoreDoFloatOutwards (FloatOutSw False -- Not lambdas
- True), -- Float constants
+ if full_laziness then
+ CoreDoFloatOutwards (FloatOutSw False -- Not lambdas
+ True) -- Float constants
+ else CoreDoNothing,
-- nofib/spectral/hartel/wang doubles in speed if you
-- do full laziness late in the day. It only happens
-- after fusion and other stuff, so the early pass doesn't
( "allow-incoherent-instances", Opt_AllowIncoherentInstances ),
( "generics", Opt_Generics ),
( "strictness", Opt_Strictness ),
+ ( "full-laziness", Opt_FullLaziness ),
( "cse", Opt_CSE ),
( "ignore-interface-pragmas", Opt_IgnoreInterfacePragmas ),
( "omit-interface-pragmas", Opt_OmitInterfacePragmas ),