diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2019-09-02 12:33:30 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2019-09-02 12:33:30 +0100 |
commit | d8e2d7e7b072c560d855017e1aaeecc6b3eef9ee (patch) | |
tree | d6d9b7e05f47f809254160508d68d9702fdc09f9 /compiler/simplCore/SimplUtils.hs | |
parent | ce240b3f998b68853c47ab131126eb9a245256c5 (diff) | |
download | haskell-wip/spj-cam-HEAD.tar.gz |
Last state on cam-05 HEADwip/spj-cam-HEADwip/T14137
Diffstat (limited to 'compiler/simplCore/SimplUtils.hs')
-rw-r--r-- | compiler/simplCore/SimplUtils.hs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/simplCore/SimplUtils.hs b/compiler/simplCore/SimplUtils.hs index ca1b9bd23d..82d20e20c5 100644 --- a/compiler/simplCore/SimplUtils.hs +++ b/compiler/simplCore/SimplUtils.hs @@ -1271,6 +1271,7 @@ postInlineUnconditionally env top_lvl bndr occ_info rhs | exprIsTrivial rhs = True | otherwise = case occ_info of +{- -- The point of examining occ_info here is that for *non-values* -- that occur outside a lambda, the call-site inliner won't have -- a chance (because it doesn't know that the thing @@ -1285,7 +1286,8 @@ postInlineUnconditionally env top_lvl bndr occ_info rhs -- in allocation if you miss this out OneOcc { occ_in_lam = in_lam, occ_int_cxt = int_cxt } -- OneOcc => no code-duplication issue - -> smallEnoughToInline dflags unfolding -- Small enough to dup + -> not (isJoinId bndr) -- NEW! + && smallEnoughToInline dflags unfolding -- Small enough to dup -- ToDo: consider discount on smallEnoughToInline if int_cxt is true -- -- NB: Do NOT inline arbitrarily big things, even if one_br is True @@ -1310,6 +1312,7 @@ postInlineUnconditionally env top_lvl bndr occ_info rhs -- int_cxt to prevent us inlining inside a lambda without some -- good reason. See the notes on int_cxt in preInlineUnconditionally +-} IAmDead -> True -- This happens; for example, the case_bndr during case of -- known constructor: case (a,b) of x { (p,q) -> ... } -- Here x isn't mentioned in the RHS, so we don't want to @@ -1331,7 +1334,7 @@ postInlineUnconditionally env top_lvl bndr occ_info rhs where unfolding = idUnfolding bndr - dflags = seDynFlags env + _dflags = seDynFlags env active = isActive (sm_phase (getMode env)) (idInlineActivation bndr) -- See Note [pre/postInlineUnconditionally in gentle mode] |