summaryrefslogtreecommitdiff
path: root/compiler/GHC/Core/Lint.hs
diff options
context:
space:
mode:
authorAdam Gundry <adam@well-typed.com>2021-05-31 13:21:54 +0100
committerAdam Gundry <adam@well-typed.com>2021-06-01 14:57:36 +0100
commita7b206099937a2cf8cd6319052b3149fd7ecbaa7 (patch)
tree2aa0d82b2a033229ebe1bc3593497cf12277c64d /compiler/GHC/Core/Lint.hs
parentcc1ba576d26b90c0c01aa43e7100c94ee3a287ad (diff)
downloadhaskell-wip/amg/T19909.tar.gz
Turn coercion optimization into an optimization pass (#19909)wip/amg/T19909
This distinguishes between "simple" and "non-simple" coercion optimizations, with the former applied by the simple optimizer (e.g. immediately after desugaring and during simplification) while the latter are applied during a separate core-to-core pass. At the moment the only coercion optimizations not considered "simple" are the `opt_trans_rule` cases for pushing transitivity inside axioms. There are now explicit `-fopt-coercion-simple` and `-fopt-coercion-full` options to control these passes. The existing `-fno-opt-coercion` disables them both, and a new `-fopt-coercion` enables them both. By default `-fopt-coercion-simple` is enabled for all optimization levels, while `-fopt-coercion-full` is enabled only for `-O1` and higher. Open questions: * When should we run the non-simple optimization pass? At the moment it is run only once, at the beginning of the pipeline. * Should any other coercion optimizations be "non-simple"? * Should we perform non-simple optimization of coercions inside types? I've so far refrained from doing so, because I have a hunch that it will be a waste of time, but I haven't got data to back this up.
Diffstat (limited to 'compiler/GHC/Core/Lint.hs')
-rw-r--r--compiler/GHC/Core/Lint.hs1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/GHC/Core/Lint.hs b/compiler/GHC/Core/Lint.hs
index 3438f372fc..dfd80b03d4 100644
--- a/compiler/GHC/Core/Lint.hs
+++ b/compiler/GHC/Core/Lint.hs
@@ -362,6 +362,7 @@ coreDumpFlag CoreTidy = Just Opt_D_dump_simpl
coreDumpFlag CorePrep = Just Opt_D_dump_prep
coreDumpFlag CoreOccurAnal = Just Opt_D_dump_occur_anal
+coreDumpFlag CoreDoOptCoercion = Nothing
coreDumpFlag CoreAddCallerCcs = Nothing
coreDumpFlag CoreDoPrintCore = Nothing
coreDumpFlag (CoreDoRuleCheck {}) = Nothing