[llvm] X86: Remove stale EFLAGS live range when converting ADD to LEA (PR #222029)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 9 04:26:18 PDT 2026
================
@@ -2042,7 +2046,11 @@ MachineInstr *X86InstrInfo::convertToThreeAddress(MachineInstr &MI,
MBB.insert(MI.getIterator(), NewMI); // Insert the new inst
if (LIS) {
+ // The replacement does not define EFLAGS; drop the dead EFLAGS def MI had.
+ SlotIndex Idx = LIS->getInstructionIndex(MI);
LIS->ReplaceMachineInstrInMaps(MI, *NewMI);
+
+ LIS->removePhysRegDefAt(X86::EFLAGS, Idx.getRegSlot());
----------------
arsenm wrote:
Yes, if there's no def removePhysRegDefAt ignores it
https://github.com/llvm/llvm-project/pull/222029
More information about the llvm-commits
mailing list