diff options
author | Reid Barton <rwbarton@gmail.com> | 2017-03-01 08:23:51 -0500 |
---|---|---|
committer | Reid Barton <rwbarton@gmail.com> | 2017-03-01 08:26:45 -0500 |
commit | 85c486a16bff96281c53baf8b385a39f259d39be (patch) | |
tree | 61a5382a878dfc9a909bdd2146effd41167d96b3 /compiler/simplCore/SimplUtils.hs | |
parent | 701256df88c61a2eee4cf00a59e61ef76a57b4b4 (diff) | |
download | haskell-wip/rwbarton-D1259.tar.gz |
D1259wip/rwbarton-D1259
Diffstat (limited to 'compiler/simplCore/SimplUtils.hs')
-rw-r--r-- | compiler/simplCore/SimplUtils.hs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/simplCore/SimplUtils.hs b/compiler/simplCore/SimplUtils.hs index 0fe262b2c7..6941f16e15 100644 --- a/compiler/simplCore/SimplUtils.hs +++ b/compiler/simplCore/SimplUtils.hs @@ -1030,6 +1030,12 @@ Note [Do not inline CoVars unconditionally] Coercion variables appear inside coercions, and the RHS of a let-binding is a term (not a coercion) so we can't necessarily inline the latter in the former. + +Note [Do not inline string literals] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +We float out string literals and then common them up. So we must ensure +that preInlineUnconditionally doesn't undo the work of FloatOut by inlining +them right back. -} preInlineUnconditionally :: DynFlags -> SimplEnv -> TopLevelFlag -> InId -> InExpr -> Bool @@ -1055,6 +1061,8 @@ preInlineUnconditionally dflags env top_lvl bndr rhs -- See Note [pre/postInlineUnconditionally in gentle mode] act = idInlineActivation bndr try_once in_lam int_cxt -- There's one textual occurrence + -- See Note [Do not inline string literals] + | exprIsLiteralString rhs = False | not in_lam = isNotTopLevel top_lvl || early_phase | otherwise = int_cxt && canInlineInLam rhs |