[llvm] [CodeGen] Reject undef tied use sharing a virtual register with another read (PR #222832)
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 18 23:08:45 PDT 2026
MaskRay wrote:
> > RegAllocFast had the same issue until #222249. Let's just reject the shape to retire the obligation. `%0 = XOR undef %0, undef %0` stays legal, since rewriting that tie changes nothing.
> > ProcessImplicitDefs and DetectDeadLanes stop producing the rejected form; X86 uses MOV32r0 as emitLongJmpShadowStackFix already did, and AVR reads an IMPLICIT_DEF. Physical registers are unaffected, so post-RA expansions keep the form.
>
> The comment is not clear. I see 3 methods used in the code: 1) Create a virtual register and IMPLICIT_DEF it; 2) Change XOR to MOV32r0; 3) Keep XOR undef, undef as is. The 2) and 3) is rather confusing. Needs a explanation for the future reference.
The X86 and AVR sites build `%0 = XOR undef %0, undef %0`, which this check (undef use tied to a def of **the same** register) does not reject, so those changes weren't needed. Leftovers from a stricter earlier draft. Dropped.
https://github.com/llvm/llvm-project/pull/222832
More information about the llvm-commits
mailing list