X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fmain%2FDynFlags.hs;h=0bd669041fefefd19c2daec1c6e263ce95910677;hb=6ec1fb0666d5493c236f856e8512a78700dd2b07;hp=aa2a400d04d3306f79be1bda431ca407648a37c4;hpb=70dd3e6b74d368f2df585c18d86426373e7e89e5;p=ghc-hetmet.git diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index aa2a400..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 ] ] @@ -1267,11 +1274,13 @@ machdepCCOpts dflags -- and get in the way of -split-objs. Another option -- would be to throw them away in the mangler, but this -- is easier. +#ifdef HAVE_GCC_HAS_NO_UNIT_AT_A_TIME "-fno-unit-at-a-time", -- unit-at-a-time doesn't do us any good, and screws -- up -split-objs by moving the split markers around. -- It's only turned on with -O2, but put it here just -- in case someone uses -optc-O2. +#endif "-fno-builtin" -- calling builtins like strlen() using the FFI can -- cause gcc to run out of regs, so use the external