[llvm] 4e74f2d - Fix unused variable warning in release build, NFC.

Haojian Wu via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 17 09:06:47 PST 2022


Author: Haojian Wu
Date: 2022-12-17T18:04:28+01:00
New Revision: 4e74f2d8a6aff089328e4b06e30d45cb0000b31f

URL: https://github.com/llvm/llvm-project/commit/4e74f2d8a6aff089328e4b06e30d45cb0000b31f
DIFF: https://github.com/llvm/llvm-project/commit/4e74f2d8a6aff089328e4b06e30d45cb0000b31f.diff

LOG: Fix unused variable warning in release build, NFC.

Added: 
    

Modified: 
    llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp b/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
index f02891ccdfb9a..ff6c4e0304b8c 100644
--- a/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
@@ -361,7 +361,6 @@ bool SIMachineFunctionInfo::allocateSGPRSpillToVGPRLane(MachineFunction &MF,
     return true;
 
   const GCNSubtarget &ST = MF.getSubtarget<GCNSubtarget>();
-  const SIRegisterInfo *TRI = ST.getRegisterInfo();
   MachineFrameInfo &FrameInfo = MF.getFrameInfo();
   unsigned WaveSize = ST.getWavefrontSize();
 
@@ -372,7 +371,8 @@ bool SIMachineFunctionInfo::allocateSGPRSpillToVGPRLane(MachineFunction &MF,
     return false;
 
   assert(Size >= 4 && "invalid sgpr spill size");
-  assert(TRI->spillSGPRToVGPR() && "not spilling SGPRs to VGPRs");
+  assert(ST.getRegisterInfo()->spillSGPRToVGPR() &&
+         "not spilling SGPRs to VGPRs");
 
   unsigned &NumSpillLanes =
       IsPrologEpilog ? NumVGPRPrologEpilogSpillLanes : NumVGPRSpillLanes;


        


More information about the llvm-commits mailing list