summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Klebinger <klebinger.andreas@gmx.at>2021-12-22 16:09:38 +0100
committerAndreas Klebinger <klebinger.andreas@gmx.at>2021-12-22 16:09:38 +0100
commit0492eec2eadfe76ed0bbf957244cd5daab5178ed (patch)
tree26db76b3749b52a2d5907ae0a0bb2eb548abf469
parent09b6cb45505c2c32ddaffcdb930fb3f7873b2cfc (diff)
downloadhaskell-wip/andreask/caller_cc_fix.tar.gz
Make callerCC profiling mode represent entry counter flag.wip/andreask/caller_cc_fix
Fixes #20854
-rw-r--r--compiler/GHC/Core/Opt/CallerCC.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/GHC/Core/Opt/CallerCC.hs b/compiler/GHC/Core/Opt/CallerCC.hs
index 3c47da66af..8808296126 100644
--- a/compiler/GHC/Core/Opt/CallerCC.hs
+++ b/compiler/GHC/Core/Opt/CallerCC.hs
@@ -79,12 +79,13 @@ doExpr env e@(Var v)
ccName :: CcName
ccName = mkFastString $ showSDoc (dflags env) nameDoc
ccIdx <- getCCIndex' ccName
- let span = case revParents env of
+ let count = gopt Opt_ProfCountEntries (dflags env)
+ span = case revParents env of
top:_ -> nameSrcSpan $ varName top
_ -> noSrcSpan
cc = NormalCC (ExprCC ccIdx) ccName (thisModule env) span
tick :: CoreTickish
- tick = ProfNote cc True True
+ tick = ProfNote cc count True
pure $ Tick tick e
| otherwise = pure e
doExpr _env e@(Lit _) = pure e