diff options
author | Sebastian Graf <sebastian.graf@kit.edu> | 2019-02-19 13:52:11 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-03-07 20:44:08 -0500 |
commit | 1675d40afe07b9c414eaa37d85819f37f8420118 (patch) | |
tree | 0e0fe32fdf1a70a90e2c531a89b0a16b07fbad20 /testsuite/tests/stranal | |
parent | 068b7e983f4a0b35f453aa5e609998efd0c3f334 (diff) | |
download | haskell-1675d40afe07b9c414eaa37d85819f37f8420118.tar.gz |
Always do the worker/wrapper split for NOINLINEs
Trac #10069 revealed that small NOINLINE functions didn't get split
into worker and wrapper. This was due to `certainlyWillInline`
saying that any unfoldings with a guidance of `UnfWhen` inline
unconditionally. That isn't the case for NOINLINE functions, so we
catch this case earlier now.
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%
--------------------------------------------------------------------------------
Min -0.3% -0.8%
Max +0.0% +0.1%
Geometric Mean -0.0% -0.0%
Fixes #10069.
-------------------------
Metric Increase:
T9233
-------------------------
Diffstat (limited to 'testsuite/tests/stranal')
-rw-r--r-- | testsuite/tests/stranal/should_compile/T10069.hs | 11 | ||||
-rw-r--r-- | testsuite/tests/stranal/should_compile/T10069.stderr | 1 | ||||
-rw-r--r-- | testsuite/tests/stranal/should_compile/all.T | 1 |
3 files changed, 13 insertions, 0 deletions
diff --git a/testsuite/tests/stranal/should_compile/T10069.hs b/testsuite/tests/stranal/should_compile/T10069.hs new file mode 100644 index 0000000000..f93eaf5678 --- /dev/null +++ b/testsuite/tests/stranal/should_compile/T10069.hs @@ -0,0 +1,11 @@ +module T10069 where + +data C = C !Int !Int + +{-# NOINLINE c1 #-} +c1 :: C -> Int +c1 (C _ c) = c + +{-# NOINLINE fc #-} +fc :: C -> Int +fc c = c1 c + c1 c diff --git a/testsuite/tests/stranal/should_compile/T10069.stderr b/testsuite/tests/stranal/should_compile/T10069.stderr new file mode 100644 index 0000000000..97c255a536 --- /dev/null +++ b/testsuite/tests/stranal/should_compile/T10069.stderr @@ -0,0 +1 @@ +T10069.$wc1 [InlPrag=NOINLINE] :: GHC.Prim.Int# -> GHC.Prim.Int# diff --git a/testsuite/tests/stranal/should_compile/all.T b/testsuite/tests/stranal/should_compile/all.T index c94065b2e4..3cff3c7888 100644 --- a/testsuite/tests/stranal/should_compile/all.T +++ b/testsuite/tests/stranal/should_compile/all.T @@ -48,3 +48,4 @@ test('T13077a', normal, compile, ['']) test('T15627', [ grep_errmsg(r'(wmutVar|warray).*Int#') ], compile, ['-dppr-cols=200 -ddump-simpl']) test('T16029', normal, makefile_test, []) +test('T10069', [ grep_errmsg(r'(wc1).*Int#$') ], compile, ['-dppr-cols=200 -ddump-simpl']) |