summaryrefslogtreecommitdiff
path: root/compiler/coreSyn
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2017-12-08 15:39:05 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2017-12-08 15:42:55 +0000
commit5695f462f604fc63cbb45a7f3073bc114f9b475f (patch)
tree06794ef33eb835ee89022c8385fef3aadb63f2f0 /compiler/coreSyn
parent800009d9b78a9b2877e7efc889e8a0b21873990d (diff)
downloadhaskell-5695f462f604fc63cbb45a7f3073bc114f9b475f.tar.gz
Occurrrence analysis improvements for NOINLINE functions
This patch fixes #14567. The idea is simple: if a function is marked NOINLINE then it makes a great candidate for a loop breaker. Implementation is easy too, but it needs a little extra plubming, notably the occ_unf_act field in OccEnv
Diffstat (limited to 'compiler/coreSyn')
-rw-r--r--compiler/coreSyn/CoreOpt.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/coreSyn/CoreOpt.hs b/compiler/coreSyn/CoreOpt.hs
index 47a4e35a67..4240647d58 100644
--- a/compiler/coreSyn/CoreOpt.hs
+++ b/compiler/coreSyn/CoreOpt.hs
@@ -136,8 +136,10 @@ simpleOptPgm dflags this_mod binds rules vects
; return (reverse binds', rules', vects') }
where
- occ_anald_binds = occurAnalysePgm this_mod (\_ -> False) {- No rules active -}
- rules vects emptyVarSet binds
+ occ_anald_binds = occurAnalysePgm this_mod
+ (\_ -> True) {- All unfoldings active -}
+ (\_ -> False) {- No rules active -}
+ rules vects emptyVarSet binds
(final_env, binds') = foldl do_one (emptyEnv, []) occ_anald_binds
final_subst = soe_subst final_env