summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorSebastian Graf <sebastian.graf@kit.edu>2018-11-23 16:24:18 +0100
committerSebastian Graf <sebastian.graf@kit.edu>2018-11-23 16:26:02 +0100
commitb2950e03b551d82d62ec25eb232284aaf121b4e2 (patch)
tree9f60d45f9ffaf350173a3d2aab0beda622bc3da2 /docs
parent7856676b72526cd674e84c43064b61ff3a07a0a1 (diff)
downloadhaskell-b2950e03b551d82d62ec25eb232284aaf121b4e2.tar.gz
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
Diffstat (limited to 'docs')
-rw-r--r--docs/users_guide/using-optimisation.rst52
1 files changed, 52 insertions, 0 deletions
diff --git a/docs/users_guide/using-optimisation.rst b/docs/users_guide/using-optimisation.rst
index 0048478683..bdae8b6b1c 100644
--- a/docs/users_guide/using-optimisation.rst
+++ b/docs/users_guide/using-optimisation.rst
@@ -1004,6 +1004,58 @@ by saying ``-fno-wombat``.
Chapter 7 of `Andre Santos's PhD
thesis <http://research.microsoft.com/en-us/um/people/simonpj/papers/santos-thesis.ps.gz>`__
+.. ghc-flag:: -fstg-lift-lams
+ :shortdesc: Enable late lambda lifting on the STG intermediate
+ language. Implied by :ghc-flag:`-O2`.
+ :type: dynamic
+ :reverse: -fno-stg-lift-lams
+ :category:
+
+ :default: on
+
+ Enables the late lambda lifting optimisation on the STG
+ intermediate language. This selectively lifts local functions to
+ top-level by converting free variables into function parameters.
+
+.. ghc-flag:: -fstg-lift-lams-known
+ :shortdesc: Allow turning known into unknown calls while performing
+ late lambda lifting.
+ :type: dynamic
+ :reverse: -fno-stg-lift-lams-known
+ :category:
+
+ :default: off
+
+ Allow turning known into unknown calls while performing
+ late lambda lifting. This is deemed non-beneficial, so it's
+ off by default.
+
+.. ghc-flag:: -fstg-lift-lams-non-rec-args
+ :shortdesc: Create top-level non-recursive functions with at most <n>
+ parameters while performing late lambda lifting.
+ :type: dynamic
+ :reverse: -fno-stg-lift-lams-non-rec-args-any
+ :category:
+
+ :default: 5
+
+ Create top-level non-recursive functions with at most <n> parameters
+ while performing late lambda lifting. The default is 5, the number of
+ available parameter registers on x86_64.
+
+.. ghc-flag:: -fstg-lift-lams-rec-args
+ :shortdesc: Create top-level recursive functions with at most <n>
+ parameters while performing late lambda lifting.
+ :type: dynamic
+ :reverse: -fno-stg-lift-lams-rec-args-any
+ :category:
+
+ :default: 5
+
+ Create top-level recursive functions with at most <n> parameters
+ while performing late lambda lifting. The default is 5, the number of
+ available parameter registers on x86_64.
+
.. ghc-flag:: -fstrictness
:shortdesc: Turn on strictness analysis.
Implied by :ghc-flag:`-O`. Implies :ghc-flag:`-fworker-wrapper`