Implement late lambda lift
authorSebastian Graf <sebastian.graf@kit.edu>
Fri, 23 Nov 2018 15:24:18 +0000 (16:24 +0100)
committerSebastian Graf <sebastian.graf@kit.edu>
Fri, 23 Nov 2018 15:26:02 +0000 (16:26 +0100)
commitb2950e03b551d82d62ec25eb232284aaf121b4e2
tree9f60d45f9ffaf350173a3d2aab0beda622bc3da2
parent7856676b72526cd674e84c43064b61ff3a07a0a1
Implement late lambda lift

Summary:
This implements a selective lambda-lifting pass late in the STG
pipeline.

Lambda lifting has the effect of avoiding closure allocation at the cost
of having to make former free vars available at call sites, possibly
enlarging closures surrounding call sites in turn.

We identify beneficial cases by means of an analysis that estimates
closure growth.

There's a Wiki page at
https://ghc.haskell.org/trac/ghc/wiki/LateLamLift.

Reviewers: simonpj, bgamari, simonmar

Reviewed By: simonpj

Subscribers: rwbarton, carter

GHC Trac Issues: #9476

Differential Revision: https://phabricator.haskell.org/D5224
24 files changed:
compiler/basicTypes/Demand.hs
compiler/basicTypes/Id.hs
compiler/codeGen/StgCmm.hs
compiler/codeGen/StgCmmBind.hs
compiler/codeGen/StgCmmExpr.hs
compiler/ghc.cabal.in
compiler/main/DynFlags.hs
compiler/simplStg/SimplStg.hs
compiler/simplStg/StgCse.hs
compiler/simplStg/StgLiftLams.hs [new file with mode: 0644]
compiler/simplStg/StgLiftLams/Analysis.hs [new file with mode: 0644]
compiler/simplStg/StgLiftLams/LiftM.hs [new file with mode: 0644]
compiler/simplStg/StgLiftLams/Transformation.hs [new file with mode: 0644]
compiler/simplStg/StgStats.hs
compiler/simplStg/UnariseStg.hs
compiler/stgSyn/CoreToStg.hs
compiler/stgSyn/StgFVs.hs
compiler/stgSyn/StgLint.hs
compiler/stgSyn/StgSubst.hs [new file with mode: 0644]
compiler/stgSyn/StgSyn.hs
docs/users_guide/using-optimisation.rst
inplace/test [deleted file]
inplace/test spaces [deleted symlink]
testsuite/tests/perf/join_points/all.T