summaryrefslogtreecommitdiff
path: root/compiler/simplCore/SimplCore.hs
diff options
context:
space:
mode:
authorJoachim Breitner <mail@joachim-breitner.de>2016-03-31 10:18:15 +0200
committerJoachim Breitner <mail@joachim-breitner.de>2016-04-14 17:18:54 +0200
commit2f56242b2fb9249420fce132bbded49c289b23a3 (patch)
tree805887ba4b2e4d77369cd93e281c1e9f9ab0072b /compiler/simplCore/SimplCore.hs
parent3a34b5c32303734c794f27728025e8a9fb410fb3 (diff)
downloadhaskell-wip/T11731.tar.gz
Add a final demand analyzer run right before TidyCorewip/T11731
in order to have precise used-once information in the exported strictness signatures, as well as precise used-once information on thunks. This avoids the bad effects of #11731. The subsequent worker-wrapper pass is responsible for removing the demand environment part of the strictness signature. It does not run after the final demand analyzer pass, so remove this also in CoreTidy. The subsequent worker-wrapper pass is also responsible for removing used-once-information from the demands and strictness signatures, as these might not be preserved by the simplifier. This is _not_ done by CoreTidy, because we _do_ want this information, as produced by the last round of the demand analyzer, to be available to the code generator.
Diffstat (limited to 'compiler/simplCore/SimplCore.hs')
-rw-r--r--compiler/simplCore/SimplCore.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/simplCore/SimplCore.hs b/compiler/simplCore/SimplCore.hs
index 98bcf2ad91..1ff0cee4f3 100644
--- a/compiler/simplCore/SimplCore.hs
+++ b/compiler/simplCore/SimplCore.hs
@@ -319,6 +319,11 @@ getCoreToDo dflags
[simpl_phase 0 ["post-late-ww"] max_iter]
),
+ -- Final run of the demand_analyser, ensures that one-shot thunks are
+ -- really really one-shot thunks. Only needed if the demand analyser
+ -- has run at all. See Note [Final Demand Analyser run] in DmdAnal
+ runWhen (strictness || late_dmd_anal) CoreDoStrictness,
+
maybe_rule_check (Phase 0)
]