summaryrefslogtreecommitdiff
path: root/compiler/GHC/Driver/Session.hs
diff options
context:
space:
mode:
authorAndreas Klebinger <klebinger.andreas@gmx.at>2022-04-07 17:21:47 +0200
committerAndreas Klebinger <klebinger.andreas@gmx.at>2022-08-05 18:57:28 +0200
commita37161cf4c6ab46fe64b2d1ab2863d4f143601eb (patch)
tree2cc0ed02ddda15539f9389ed027d45c7bd4dacbf /compiler/GHC/Driver/Session.hs
parentf0aec520ed7026eb79ec2279fe1055f1806a9a21 (diff)
downloadhaskell-wip/andreask/late_cc.tar.gz
Change `-fprof-late` to insert cost centres after unfolding creation.wip/andreask/late_cc
The former behaviour of adding cost centres after optimization but before unfoldings are created is not available via the flag `prof-late-inline` instead. I also reduced the overhead of -fprof-late* by pushing the cost centres into lambdas. This means the cost centres will only account for execution of functions and not their partial application. Further I made LATE_CC cost centres it's own CC flavour so they now won't clash with user defined ones if a user uses the same string for a custom scc. LateCC: Don't put cost centres inside constructor workers. With -fprof-late they are rarely useful as the worker is usually inlined. Even if the worker is not inlined or we use -fprof-late-linline they are generally not helpful but bloat compile and run time significantly. So we just don't add sccs inside constructor workers. ------------------------- Metric Decrease: T13701 -------------------------
Diffstat (limited to 'compiler/GHC/Driver/Session.hs')
-rw-r--r--compiler/GHC/Driver/Session.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/GHC/Driver/Session.hs b/compiler/GHC/Driver/Session.hs
index ee032a2652..0407952c33 100644
--- a/compiler/GHC/Driver/Session.hs
+++ b/compiler/GHC/Driver/Session.hs
@@ -2486,6 +2486,8 @@ dynamic_flags_deps = [
(setDumpFlag Opt_D_dump_spec)
, make_ord_flag defGhcFlag "ddump-prep"
(setDumpFlag Opt_D_dump_prep)
+ , make_ord_flag defGhcFlag "ddump-late-cc"
+ (setDumpFlag Opt_D_dump_late_cc)
, make_ord_flag defGhcFlag "ddump-stg-from-core"
(setDumpFlag Opt_D_dump_stg_from_core)
, make_ord_flag defGhcFlag "ddump-stg-unarised"
@@ -3446,6 +3448,7 @@ fFlagsDeps = [
flagSpec "prof-count-entries" Opt_ProfCountEntries,
flagSpec "prof-late" Opt_ProfLateCcs,
flagSpec "prof-manual" Opt_ProfManualCcs,
+ flagSpec "prof-late-inline" Opt_ProfLateInlineCcs,
flagSpec "regs-graph" Opt_RegsGraph,
flagSpec "regs-iterative" Opt_RegsIterative,
depFlagSpec' "rewrite-rules" Opt_EnableRewriteRules