llvm-project
4520919d - [GlobalISel] Do not give a vreg a second def in replaceRegOrBuildCopy (#228906)

Commit
2 days ago
[GlobalISel] Do not give a vreg a second def in replaceRegOrBuildCopy (#228906) `replaceRegWith` also rewrote the def of the artifact about to be erased, which gave the forwarded vreg a second def. When the register constraints prevented the replacement, the COPY gave `DstReg` a second def in the same way. Since #231716, erasing the artifact then marks the valid debug uses of that vreg undef. Replace only the uses, and when a COPY is needed, rename the artifact's def to a new vreg so that the COPY is the only def of `DstReg`. Drop the def restore in `tryCombineUnmergeDefs`, which only undid the rewrite. Assisted-by: Claude Opus 5.5
Author
Parents
Loading