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

Commit
101 days ago
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.
Author
Parents
Loading