summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGergo ERDI <gergo@erdi.hu>2021-11-16 11:19:48 +0800
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-11-25 05:01:59 -0500
commitc9cead1ff7c5d3304543d52522ef4da96b802652 (patch)
tree08c25983098b95514ebf19b8c93c896b09b703b5
parentcf5279ed3733943eabd5fcd2dccab119ebfab9c2 (diff)
downloadhaskell-c9cead1ff7c5d3304543d52522ef4da96b802652.tar.gz
Add specific optimization flag for fast PAP calls (#6084, #20500)
-rw-r--r--compiler/GHC/Driver/Flags.hs1
-rw-r--r--compiler/GHC/Driver/Session.hs2
-rw-r--r--compiler/GHC/StgToCmm/Layout.hs2
-rw-r--r--docs/users_guide/expected-undocumented-flags.txt1
4 files changed, 5 insertions, 1 deletions
diff --git a/compiler/GHC/Driver/Flags.hs b/compiler/GHC/Driver/Flags.hs
index 02b42b1dcd..341851c81b 100644
--- a/compiler/GHC/Driver/Flags.hs
+++ b/compiler/GHC/Driver/Flags.hs
@@ -227,6 +227,7 @@ data GeneralFlag
| Opt_AlignmentSanitisation
| Opt_CatchBottoms
| Opt_NumConstantFolding
+ | Opt_FastPAPCalls -- #6084
-- PreInlining is on by default. The option is there just to see how
-- bad things get if you turn it off!
diff --git a/compiler/GHC/Driver/Session.hs b/compiler/GHC/Driver/Session.hs
index 92149c96f4..7c5d0c71a5 100644
--- a/compiler/GHC/Driver/Session.hs
+++ b/compiler/GHC/Driver/Session.hs
@@ -3375,6 +3375,7 @@ fFlagsDeps = [
flagSpec "catch-bottoms" Opt_CatchBottoms,
flagSpec "alignment-sanitisation" Opt_AlignmentSanitisation,
flagSpec "num-constant-folding" Opt_NumConstantFolding,
+ flagSpec "fast-pap-calls" Opt_FastPAPCalls,
flagSpec "show-warning-groups" Opt_ShowWarnGroups,
flagSpec "hide-source-paths" Opt_HideSourcePaths,
flagSpec "show-loaded-modules" Opt_ShowLoadedModules,
@@ -3878,6 +3879,7 @@ optLevelFlags -- see Note [Documenting optimisation flags]
, ([2], Opt_LiberateCase)
, ([2], Opt_SpecConstr)
+ , ([2], Opt_FastPAPCalls)
-- , ([2], Opt_RegsGraph)
-- RegsGraph suffers performance regression. See #7679
-- , ([2], Opt_StaticArgumentTransformation)
diff --git a/compiler/GHC/StgToCmm/Layout.hs b/compiler/GHC/StgToCmm/Layout.hs
index 0a74291ebd..6924e30483 100644
--- a/compiler/GHC/StgToCmm/Layout.hs
+++ b/compiler/GHC/StgToCmm/Layout.hs
@@ -212,7 +212,7 @@ slowCall fun stg_args
-- Note [avoid intermediate PAPs]
let n_args = length stg_args
- if n_args > arity && optLevel dflags >= 2
+ if n_args > arity && gopt Opt_FastPAPCalls dflags
then do
ptr_opts <- getPtrOpts
funv <- (CmmReg . CmmLocal) `fmap` assignTemp fun
diff --git a/docs/users_guide/expected-undocumented-flags.txt b/docs/users_guide/expected-undocumented-flags.txt
index b155c82505..7af6d42080 100644
--- a/docs/users_guide/expected-undocumented-flags.txt
+++ b/docs/users_guide/expected-undocumented-flags.txt
@@ -41,6 +41,7 @@
-fdiagnostics-color=never
-fembed-manifest
-fextended-default-rules
+-ffast-pap-calls
-fffi
-ffi
-ffloat-all-lams