From c99e67023d15b84455c9f6bf363b9f720da4bfd9 Mon Sep 17 00:00:00 2001 From: Roman Leshchinskiy Date: Fri, 30 Oct 2009 02:09:03 +0000 Subject: [PATCH] Don't dump Core after every simplifier iteration with -dverbose-core2core This just restores the behaviour from before the inline patch. --- compiler/simplCore/CoreMonad.lhs | 6 +++++- compiler/simplCore/SimplCore.lhs | 10 +++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/compiler/simplCore/CoreMonad.lhs b/compiler/simplCore/CoreMonad.lhs index f806089..9eef502 100644 --- a/compiler/simplCore/CoreMonad.lhs +++ b/compiler/simplCore/CoreMonad.lhs @@ -25,7 +25,7 @@ module CoreMonad ( findAnnotations, deserializeAnnotations, addAnnotation, -- ** Debug output - endPass, endPassIf, + endPass, endPassIf, endIteration, -- ** Screen output putMsg, putMsgS, errorMsg, errorMsgS, @@ -97,6 +97,10 @@ endPass = dumpAndLint Err.dumpIfSet_core endPassIf :: Bool -> DynFlags -> String -> DynFlag -> [CoreBind] -> [CoreRule] -> IO () endPassIf cond = dumpAndLint (Err.dumpIf_core cond) +-- Same as endPass but doesn't dump Core even with -dverbose-core2core +endIteration :: DynFlags -> String -> DynFlag -> [CoreBind] -> [CoreRule] -> IO () +endIteration = dumpAndLint Err.dumpIfSet_dyn + dumpAndLint :: (DynFlags -> DynFlag -> String -> SDoc -> IO ()) -> DynFlags -> String -> DynFlag -> [CoreBind] -> [CoreRule] -> IO () diff --git a/compiler/simplCore/SimplCore.lhs b/compiler/simplCore/SimplCore.lhs index 62c3c35..5bdf6ee 100644 --- a/compiler/simplCore/SimplCore.lhs +++ b/compiler/simplCore/SimplCore.lhs @@ -611,7 +611,7 @@ simplifyPgmIO mode switches hsc_env us hpt_rule_base let { binds2 = {-# SCC "ZapInd" #-} shortOutIndirections binds1 } ; -- Dump the result of this iteration - endIteration dflags mode iteration_no max_iterations counts1 binds2 rules1 ; + end_iteration dflags mode iteration_no max_iterations counts1 binds2 rules1 ; -- Loop do_iteration us2 (iteration_no + 1) all_counts binds2 rules1 @@ -620,14 +620,14 @@ simplifyPgmIO mode switches hsc_env us hpt_rule_base (us1, us2) = splitUniqSupply us ------------------- -endIteration :: DynFlags -> SimplifierMode -> Int -> Int +end_iteration :: DynFlags -> SimplifierMode -> Int -> Int -> SimplCount -> [CoreBind] -> [CoreRule] -> IO () --- Same as endPass but with simplifier counts -endIteration dflags mode iteration_no max_iterations counts binds rules +-- Same as endIteration but with simplifier counts +end_iteration dflags mode iteration_no max_iterations counts binds rules = do { Err.dumpIfSet_dyn dflags Opt_D_dump_simpl_iterations pass_name (pprSimplCount counts) ; - ; endPass dflags pass_name Opt_D_dump_simpl_iterations binds rules } + ; endIteration dflags pass_name Opt_D_dump_simpl_iterations binds rules } where pass_name = "Simplifier mode " ++ showPpr mode ++ ", iteration " ++ show iteration_no ++ -- 1.7.10.4