summaryrefslogtreecommitdiff
path: root/compiler/stranal
diff options
context:
space:
mode:
authorLemmih <lemmih@gmail.com>2007-06-07 21:35:23 +0000
committerLemmih <lemmih@gmail.com>2007-06-07 21:35:23 +0000
commit481b014b46dd53ef5d1c5e679e1d9f08207af96e (patch)
treec5e218f5a0ff2f1716eb40c46dd0aafdd3717d59 /compiler/stranal
parent7dd96d1d24af338b7d3954943cea6a49278bb431 (diff)
downloadhaskell-481b014b46dd53ef5d1c5e679e1d9f08207af96e.tar.gz
Do not perform a worker/wrapper split for a NOINLINE function
This came up in an email exchange with Duncan Coutts in May 2007. If a function is marked NOINLINE there is really no point in doing a worker/wrapper split, because the wrapper will never be inlined.
Diffstat (limited to 'compiler/stranal')
-rw-r--r--compiler/stranal/WorkWrap.lhs7
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/stranal/WorkWrap.lhs b/compiler/stranal/WorkWrap.lhs
index d061de5b8c..a1b18a98fb 100644
--- a/compiler/stranal/WorkWrap.lhs
+++ b/compiler/stranal/WorkWrap.lhs
@@ -26,7 +26,7 @@ import NewDemand ( Demand(..), StrictSig(..), DmdType(..), DmdResult(..),
)
import UniqSupply ( UniqSupply, initUs_, returnUs, thenUs, mapUs, getUniqueUs, UniqSM )
import Unique ( hasKey )
-import BasicTypes ( RecFlag(..), isNonRec )
+import BasicTypes ( RecFlag(..), isNonRec, isNeverActive )
import VarEnv ( isEmptyVarEnv )
import Maybes ( orElse )
import DynFlags
@@ -215,6 +215,11 @@ tryWW is_rec fn_id rhs
-- fw = \ab -> (__inline (\x -> E)) (a,b)
-- and the original __inline now vanishes, so E is no longer
-- inside its __inline wrapper. Death! Disaster!
+
+ || isNeverActive inline_prag
+ -- No point in worker/wrappering if the thing is never inlined!
+ -- Because the no-inline prag will prevent the wrapper ever
+ -- being inlined at a call site.
= returnUs [ (new_fn_id, rhs) ]
| is_thunk && worthSplittingThunk maybe_fn_dmd res_info