Always do the worker/wrapper split for NOINLINEs
authorSebastian Graf <sebastian.graf@kit.edu>
Tue, 19 Feb 2019 12:52:11 +0000 (13:52 +0100)
committerMarge Bot <ben+marge-bot@smart-cactus.org>
Fri, 8 Mar 2019 01:44:08 +0000 (20:44 -0500)
commit1675d40afe07b9c414eaa37d85819f37f8420118
tree0e0fe32fdf1a70a90e2c531a89b0a16b07fbad20
parent068b7e983f4a0b35f453aa5e609998efd0c3f334
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
-------------------------
12 files changed:
compiler/coreSyn/CoreUnfold.hs
compiler/stranal/WorkWrap.hs
testsuite/tests/profiling/should_run/all.T
testsuite/tests/simplCore/should_compile/T13543.hs
testsuite/tests/simplCore/should_compile/T4201.stdout
testsuite/tests/simplCore/should_compile/T7360.stderr
testsuite/tests/simplCore/should_run/all.T
testsuite/tests/simplStg/should_compile/all.T
testsuite/tests/stranal/should_compile/T10069.hs [new file with mode: 0644]
testsuite/tests/stranal/should_compile/T10069.stderr [new file with mode: 0644]
testsuite/tests/stranal/should_compile/all.T
utils/genprimopcode/Main.hs