From 18283be3db288d21b79de7d65756a3442371c27f Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Mon, 13 Sep 2021 23:35:14 -0400 Subject: compiler: Ensure that all CoreTodos have 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. --- compiler/GHC/Core/Lint.hs | 2 +- compiler/GHC/Core/Opt/Pipeline.hs | 6 ++++-- 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 -- cgit v1.2.1