summaryrefslogtreecommitdiff
path: root/testsuite/tests/stranal/sigs/T17932.stderr
diff options
context:
space:
mode:
authorSebastian Graf <sebastian.graf@kit.edu>2020-05-05 17:29:01 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-05-13 02:06:29 -0400
commit86d8ac22608eb8f04ceaff65e76dbeec23b76753 (patch)
tree66e0c1365014b13f87aefa882bbf7229e34f936a /testsuite/tests/stranal/sigs/T17932.stderr
parent90e38b8139c10854280da56664c040120256bacc (diff)
downloadhaskell-86d8ac22608eb8f04ceaff65e76dbeec23b76753.tar.gz
CprAnal: Don't attach CPR sigs to expandable bindings (#18154)
Instead, look through expandable unfoldings in `cprTransform`. See the new Note [CPR for expandable unfoldings]: ``` Long static data structures (whether top-level or not) like xs = x1 : xs1 xs1 = x2 : xs2 xs2 = x3 : xs3 should not get CPR signatures, because they * Never get WW'd, so their CPR signature should be irrelevant after analysis (in fact the signature might even be harmful for that reason) * Would need to be inlined/expanded to see their constructed product * Recording CPR on them blows up interface file sizes and is redundant with their unfolding. In case of Nested CPR, this blow-up can be quadratic! But we can't just stop giving DataCon application bindings the CPR property, for example fac 0 = 1 fac n = n * fac (n-1) fac certainly has the CPR property and should be WW'd! But FloatOut will transform the first clause to lvl = 1 fac 0 = lvl If lvl doesn't have the CPR property, fac won't either. But lvl doesn't have a CPR signature to extrapolate into a CPR transformer ('cprTransform'). So instead we keep on cprAnal'ing through *expandable* unfoldings for these arity 0 bindings via 'cprExpandUnfolding_maybe'. In practice, GHC generates a lot of (nested) TyCon and KindRep bindings, one for each data declaration. It's wasteful to attach CPR signatures to each of them (and intractable in case of Nested CPR). ``` Fixes #18154.
Diffstat (limited to 'testsuite/tests/stranal/sigs/T17932.stderr')
-rw-r--r--testsuite/tests/stranal/sigs/T17932.stderr10
1 files changed, 5 insertions, 5 deletions
diff --git a/testsuite/tests/stranal/sigs/T17932.stderr b/testsuite/tests/stranal/sigs/T17932.stderr
index c086c8cd86..7ca56637df 100644
--- a/testsuite/tests/stranal/sigs/T17932.stderr
+++ b/testsuite/tests/stranal/sigs/T17932.stderr
@@ -10,11 +10,11 @@ T17932.flags: <S(SS),1*U(1*U,1*U)>
==================== Cpr signatures ====================
-T17932.$tc'Options: m1
-T17932.$tc'X: m1
-T17932.$tcOptions: m1
-T17932.$tcX: m1
-T17932.$trModule: m1
+T17932.$tc'Options:
+T17932.$tc'X:
+T17932.$tcOptions:
+T17932.$tcX:
+T17932.$trModule:
T17932.flags: