SIGN IN SIGN UP

inference: concrete-evaluate when const-prop refines effects to foldable (#61677)

`const_prop_call` may refine effects to be foldable when the original
call was not (e.g., when constant arguments make a branch dead,
eliminating side effects). Previously such cases would only receive the
const-prop' result. Now we re-check eligibility on the const-prop'd
effects/edge and prefer concrete evaluation when it becomes applicable,
yielding `Const` returns and `EFFECTS_TOTAL`.

Note that we do not want to simply check concrete-eval eligibility
upfront on const-prop'd effects to avoid the secondary check: concrete
eval was originally introduced as a fast path for const-prop' itself, so
reversing the order (running const-prop' before concrete-eval) would
defeat that purpose by paying the const-prop' cost even for calls that
the cheaper, upfront concrete-eval check would have caught. The
secondary check here is intentionally constrained to `eligibility ===
:none`, where the upfront concrete-eval was not applicable to begin
with.
S
Shuhei Kadowaki committed
df1239409215eb27472cfbcdbd19b43e692a2410
Parent: 85ee29d
Committed by GitHub <noreply@github.com> on 4/29/2026, 10:33:40 PM