Simon Peyton Jones pushed to branch wip/T23109 at Glasgow Haskell Compiler / GHC
Commits:
-
b0ceb856
by Simon Peyton Jones at 2025-06-25T12:47:37+01:00
1 changed file:
Changes:
... | ... | @@ -1494,6 +1494,7 @@ preInlineUnconditionally env top_lvl bndr rhs rhs_env |
1494 | 1494 | -- so substituting rhs inside a lambda doesn't change the occ info.
|
1495 | 1495 | -- Sadly, not quite the same as exprIsHNF.
|
1496 | 1496 | canInlineInLam (Lit _) = True
|
1497 | + canInlineInLam (Cast e _) = canInlineInLam e
|
|
1497 | 1498 | canInlineInLam (Lam b e) = isRuntimeVar b || canInlineInLam e
|
1498 | 1499 | canInlineInLam (Tick t e) = not (tickishIsCode t) && canInlineInLam e
|
1499 | 1500 | canInlineInLam (Var v) = case idOccInfo v of
|
... | ... | @@ -1612,7 +1613,7 @@ postInlineUnconditionally env bind_cxt old_bndr bndr rhs |
1612 | 1613 | -- so inlining duplicates code but nothing more
|
1613 | 1614 | |
1614 | 1615 | | otherwise
|
1615 | - -> work_ok in_lam int_cxt && smallEnoughToInline uf_opts unfolding
|
|
1616 | + -> work_ok in_lam int_cxt && (n_br == 1 || smallEnoughToInline uf_opts unfolding)
|
|
1616 | 1617 | -- Multiple syntactic occurences; but lazy, and small enough to dup
|
1617 | 1618 | -- ToDo: consider discount on smallEnoughToInline if int_cxt is true
|
1618 | 1619 |