From fe04f3783b662c52c4a0ff36b2d62a7a575998a5 Mon Sep 17 00:00:00 2001 From: Joachim Breitner Date: Sun, 10 Sep 2017 16:10:37 +0100 Subject: 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 --- compiler/stranal/WorkWrap.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'compiler/stranal') 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 } -- cgit v1.2.1