[PATCH] D98344: [AMDGPU] Free reserved VGPR if no SGPR spill
Ruiling, Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 11 16:11:51 PST 2021
This revision was automatically updated to reflect the committed changes.
Closed by commit rG4cee5cad28fd: [AMDGPU] Free reserved VGPR if no SGPR spill (authored by ruiling).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D98344/new/
https://reviews.llvm.org/D98344
Files:
llvm/lib/Target/AMDGPU/SILowerSGPRSpills.cpp
Index: llvm/lib/Target/AMDGPU/SILowerSGPRSpills.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/SILowerSGPRSpills.cpp
+++ llvm/lib/Target/AMDGPU/SILowerSGPRSpills.cpp
@@ -304,14 +304,20 @@
bool HasCSRs = spillCalleeSavedRegs(MF);
MachineFrameInfo &MFI = MF.getFrameInfo();
+ MachineRegisterInfo &MRI = MF.getRegInfo();
+ SIMachineFunctionInfo *FuncInfo = MF.getInfo<SIMachineFunctionInfo>();
+
if (!MFI.hasStackObjects() && !HasCSRs) {
SaveBlocks.clear();
RestoreBlocks.clear();
+ if (FuncInfo->VGPRReservedForSGPRSpill) {
+ // Free the reserved VGPR for later possible use by frame lowering.
+ FuncInfo->removeVGPRForSGPRSpill(FuncInfo->VGPRReservedForSGPRSpill, MF);
+ MRI.freezeReservedRegs(MF);
+ }
return false;
}
- MachineRegisterInfo &MRI = MF.getRegInfo();
- SIMachineFunctionInfo *FuncInfo = MF.getInfo<SIMachineFunctionInfo>();
const bool SpillVGPRToAGPR = ST.hasMAIInsts() && FuncInfo->hasSpilledVGPRs()
&& EnableSpillVGPRToAGPR;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98344.330094.patch
Type: text/x-patch
Size: 1058 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210312/7ef684ed/attachment.bin>
More information about the llvm-commits
mailing list