summaryrefslogtreecommitdiff
path: root/compiler/GHC/Driver/Flags.hs
diff options
context:
space:
mode:
authorAndreas Klebinger <klebinger.andreas@gmx.at>2021-05-10 22:06:51 +0200
committerMatthew Pickering <matthewtpickering@gmail.com>2022-02-12 13:59:41 +0000
commit0e93023eef174262310737004d398bc7a606939a (patch)
tree091a34f78b7911d8b38f414ff8eab90796581c47 /compiler/GHC/Driver/Flags.hs
parent90a26f8b0dd99129d3fd7fe28127cb69abd46328 (diff)
downloadhaskell-0e93023eef174262310737004d398bc7a606939a.tar.gz
Tag inference work.
This does three major things: * Enforce the invariant that all strict fields must contain tagged pointers. * Try to predict the tag on bindings in order to omit tag checks. * Allows functions to pass arguments unlifted (call-by-value). The former is "simply" achieved by wrapping any constructor allocations with a case which will evaluate the respective strict bindings. The prediction is done by a new data flow analysis based on the STG representation of a program. This also helps us to avoid generating redudant cases for the above invariant. StrictWorkers are created by W/W directly and SpecConstr indirectly. See the Note [Strict Worker Ids] Other minor changes: * Add StgUtil module containing a few functions needed by, but not specific to the tag analysis. ------------------------- Metric Decrease: T12545 T18698b T18140 T18923 LargeRecord Metric Increase: LargeRecord ManyAlternatives ManyConstructors T10421 T12425 T12707 T13035 T13056 T13253 T13253-spj T13379 T15164 T18282 T18304 T18698a T1969 T20049 T3294 T4801 T5321FD T5321Fun T783 T9233 T9675 T9961 T19695 WWRec -------------------------
Diffstat (limited to 'compiler/GHC/Driver/Flags.hs')
-rw-r--r--compiler/GHC/Driver/Flags.hs9
1 files changed, 8 insertions, 1 deletions
diff --git a/compiler/GHC/Driver/Flags.hs b/compiler/GHC/Driver/Flags.hs
index e95b181743..759d8b48c0 100644
--- a/compiler/GHC/Driver/Flags.hs
+++ b/compiler/GHC/Driver/Flags.hs
@@ -92,7 +92,9 @@ data DumpFlag
| Opt_D_dump_prep
| Opt_D_dump_stg_from_core -- ^ Initial STG (CoreToStg output)
| Opt_D_dump_stg_unarised -- ^ STG after unarise
- | Opt_D_dump_stg_final -- ^ Final STG (after stg2stg)
+ | Opt_D_dump_stg_cg -- ^ STG (after stg2stg)
+ | Opt_D_dump_stg_tags -- ^ Result of tag inference analysis.
+ | Opt_D_dump_stg_final -- ^ Final STG (before cmm gen)
| Opt_D_dump_call_arity
| Opt_D_dump_exitify
| Opt_D_dump_stranal
@@ -224,6 +226,7 @@ data GeneralFlag
| Opt_WeightlessBlocklayout -- ^ Layout based on last instruction per block.
| Opt_CprAnal
| Opt_WorkerWrapper
+ | Opt_WorkerWrapperUnlift -- ^ Do W/W split for unlifting even if we won't unbox anything.
| Opt_SolveConstantDicts
| Opt_AlignmentSanitisation
| Opt_CatchNonexhaustiveCases
@@ -231,6 +234,9 @@ data GeneralFlag
| Opt_CoreConstantFolding
| Opt_FastPAPCalls -- #6084
+ -- Inference flags
+ | Opt_DoTagInferenceChecks
+
-- PreInlining is on by default. The option is there just to see how
-- bad things get if you turn it off!
| Opt_SimplPreInlining
@@ -443,6 +449,7 @@ optimisationFlags = EnumSet.fromList
, Opt_WeightlessBlocklayout
, Opt_CprAnal
, Opt_WorkerWrapper
+ , Opt_WorkerWrapperUnlift
, Opt_SolveConstantDicts
, Opt_CatchNonexhaustiveCases
, Opt_IgnoreAsserts