summaryrefslogtreecommitdiff
path: root/testsuite/tests/stranal
diff options
context:
space:
mode:
authorSebastian Graf <sebastian.graf@kit.edu>2019-02-07 15:34:07 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-04-30 20:23:21 -0400
commit014ed644eea9037427c1ebeaac16189b00f9dbc7 (patch)
tree4e41d1183e559e81a0fbdb1cf9c16fae0448ee43 /testsuite/tests/stranal
parent1abb76ab8e32e7be224631506201d1beec62a5c2 (diff)
downloadhaskell-014ed644eea9037427c1ebeaac16189b00f9dbc7.tar.gz
Compute demand signatures assuming idArity
This does four things: 1. Look at `idArity` instead of manifest lambdas to decide whether to use LetUp 2. Compute the strictness signature in LetDown assuming at least `idArity` incoming arguments 3. Remove the special case for trivial RHSs, which is subsumed by 2 4. Don't perform the W/W split when doing so would eta expand a binding. Otherwise we would eta expand PAPs, causing unnecessary churn in the Simplifier. NoFib Results -------------------------------------------------------------------------------- Program Allocs Instrs -------------------------------------------------------------------------------- fannkuch-redux +0.3% 0.0% gg -0.0% -0.1% maillist +0.2% +0.2% minimax 0.0% +0.8% pretty 0.0% -0.1% reptile -0.0% -1.2% -------------------------------------------------------------------------------- Min -0.0% -1.2% Max +0.3% +0.8% Geometric Mean +0.0% -0.0%
Diffstat (limited to 'testsuite/tests/stranal')
-rw-r--r--testsuite/tests/stranal/sigs/NewtypeArity.hs10
-rw-r--r--testsuite/tests/stranal/sigs/NewtypeArity.stderr18
-rw-r--r--testsuite/tests/stranal/sigs/all.T1
3 files changed, 29 insertions, 0 deletions
diff --git a/testsuite/tests/stranal/sigs/NewtypeArity.hs b/testsuite/tests/stranal/sigs/NewtypeArity.hs
new file mode 100644
index 0000000000..3a8e96bf41
--- /dev/null
+++ b/testsuite/tests/stranal/sigs/NewtypeArity.hs
@@ -0,0 +1,10 @@
+-- | 't' and 't2' should have a strictness signature for arity 2 here.
+module Test where
+
+newtype T = MkT (Int -> Int -> Int)
+
+t :: T
+t = MkT (\a b -> a + b)
+
+t2 :: T
+t2 = MkT (+)
diff --git a/testsuite/tests/stranal/sigs/NewtypeArity.stderr b/testsuite/tests/stranal/sigs/NewtypeArity.stderr
new file mode 100644
index 0000000000..08ce83f9bd
--- /dev/null
+++ b/testsuite/tests/stranal/sigs/NewtypeArity.stderr
@@ -0,0 +1,18 @@
+
+==================== Strictness signatures ====================
+Test.$tc'MkT: m
+Test.$tcT: m
+Test.$trModule: m
+Test.t: <S,1*U(U)><S,1*U(U)>m
+Test.t2: <S,1*U(U)><S,1*U(U)>m
+
+
+
+==================== Strictness signatures ====================
+Test.$tc'MkT: m
+Test.$tcT: m
+Test.$trModule: m
+Test.t: <S,1*U(U)><S,1*U(U)>m
+Test.t2: <S,1*U(U)><S,1*U(U)>m
+
+
diff --git a/testsuite/tests/stranal/sigs/all.T b/testsuite/tests/stranal/sigs/all.T
index 091a4f47ee..fca319f1a3 100644
--- a/testsuite/tests/stranal/sigs/all.T
+++ b/testsuite/tests/stranal/sigs/all.T
@@ -17,3 +17,4 @@ test('BottomFromInnerLambda', normal, compile, [''])
test('DmdAnalGADTs', normal, compile, [''])
test('T12370', normal, compile, [''])
test('CaseBinderCPR', normal, compile, [''])
+test('NewtypeArity', normal, compile, [''])