[X86] Use new Flags argument to storeRegToStackSlot to simplify code. NFC (#124658)

Use the Flags argument to add FrameSetup directly instead of walking
backwards to add the flag after the call.
This commit is contained in:
Craig Topper 2025-01-29 09:45:29 -08:00 committed by GitHub
parent 7fff2527f8
commit 27e01d1d74
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 7 deletions

View File

@ -3062,10 +3062,7 @@ bool X86FrameLowering::spillCalleeSavedRegisters(
const TargetRegisterClass *RC = TRI->getMinimalPhysRegClass(Reg, VT);
TII.storeRegToStackSlot(MBB, MI, Reg, true, I.getFrameIdx(), RC, TRI,
Register());
--MI;
MI->setFlag(MachineInstr::FrameSetup);
++MI;
Register(), MachineInstr::FrameSetup);
}
return true;

View File

@ -4801,7 +4801,8 @@ void X86InstrInfo::storeRegToStackSlot(
loadStoreTileReg(MBB, MI, Opc, SrcReg, FrameIdx, isKill);
else
addFrameReference(BuildMI(MBB, MI, DebugLoc(), get(Opc)), FrameIdx)
.addReg(SrcReg, getKillRegState(isKill));
.addReg(SrcReg, getKillRegState(isKill))
.setMIFlag(Flags);
}
void X86InstrInfo::loadRegFromStackSlot(
@ -4821,8 +4822,8 @@ void X86InstrInfo::loadRegFromStackSlot(
if (isAMXOpcode(Opc))
loadStoreTileReg(MBB, MI, Opc, DestReg, FrameIdx);
else
addFrameReference(BuildMI(MBB, MI, DebugLoc(), get(Opc), DestReg),
FrameIdx);
addFrameReference(BuildMI(MBB, MI, DebugLoc(), get(Opc), DestReg), FrameIdx)
.setMIFlag(Flags);
}
bool X86InstrInfo::analyzeCompare(const MachineInstr &MI, Register &SrcReg,