summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2021-04-25 16:39:23 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-04-27 21:57:56 -0400
commit484a8b2dcc84d012621bdc24da8cb68ae07b159b (patch)
treeda206e5becfc91558c7e56611a7a849d485b4e4b
parentdd121fa178c29a154233e95a15c755d0ca7cbdcc (diff)
downloadhaskell-484a8b2dcc84d012621bdc24da8cb68ae07b159b.tar.gz
Introduce -ddump-verbose-inlinings
Previously -ddump-inlinings and -dverbose-core2core used in conjunction would have the side-effect of dumping additional information about all inlinings considered by the simplifier. However, I have sometimes wanted this inlining information without the firehose of information produced by -dverbose-core2core. Introduce a new dump flag for this purpose.
-rw-r--r--compiler/GHC/Core/Unfold.hs2
-rw-r--r--compiler/GHC/Driver/Flags.hs1
-rw-r--r--compiler/GHC/Driver/Session.hs3
-rw-r--r--docs/users_guide/debugging.rst15
4 files changed, 15 insertions, 6 deletions
diff --git a/compiler/GHC/Core/Unfold.hs b/compiler/GHC/Core/Unfold.hs
index 49a10c5a39..8de84d7a80 100644
--- a/compiler/GHC/Core/Unfold.hs
+++ b/compiler/GHC/Core/Unfold.hs
@@ -1130,7 +1130,7 @@ traceInline logger dflags inline_id str doc result
| otherwise = result
where
enable
- | dopt Opt_D_dump_inlinings dflags && dopt Opt_D_verbose_core2core dflags
+ | dopt Opt_D_dump_verbose_inlinings dflags
= True
| Just prefix <- inlineCheck dflags
= prefix `isPrefixOf` occNameString (getOccName inline_id)
diff --git a/compiler/GHC/Driver/Flags.hs b/compiler/GHC/Driver/Flags.hs
index 393927e1b2..cdd5263588 100644
--- a/compiler/GHC/Driver/Flags.hs
+++ b/compiler/GHC/Driver/Flags.hs
@@ -55,6 +55,7 @@ data DumpFlag
| Opt_D_dump_ds_preopt
| Opt_D_dump_foreign
| Opt_D_dump_inlinings
+ | Opt_D_dump_verbose_inlinings
| Opt_D_dump_rule_firings
| Opt_D_dump_rule_rewrites
| Opt_D_dump_simpl_trace
diff --git a/compiler/GHC/Driver/Session.hs b/compiler/GHC/Driver/Session.hs
index 26ae0c6e0d..c2d1bed546 100644
--- a/compiler/GHC/Driver/Session.hs
+++ b/compiler/GHC/Driver/Session.hs
@@ -1418,6 +1418,7 @@ dopt f dflags = (f `EnumSet.member` dumpFlags dflags)
enableIfVerbose Opt_D_dump_simpl_trace = False
enableIfVerbose Opt_D_dump_rtti = False
enableIfVerbose Opt_D_dump_inlinings = False
+ enableIfVerbose Opt_D_dump_verbose_inlinings = False
enableIfVerbose Opt_D_dump_core_stats = False
enableIfVerbose Opt_D_dump_asm_stats = False
enableIfVerbose Opt_D_dump_types = False
@@ -2388,6 +2389,8 @@ dynamic_flags_deps = [
(setDumpFlag Opt_D_dump_foreign)
, make_ord_flag defGhcFlag "ddump-inlinings"
(setDumpFlag Opt_D_dump_inlinings)
+ , make_ord_flag defGhcFlag "ddump-verbose-inlinings"
+ (setDumpFlag Opt_D_dump_verbose_inlinings)
, make_ord_flag defGhcFlag "ddump-rule-firings"
(setDumpFlag Opt_D_dump_rule_firings)
, make_ord_flag defGhcFlag "ddump-rule-rewrites"
diff --git a/docs/users_guide/debugging.rst b/docs/users_guide/debugging.rst
index d8a024dde4..9e6664c152 100644
--- a/docs/users_guide/debugging.rst
+++ b/docs/users_guide/debugging.rst
@@ -332,13 +332,18 @@ subexpression elimination pass.
Dump simplifier output (Core-to-Core passes)
.. ghc-flag:: -ddump-inlinings
- :shortdesc: Dump inlining info
+ :shortdesc: Dump inlinings performed by the simplifier.
:type: dynamic
- Dumps inlining info from the simplifier. Note that if used in
- conjunction with :ghc-flag:`-dverbose-core2core` the compiler will
- also dump the inlinings that it considers but passes up, along with
- its rationale.
+ Dumps inlinings performed by the simplifier.
+
+.. ghc-flag:: -ddump-verbose-inlinings
+ :shortdesc: Dump all considered inlinings
+ :type: dynamic
+
+ Dumps all inlinings considered by the simplifier, even those ultimately not
+ performed. This output includes various information that the simplifier uses
+ to determine whether the inlining is beneficial.
.. ghc-flag:: -ddump-stranal
:shortdesc: Dump demand analysis output