summaryrefslogtreecommitdiff
path: root/compiler/stranal
diff options
context:
space:
mode:
authorJoachim Breitner <mail@joachim-breitner.de>2017-09-10 16:10:37 +0100
committerJoachim Breitner <mail@joachim-breitner.de>2017-09-12 11:01:10 -0400
commitfe04f3783b662c52c4a0ff36b2d62a7a575998a5 (patch)
tree3a49d515bc700562621bb0d97a74a89bd0d174fb /compiler/stranal
parentfe35b85a8cc72582e0f98a3059be00a9a2318a4a (diff)
downloadhaskell-fe04f3783b662c52c4a0ff36b2d62a7a575998a5.tar.gz
Allow CSE'ing of work-wrapped bindings (#14186)
the worker/wrapper creates an artificial INLINE pragma, which caused CSE to not do its work. We now recognize such artificial pragmas by using `NoUserInline` instead of `Inline` as the `InlineSpec`. Differential Revision: https://phabricator.haskell.org/D3939
Diffstat (limited to 'compiler/stranal')
-rw-r--r--compiler/stranal/WorkWrap.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/stranal/WorkWrap.hs b/compiler/stranal/WorkWrap.hs
index 9d741f5f4c..630ec11442 100644
--- a/compiler/stranal/WorkWrap.hs
+++ b/compiler/stranal/WorkWrap.hs
@@ -374,6 +374,10 @@ it appears in the first place in the defining module.
At one stage I tried making the wrapper inlining always-active, and
that had a very bad effect on nofib/imaginary/x2n1; a wrapper was
inlined before the specialisation fired.
+
+The use an inl_inline of NoUserInline to distinguish this pragma from one
+that was given by the user. In particular, CSE will not happen if there is a
+user-specified pragma, but should happen for w/w’ed things (#14186).
-}
tryWW :: DynFlags
@@ -521,7 +525,7 @@ splitFun dflags fam_envs fn_id fn_info wrap_dmds res_info rhs
wrap_act = ActiveAfter NoSourceText 0
wrap_rhs = wrap_fn work_id
wrap_prag = InlinePragma { inl_src = SourceText "{-# INLINE"
- , inl_inline = Inline
+ , inl_inline = NoUserInline
, inl_sat = Nothing
, inl_act = wrap_act
, inl_rule = rule_match_info }