X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fmain%2FDynFlags.hs;h=0bd669041fefefd19c2daec1c6e263ce95910677;hb=a5168e30f331c6fe912cca4f53be8544ce6800d5;hp=07698122bdde4f44ff1ff67def8626844bec424c;hpb=862106eb2518f437b9f10dc9367e99454ebd8072;p=ghc-hetmet.git diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 0769812..0bd6690 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -641,9 +641,8 @@ getCoreToDo dflags -- Similarly, don't apply any rules until after full -- laziness. Notably, list fusion can prevent floating. - NoCaseOfCase, - -- Don't do case-of-case transformations. - -- This makes full laziness work better + NoCaseOfCase, -- Don't do case-of-case transformations. + -- This makes full laziness work better MaxSimplifierIterations max_iter ], @@ -723,19 +722,27 @@ getCoreToDo dflags -- Case-liberation for -O2. This should be after -- strictness analysis and the simplification which follows it. - case rule_check of { Just pat -> CoreDoRuleCheck 0 pat; Nothing -> CoreDoNothing }, + case rule_check of { Just pat -> CoreDoRuleCheck 0 pat; Nothing -> CoreDoNothing } + ] + + ++ - if opt_level >= 2 then - CoreLiberateCase - else - CoreDoNothing, - if opt_level >= 2 then - CoreDoSpecConstr - else - CoreDoNothing, + (if opt_level >= 2 then + [ CoreLiberateCase, + CoreDoSimplify (SimplPhase 0) [ + MaxSimplifierIterations max_iter + ], -- Run the simplifier after LiberateCase to vastly + -- reduce the possiblility of shadowing + -- Reason: see Note [Shadowing] in SpecConstr.lhs + CoreDoSpecConstr + ] + else + []) + + ++ -- Final clean-up simplification: - CoreDoSimplify (SimplPhase 0) [ + [ CoreDoSimplify (SimplPhase 0) [ MaxSimplifierIterations max_iter ] ]