@@ -1475,9 +1475,11 @@ shouldInlineLet level a b = do
14751475 case Map.lookup level s2.usages of
14761476 Nothing ->
14771477 true
1478− Just (Usage { captured, total }) ->
1478+ Just (Usage { captured, total, call }) ->
14791479 (s1.complexity == Trivial)
1480− || (captured == CaptureNone && (total == 1 || (s1.complexity <= Deref && s1.size < 5)))
1480+ || (captured == CaptureNone && total == 1)
1481+ || (captured <= CaptureBranch && s1.complexity <= Deref && s1.size < 5)
1482+ || (s1.complexity == Deref && call == total)
14811483 || (s1.complexity == KnownSize && total == 1)
14821484 || (isAbs a && (total == 1 || Map.isEmpty s1.usages || s1.size < 16))
14831485 || (isKnownEffect a && total == 1)