summaryrefslogtreecommitdiff
path: root/testsuite/tests/stranal/sigs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2020-03-20 08:48:47 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-03-29 17:29:30 -0400
commit54250f2d8de910b094070c1b48f086030df634b1 (patch)
treee062c160912d97eefbdd21d2ce239fd824089e43 /testsuite/tests/stranal/sigs
parentf1a6c73d01912b389e012a0af81a5c2002e82636 (diff)
downloadhaskell-54250f2d8de910b094070c1b48f086030df634b1.tar.gz
Demand analysis: simplify the demand for a RHS
Ticket #17932 showed that we were using a stupid demand for the RHS of a let-binding, when the result is a product. This was the result of a "fix" in 2013, which (happily) turns out to no longer be necessary. So I just deleted the code, which simplifies the demand analyser, and fixes #17932. That in turn uncovered that the anticipation of worker/wrapper in CPR analysis was inaccurate, hence the logic that decides whether to unbox an argument in WW was extracted into a function `wantToUnbox`, now consulted by CPR analysis. I tried nofib, and got 0.0% perf changes. All this came up when messing about with !2873 (ticket #17917), but is idependent of it. Unfortunately, this patch regresses #4267 and realised that it is now blocked on #16335.
Diffstat (limited to 'testsuite/tests/stranal/sigs')
-rw-r--r--testsuite/tests/stranal/sigs/DmdAnalGADTs.stderr6
-rw-r--r--testsuite/tests/stranal/sigs/T17932.hs11
-rw-r--r--testsuite/tests/stranal/sigs/T17932.stderr30
-rw-r--r--testsuite/tests/stranal/sigs/UnsatFun.stderr8
-rw-r--r--testsuite/tests/stranal/sigs/all.T1
5 files changed, 49 insertions, 7 deletions
diff --git a/testsuite/tests/stranal/sigs/DmdAnalGADTs.stderr b/testsuite/tests/stranal/sigs/DmdAnalGADTs.stderr
index 96b6bf669f..a42d492099 100644
--- a/testsuite/tests/stranal/sigs/DmdAnalGADTs.stderr
+++ b/testsuite/tests/stranal/sigs/DmdAnalGADTs.stderr
@@ -9,7 +9,7 @@ DmdAnalGADTs.f: <S,1*U>
DmdAnalGADTs.f': <S,1*U>
DmdAnalGADTs.g: <S,1*U>
DmdAnalGADTs.hasCPR:
-DmdAnalGADTs.hasStrSig: <S,1*U(U)>
+DmdAnalGADTs.hasStrSig: <S,1*U>
@@ -23,7 +23,7 @@ DmdAnalGADTs.f:
DmdAnalGADTs.f': m1
DmdAnalGADTs.g:
DmdAnalGADTs.hasCPR: m1
-DmdAnalGADTs.hasStrSig: m1
+DmdAnalGADTs.hasStrSig:
@@ -37,6 +37,6 @@ DmdAnalGADTs.f: <S,1*U>
DmdAnalGADTs.f': <S,1*U>
DmdAnalGADTs.g: <S,1*U>
DmdAnalGADTs.hasCPR:
-DmdAnalGADTs.hasStrSig: <S,1*U(U)>
+DmdAnalGADTs.hasStrSig: <S,1*U>
diff --git a/testsuite/tests/stranal/sigs/T17932.hs b/testsuite/tests/stranal/sigs/T17932.hs
new file mode 100644
index 0000000000..4f59ded3eb
--- /dev/null
+++ b/testsuite/tests/stranal/sigs/T17932.hs
@@ -0,0 +1,11 @@
+-- See commentary in #17932
+
+module T17932 where
+
+flags (Options f x)
+ = reverse (reverse (reverse (reverse (reverse (reverse (reverse (reverse x)))))))
+ `seq` f
+
+data X = X String Bool Bool Bool Bool
+
+data Options = Options !X [Int]
diff --git a/testsuite/tests/stranal/sigs/T17932.stderr b/testsuite/tests/stranal/sigs/T17932.stderr
new file mode 100644
index 0000000000..c086c8cd86
--- /dev/null
+++ b/testsuite/tests/stranal/sigs/T17932.stderr
@@ -0,0 +1,30 @@
+
+==================== Strictness signatures ====================
+T17932.$tc'Options:
+T17932.$tc'X:
+T17932.$tcOptions:
+T17932.$tcX:
+T17932.$trModule:
+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.flags:
+
+
+
+==================== Strictness signatures ====================
+T17932.$tc'Options:
+T17932.$tc'X:
+T17932.$tcOptions:
+T17932.$tcX:
+T17932.$trModule:
+T17932.flags: <S(SS),1*U(1*U,1*U)>
+
+
diff --git a/testsuite/tests/stranal/sigs/UnsatFun.stderr b/testsuite/tests/stranal/sigs/UnsatFun.stderr
index 1f5a58b422..aedf131826 100644
--- a/testsuite/tests/stranal/sigs/UnsatFun.stderr
+++ b/testsuite/tests/stranal/sigs/UnsatFun.stderr
@@ -5,8 +5,8 @@ UnsatFun.f: <B,1*U(U)><B,A>b
UnsatFun.g: <B,1*U(U)>b
UnsatFun.g': <L,1*U(U)>
UnsatFun.g3: <L,U(U)>
-UnsatFun.h: <C(S),1*C1(U(U))>
-UnsatFun.h2: <S,1*U><L,1*C1(U(U))>
+UnsatFun.h: <C(S),1*C1(U)>
+UnsatFun.h2: <S,1*U><L,1*C1(U)>
UnsatFun.h3: <C(S),1*C1(U)>
@@ -29,8 +29,8 @@ UnsatFun.f: <B,1*U(U)><B,A>b
UnsatFun.g: <B,1*U(U)>b
UnsatFun.g': <L,1*U(U)>
UnsatFun.g3: <L,U(U)>
-UnsatFun.h: <C(S),1*C1(U(U))>
-UnsatFun.h2: <S,1*U><L,1*C1(U(U))>
+UnsatFun.h: <C(S),1*C1(U)>
+UnsatFun.h2: <S,1*U><L,1*C1(U)>
UnsatFun.h3: <C(S),1*C1(U)>
diff --git a/testsuite/tests/stranal/sigs/all.T b/testsuite/tests/stranal/sigs/all.T
index f7cbd3761d..3afe9c7cd8 100644
--- a/testsuite/tests/stranal/sigs/all.T
+++ b/testsuite/tests/stranal/sigs/all.T
@@ -19,3 +19,4 @@ test('T12370', normal, compile, [''])
test('CaseBinderCPR', normal, compile, [''])
test('NewtypeArity', normal, compile, [''])
test('T5075', normal, compile, [''])
+test('T17932', normal, compile, [''])