[llvm] AMDGPU: Try to unspill VGPRs after rewriting MFMAs to AGPR form (PR #154323)
Quentin Colombet via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 16 08:10:42 PDT 2025
================
@@ -391,6 +414,133 @@ bool AMDGPURewriteAGPRCopyMFMAImpl::tryFoldCopiesFromAGPR(
return MadeChange;
}
+void AMDGPURewriteAGPRCopyMFMAImpl::replaceSpillWithCopyToVReg(
+ MachineInstr &SpillMI, int SpillFI, Register VReg) const {
+ const DebugLoc &DL = SpillMI.getDebugLoc();
+ MachineBasicBlock &MBB = *SpillMI.getParent();
+ MachineInstr *NewCopy;
+ if (SpillMI.mayStore()) {
+ NewCopy = BuildMI(MBB, SpillMI, DL, TII.get(TargetOpcode::COPY), VReg)
+ .add(SpillMI.getOperand(0));
----------------
qcolombet wrote:
Ohh, `isVGPRSpill` means spill related, not the spill (store) part alone.
Make sense
https://github.com/llvm/llvm-project/pull/154323
More information about the llvm-commits
mailing list