summaryrefslogtreecommitdiff
path: root/testsuite/tests/simplCore
diff options
context:
space:
mode:
authorSebastian Graf <sebastian.graf@kit.edu>2021-08-25 14:46:25 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-09-18 12:01:44 -0400
commit4d245e548d4136a2034d4ec6171268eac2442fb8 (patch)
tree5fd5737bedce25459b03261bd78d1781164776e9 /testsuite/tests/simplCore
parent7bc16521b93f9db62190dd4397a836e101932b8c (diff)
downloadhaskell-4d245e548d4136a2034d4ec6171268eac2442fb8.tar.gz
WorkWrap: Update Note [Wrapper activation] (#15056)
The last point of the Conclusion was wrong; we inline functions without pragmas after the initial phase. It also appears that #15056 was fixed, as there already is a test T15056 which properly does foldr/build fusion for the reproducer. I made sure that T15056's `foo` is just large enough for WW to happen (which it wasn't), but for the worker to be small enough to inline into `blam`. Fixes #15056.
Diffstat (limited to 'testsuite/tests/simplCore')
-rw-r--r--testsuite/tests/simplCore/should_compile/T15056.stderr5
-rw-r--r--testsuite/tests/simplCore/should_compile/T15056a.hs2
2 files changed, 5 insertions, 2 deletions
diff --git a/testsuite/tests/simplCore/should_compile/T15056.stderr b/testsuite/tests/simplCore/should_compile/T15056.stderr
index 116def9073..df3844ab09 100644
--- a/testsuite/tests/simplCore/should_compile/T15056.stderr
+++ b/testsuite/tests/simplCore/should_compile/T15056.stderr
@@ -1,7 +1,10 @@
Rule fired: Class op - (BUILTIN)
Rule fired: Class op + (BUILTIN)
Rule fired: Class op + (BUILTIN)
+Rule fired: Class op + (BUILTIN)
+Rule fired: Class op enumFromTo (BUILTIN)
+Rule fired: +# (BUILTIN)
+Rule fired: +# (BUILTIN)
Rule fired: +# (BUILTIN)
Rule fired: Class op foldr (BUILTIN)
-Rule fired: Class op enumFromTo (BUILTIN)
Rule fired: fold/build (GHC.Base)
diff --git a/testsuite/tests/simplCore/should_compile/T15056a.hs b/testsuite/tests/simplCore/should_compile/T15056a.hs
index 6883a90e4b..410a8a10e8 100644
--- a/testsuite/tests/simplCore/should_compile/T15056a.hs
+++ b/testsuite/tests/simplCore/should_compile/T15056a.hs
@@ -5,7 +5,7 @@ test 0 = True
test n = test (n-1)
foo :: Foldable t => Int -> t Int -> Int
-foo n xs | test n
+foo n xs | test n && test (n+1)
= foldr (+) n xs
| otherwise
= n+7