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/simplCore | |
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/simplCore')
4 files changed, 4 insertions, 12 deletions
diff --git a/testsuite/tests/simplCore/should_compile/T13543.hs b/testsuite/tests/simplCore/should_compile/T13543.hs index 88a0b142b0..2697677edd 100644 --- a/testsuite/tests/simplCore/should_compile/T13543.hs +++ b/testsuite/tests/simplCore/should_compile/T13543.hs @@ -8,7 +8,7 @@ g (p,q) = p+q f :: Int -> Int -> Int -> Int f x p q - = g (let j y = (p,q) + = g (let j y = (y+p,q) {-# NOINLINE j #-} in case x of diff --git a/testsuite/tests/simplCore/should_compile/T4201.stdout b/testsuite/tests/simplCore/should_compile/T4201.stdout index 384c62aa4c..560cd7b762 100644 --- a/testsuite/tests/simplCore/should_compile/T4201.stdout +++ b/testsuite/tests/simplCore/should_compile/T4201.stdout @@ -1,3 +1,3 @@ - {- Arity: 1, HasNoCafRefs, Strictness: <S,1*U()>m, + {- Arity: 1, HasNoCafRefs, Strictness: <S,1*H>, Unfolding: InlineRule (0, True, True) bof `cast` (Sym (N:Foo[0]) ->_R <T>_R) -} diff --git a/testsuite/tests/simplCore/should_compile/T7360.stderr b/testsuite/tests/simplCore/should_compile/T7360.stderr index 41f67dc1d1..9c6dd2a01f 100644 --- a/testsuite/tests/simplCore/should_compile/T7360.stderr +++ b/testsuite/tests/simplCore/should_compile/T7360.stderr @@ -20,15 +20,7 @@ T7360.$WFoo3 -- RHS size: {terms: 5, types: 2, coercions: 0, joins: 0/0} fun1 [InlPrag=NOINLINE] :: Foo -> () -[GblId, - Arity=1, - Caf=NoCafRefs, - Str=<S,1*U>, - Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True, - WorkFree=True, Expandable=True, - Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=True) - Tmpl= \ (x [Occ=Once] :: Foo) -> - case x of { __DEFAULT -> GHC.Tuple.() }}] +[GblId, Arity=1, Caf=NoCafRefs, Str=<S,1*U>, Unf=OtherCon []] fun1 = \ (x :: Foo) -> case x of { __DEFAULT -> GHC.Tuple.() } -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} diff --git a/testsuite/tests/simplCore/should_run/all.T b/testsuite/tests/simplCore/should_run/all.T index 646929f778..8896ad5ee3 100644 --- a/testsuite/tests/simplCore/should_run/all.T +++ b/testsuite/tests/simplCore/should_run/all.T @@ -21,7 +21,7 @@ test('simplrun009', normal, compile_and_run, ['']) test('simplrun010', [extra_run_opts('24 16 8 +RTS -M10m -RTS'), exit_code(251)] , compile_and_run, ['']) -test('simplrun011', normal, compile_and_run, ['']) +test('simplrun011', normal, compile_and_run, ['-fno-worker-wrapper']) # Really we'd like to run T2486 too, to check that its # runtime has not gone up, but here I just compile it so that |