X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FsimplCore%2FSimplCore.lhs;h=95bd40b331f233fa8894be652e2d2f08ed51d6a6;hb=993ce43d3f3fb6bdb04cbc6d82babdd23355f7d7;hp=fc5b90323076546085075bf49c2f6ab8b08dc52d;hpb=b4229ab662b6d87b1477bafa85d2db46e5a9a152;p=ghc-hetmet.git diff --git a/compiler/simplCore/SimplCore.lhs b/compiler/simplCore/SimplCore.lhs index fc5b903..95bd40b 100644 --- a/compiler/simplCore/SimplCore.lhs +++ b/compiler/simplCore/SimplCore.lhs @@ -57,11 +57,13 @@ import StrictAnal ( saBinds ) import CprAnalyse ( cprAnalyse ) #endif import Vectorise ( vectorise ) +import Util import UniqSupply ( UniqSupply, mkSplitUniqSupply, splitUniqSupply ) import IO ( hPutStr, stderr ) import Outputable -import List ( partition ) +import Control.Monad +import List ( partition, intersperse ) import Maybes \end{code} @@ -463,8 +465,11 @@ simplifyPgm mode switches hsc_env us imp_rule_base guts where dflags = hsc_dflags hsc_env phase_info = case mode of - SimplGently -> "gentle" - SimplPhase n -> show n + SimplGently -> "gentle" + SimplPhase n ss -> shows n + . showString " [" + . showString (concat $ intersperse "," ss) + $ "]" dump_phase = shouldDumpSimplPhase dflags mode @@ -476,17 +481,13 @@ simplifyPgm mode switches hsc_env us imp_rule_base guts -- about to begin, with '1' for the first | iteration_no > max_iterations -- Stop if we've run out of iterations = do { -#ifdef DEBUG - if max_iterations > 2 then - hPutStr stderr ("NOTE: Simplifier still going after " ++ + when (debugIsOn && (max_iterations > 2)) $ + hPutStr stderr ("NOTE: Simplifier still going after " ++ show max_iterations ++ " iterations; bailing out. Size = " ++ show (coreBindsSize binds) ++ "\n" ) - else - return (); -#endif -- Subtract 1 from iteration_no to get the -- number of iterations we actually completed - return ("Simplifier baled out", iteration_no - 1, counts, binds) + ; return ("Simplifier bailed out", iteration_no - 1, counts, binds) } -- Try and force thunks off the binds; significantly reduces