summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2021-09-13 23:35:14 -0400
committerBen Gamari <ben@smart-cactus.org>2021-09-13 23:35:14 -0400
commit7c301bb5b88db6f58675a4ce64593740147cfd5a (patch)
tree7072062292dd1c5f7a9f654c091309d5f92253b5
parent64923cf295ea914db458547432237a5ed1eff571 (diff)
downloadhaskell-wip/core-opt-sccs.tar.gz
compiler: Ensure that all CoreTodos have SCCswip/core-opt-sccs
In #20365 we noticed that a significant amount of time is spend in the Core2Core cost-center, suggesting that some passes are likely missing SCC pragmas. Try to fix this.
-rw-r--r--compiler/GHC/Core/Lint.hs2
-rw-r--r--compiler/GHC/Core/Opt/Pipeline.hs6
2 files changed, 5 insertions, 3 deletions
diff --git a/compiler/GHC/Core/Lint.hs b/compiler/GHC/Core/Lint.hs
index 405f2c1116..9fdccffc40 100644
--- a/compiler/GHC/Core/Lint.hs
+++ b/compiler/GHC/Core/Lint.hs
@@ -3296,7 +3296,7 @@ dupExtVars vars
-- consistency checks: We check this by running the given task twice,
-- noting all differences between the results.
lintAnnots :: SDoc -> (ModGuts -> CoreM ModGuts) -> ModGuts -> CoreM ModGuts
-lintAnnots pname pass guts = do
+lintAnnots pname pass guts = {-# SCC "lintAnnots" #-} do
-- Run the pass as we normally would
dflags <- getDynFlags
logger <- getLogger
diff --git a/compiler/GHC/Core/Opt/Pipeline.hs b/compiler/GHC/Core/Opt/Pipeline.hs
index 4d1b4cbc59..77a34a9619 100644
--- a/compiler/GHC/Core/Opt/Pipeline.hs
+++ b/compiler/GHC/Core/Opt/Pipeline.hs
@@ -525,9 +525,11 @@ doCorePass pass guts = do
CoreAddCallerCcs -> {-# SCC "AddCallerCcs" #-}
addCallerCostCentres guts
- CoreDoPrintCore -> liftIO $ printCore logger (mg_binds guts) >> return guts
+ CoreDoPrintCore -> {-# SCC "PrintCore" #-}
+ liftIO $ printCore logger (mg_binds guts) >> return guts
- CoreDoRuleCheck phase pat -> ruleCheckPass phase pat guts
+ CoreDoRuleCheck phase pat -> {-# SCC "RuleCheck" #-}
+ ruleCheckPass phase pat guts
CoreDoNothing -> return guts
CoreDoPasses passes -> runCorePasses passes guts