summaryrefslogtreecommitdiff
path: root/compiler/coreSyn/MkCore.hs
diff options
context:
space:
mode:
authorSebastian Graf <sebastian.graf@kit.edu>2019-01-28 16:49:04 +0100
committerSebastian Graf <sebastian.graf@kit.edu>2020-02-12 11:00:58 +0100
commit059c3c9d7c84fc37c69e9f414ff736d47081e72c (patch)
treeda3c17ac002b9c6d31542af78553769fd40d5d65 /compiler/coreSyn/MkCore.hs
parentf0c0ee7d9a942a19361e72553cd08f42cc12b04a (diff)
downloadhaskell-wip/sep-cpr.tar.gz
Separate CPR analysis from the Demand analyserwip/sep-cpr
The reasons for that can be found in the wiki: https://gitlab.haskell.org/ghc/ghc/wikis/nested-cpr/split-off-cpr We now run CPR after demand analysis (except for after the final demand analysis run just before code gen). CPR got its own dump flags (`-ddump-cpr-anal`, `-ddump-cpr-signatures`), but not its own flag to activate/deactivate. It will run with `-fstrictness`/`-fworker-wrapper`. As explained on the wiki page, this step is necessary for a sane Nested CPR analysis. And it has quite positive impact on compiler performance: Metric Decrease: T9233 T9675 T9961 T15263
Diffstat (limited to 'compiler/coreSyn/MkCore.hs')
-rw-r--r--compiler/coreSyn/MkCore.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/coreSyn/MkCore.hs b/compiler/coreSyn/MkCore.hs
index a261a98451..e21d980775 100644
--- a/compiler/coreSyn/MkCore.hs
+++ b/compiler/coreSyn/MkCore.hs
@@ -74,6 +74,7 @@ import TysPrim
import DataCon ( DataCon, dataConWorkId )
import IdInfo
import Demand
+import Cpr
import Name hiding ( varName )
import Outputable
import FastString
@@ -797,7 +798,8 @@ tYPE_ERROR_ID = mkRuntimeErrorId typeErrorName
aBSENT_SUM_FIELD_ERROR_ID
= mkVanillaGlobalWithInfo absentSumFieldErrorName
(mkSpecForAllTys [alphaTyVar] (mkTyVarTy alphaTyVar)) -- forall a . a
- (vanillaIdInfo `setStrictnessInfo` mkClosedStrictSig [] botRes
+ (vanillaIdInfo `setStrictnessInfo` mkClosedStrictSig [] botDiv
+ `setCprInfo` mkCprSig 0 botCpr
`setArityInfo` 0
`setCafInfo` NoCafRefs) -- #15038
@@ -812,6 +814,7 @@ mkRuntimeErrorId name
= mkVanillaGlobalWithInfo name runtimeErrorTy bottoming_info
where
bottoming_info = vanillaIdInfo `setStrictnessInfo` strict_sig
+ `setCprInfo` mkCprSig 1 botCpr
`setArityInfo` 1
-- Make arity and strictness agree
@@ -824,7 +827,7 @@ mkRuntimeErrorId name
-- any pc_bottoming_Id will itself have CafRefs, which bloats
-- SRTs.
- strict_sig = mkClosedStrictSig [evalDmd] botRes
+ strict_sig = mkClosedStrictSig [evalDmd] botDiv
runtimeErrorTy :: Type
-- forall (rr :: RuntimeRep) (a :: rr). Addr# -> a