[llvm] [CodeGen][RegCoalescer] Shrink non-PHI live-through subranges (PR #216297)
Vishwas Adiga via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 21 03:48:42 PDT 2026
Vishwas-Adiga wrote:
> What problem does this solve? Can you test checking the resultant output instead of relying on debug printing?
This was found in tests for a downstream target, but hasn't been observed in the wild. When a partial identity copy is removed, a non-PHI sibling subrange can retain a stale endpoint at a later definition which does not read the old value. `isLiveThrough()` currently restricts cleanup to PHI values, although the same cleanup is required whenever the value entering and leaving the removed copy is identical.
I could not produce the complete failure on the upstream targets I tested (AArch64 and AMDGPU). Their coalescers reject or transform the critical partial-register join, so there is no resultant output difference to check. The current test directly verifies that non-PHI live-through subranges are selected for shrinking. That said, I am open to suggestions for a target-independent resultant-interval test.
https://github.com/llvm/llvm-project/pull/216297
More information about the llvm-commits
mailing list