julia
98cff0f2 - compiler: Restore lifting cache in SROA `perform_lifting!` (#61020)

Commit
227 days ago
compiler: Restore lifting cache in SROA `perform_lifting!` (#61020) When multiple `getfield` calls access the same field of the same phi node, the SROA pass creates duplicate lifted phi nodes. A lifting cache was originally intended to prevent this (#43927), but had been broken and later removed in PR #51014. This restores a working lifting cache. The cache key includes both the field index and `stmt_val` (the original `getfield` argument) to distinguish liftings through the same phi node with different type constraints (e.g. direct access vs access through a PiNode that narrows the type). Without `stmt_val` in the key, a narrower type-constrained lifting could be incorrectly reused for a wider constraint, producing phi nodes with missing edges. Separate caches are used for `getfield` and `isdefined` liftings since they produce phi nodes with different value types. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Author
Parents
Loading