X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fmain%2FDynFlags.hs;h=cf73f4219628375a36bc29f58cab590755ec1d16;hb=273be06fa7cb1297284dbb553ecc9be7d07df6af;hp=07698122bdde4f44ff1ff67def8626844bec424c;hpb=862106eb2518f437b9f10dc9367e99454ebd8072;p=ghc-hetmet.git diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 0769812..cf73f42 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 ] ] @@ -1249,6 +1256,13 @@ machdepCCOpts dflags -- -fomit-frame-pointer, so we disable it first here. "-mno-omit-leaf-frame-pointer", #endif +#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 "-fomit-frame-pointer", -- we want -fno-builtin, because when gcc inlines -- built-in functions like memcpy() it tends to