summaryrefslogtreecommitdiff
path: root/testsuite/tests/stranal
diff options
context:
space:
mode:
authorSebastian Graf <sebastian.graf@kit.edu>2021-02-10 13:41:52 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-02-28 06:10:39 -0500
commitdf2eca94ce8395fb9f52e83d8f3c790317a27c97 (patch)
tree5282dac50f1568da06e4b084ec5f3fc809b26046 /testsuite/tests/stranal
parentc3ff35bbd11fd213ec2773bc0a03e2533fda7c1a (diff)
downloadhaskell-df2eca94ce8395fb9f52e83d8f3c790317a27c97.tar.gz
CPR analysis: Use CPR of scrutinee for Case Binder CPR (#19232)
For years we have lived in a supposedly sweet spot that gave case binders the CPR property, unconditionally. Which is an optimistic hack that is now described in `Historical Note [Optimistic case binder CPR]`. In #19232 the concern was raised that this might do more harm than good and that might be better off simply by taking the CPR property of the scrutinee for the CPR type of the case binder. And indeed that's what we do now. Since `Note [CPR in a DataAlt case alternative]` is now only about field binders, I renamed and garbage collected it into `Note [Optimistic field binder CPR]`. NoFib approves: ``` NoFib Results -------------------------------------------------------------------------------- Program Allocs Instrs -------------------------------------------------------------------------------- anna +0.1% +0.1% nucleic2 -1.2% -0.6% sched 0.0% +0.9% transform -0.0% -0.1% -------------------------------------------------------------------------------- Min -1.2% -0.6% Max +0.1% +0.9% Geometric Mean -0.0% +0.0% ``` Fixes #19232.
Diffstat (limited to 'testsuite/tests/stranal')
-rw-r--r--testsuite/tests/stranal/sigs/CaseBinderCPR.hs15
-rw-r--r--testsuite/tests/stranal/sigs/CaseBinderCPR.stderr18
-rw-r--r--testsuite/tests/stranal/sigs/all.T1
3 files changed, 0 insertions, 34 deletions
diff --git a/testsuite/tests/stranal/sigs/CaseBinderCPR.hs b/testsuite/tests/stranal/sigs/CaseBinderCPR.hs
deleted file mode 100644
index 13f216347d..0000000000
--- a/testsuite/tests/stranal/sigs/CaseBinderCPR.hs
+++ /dev/null
@@ -1,15 +0,0 @@
-module CaseBinderCPR where
-
--- This example, taken from nofib's transform (and heavily reduced) ensures that
--- CPR information is added to a case binder
-
-f_list_cmp::(t1 -> t1 -> Int) -> [t1] -> [t1] -> Int;
-f_list_cmp a_cmp [] []= 0
-f_list_cmp a_cmp [] a_ys= -1
-f_list_cmp a_cmp a_xs []= 1
-f_list_cmp a_cmp (a_x:a_xs) (a_y:a_ys)=
- if r_order == 0
- then f_list_cmp a_cmp a_xs a_ys
- else r_order
- where
- r_order = a_cmp a_x a_y
diff --git a/testsuite/tests/stranal/sigs/CaseBinderCPR.stderr b/testsuite/tests/stranal/sigs/CaseBinderCPR.stderr
deleted file mode 100644
index ca6d3015ff..0000000000
--- a/testsuite/tests/stranal/sigs/CaseBinderCPR.stderr
+++ /dev/null
@@ -1,18 +0,0 @@
-
-==================== Strictness signatures ====================
-CaseBinderCPR.$trModule:
-CaseBinderCPR.f_list_cmp: <UCU(CS(P(MU)))><SU><SU>
-
-
-
-==================== Cpr signatures ====================
-CaseBinderCPR.$trModule:
-CaseBinderCPR.f_list_cmp: m1
-
-
-
-==================== Strictness signatures ====================
-CaseBinderCPR.$trModule:
-CaseBinderCPR.f_list_cmp: <UCU(CS(P(SU)))><SU><SU>
-
-
diff --git a/testsuite/tests/stranal/sigs/all.T b/testsuite/tests/stranal/sigs/all.T
index 07cc815823..5d562a6a8c 100644
--- a/testsuite/tests/stranal/sigs/all.T
+++ b/testsuite/tests/stranal/sigs/all.T
@@ -16,7 +16,6 @@ test('UnsatFun', normal, compile, [''])
test('BottomFromInnerLambda', normal, compile, [''])
test('DmdAnalGADTs', normal, compile, [''])
test('T12370', normal, compile, [''])
-test('CaseBinderCPR', normal, compile, [''])
test('NewtypeArity', normal, compile, [''])
test('T5075', normal, compile, [''])
test('T17932', normal, compile, [''])