julia
3ea3bac2 - inference: avoid allocating alias groups when no aliasing is possible (#61943)

Commit
5 days ago
inference: avoid allocating alias groups when no aliasing is possible (#61943) `compute_alias_groups` unconditionally allocated a `Vector{Int}` on every call, even though it is reached from `unionsplitcost` on the inference hot path (method matching, `typesubtract`, apply, and tfuncs). In the common case no arguments alias, so the allocated vector was just the identity grouping and carried no information. Add a cheap, non-allocating `any_alias_candidate` pre-check and return `nothing` when no aliasing is possible. Both callers already treat a `nothing` grouping identically to the identity grouping, so behavior is unchanged while the allocation disappears on the no-alias paths. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Author
Parents
Loading