summaryrefslogtreecommitdiff
path: root/compiler/GHC/Driver/Session.hs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2020-12-16 12:57:17 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-02-09 16:21:40 -0500
commit891a791f3f2438e5d768e1f96119d275e58e8d37 (patch)
tree5a051da2d04b14ce92bdcb98a5c5ab84c9d344fb /compiler/GHC/Driver/Session.hs
parentab5fd982a7a501136cb8b90fa841c02cc9551b5a (diff)
downloadhaskell-891a791f3f2438e5d768e1f96119d275e58e8d37.tar.gz
Reduce inlining in deeply-nested cases
This adds a new heuristic, controllable via two new flags to better tune inlining behaviour. The new flags are -funfolding-case-threshold and -funfolding-case-scaling which are document both in the user guide and in Note [Avoid inlining into deeply nested cases]. Co-authored-by: Andreas Klebinger <klebinger.andreas@gmx.at>
Diffstat (limited to 'compiler/GHC/Driver/Session.hs')
-rw-r--r--compiler/GHC/Driver/Session.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/GHC/Driver/Session.hs b/compiler/GHC/Driver/Session.hs
index 85f1b71852..cee4ba692b 100644
--- a/compiler/GHC/Driver/Session.hs
+++ b/compiler/GHC/Driver/Session.hs
@@ -2845,6 +2845,11 @@ dynamic_flags_deps = [
, make_ord_flag defFlag "funfolding-dict-discount"
(intSuffix (\n d -> d { unfoldingOpts = updateDictDiscount n (unfoldingOpts d)}))
+ , make_ord_flag defFlag "funfolding-case-threshold"
+ (intSuffix (\n d -> d { unfoldingOpts = updateCaseThreshold n (unfoldingOpts d)}))
+ , make_ord_flag defFlag "funfolding-case-scaling"
+ (intSuffix (\n d -> d { unfoldingOpts = updateCaseScaling n (unfoldingOpts d)}))
+
, make_dep_flag defFlag "funfolding-keeness-factor"
(floatSuffix (\_ d -> d))
"-funfolding-keeness-factor is no longer respected as of GHC 9.0"