Compute demand signatures assuming idArity
authorSebastian Graf <sebastian.graf@kit.edu>
Thu, 7 Feb 2019 14:34:07 +0000 (15:34 +0100)
committerMarge Bot <ben+marge-bot@smart-cactus.org>
Wed, 1 May 2019 00:23:21 +0000 (20:23 -0400)
commit014ed644eea9037427c1ebeaac16189b00f9dbc7
tree4e41d1183e559e81a0fbdb1cf9c16fae0448ee43
parent1abb76ab8e32e7be224631506201d1beec62a5c2
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%
17 files changed:
compiler/basicTypes/Demand.hs
compiler/basicTypes/Id.hs
compiler/basicTypes/IdInfo.hs
compiler/basicTypes/Var.hs
compiler/coreSyn/CoreArity.hs
compiler/coreSyn/CoreLint.hs
compiler/coreSyn/CoreUnfold.hs
compiler/simplCore/SimplMonad.hs
compiler/simplCore/SimplUtils.hs
compiler/stranal/DmdAnal.hs
compiler/stranal/WorkWrap.hs
compiler/stranal/WwLib.hs
testsuite/tests/perf/compiler/WWRec.hs [new file with mode: 0644]
testsuite/tests/perf/compiler/all.T
testsuite/tests/stranal/sigs/NewtypeArity.hs [new file with mode: 0644]
testsuite/tests/stranal/sigs/NewtypeArity.stderr [new file with mode: 0644]
testsuite/tests/stranal/sigs/all.T