X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fmain%2FDynFlags.hs;h=2d28ae6552c97234b169d5497db6c3fccebdf94b;hb=e923340fea0fea85f55600b8ee709f1cf8b62803;hp=9a7de07c5ec0778a351aef5c9c62c54965eb8e42;hpb=ae019a20d2db44c52767f5cd6291f3276067446b;p=ghc-hetmet.git diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 9a7de07..2d28ae6 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -722,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 ] ]