[llvm] fcbdcb1 - [AMDGPU] Tweak tuple weight calculation. NFC. (#66490)

via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 15 08:30:11 PDT 2023


Author: Jay Foad
Date: 2023-09-15T16:30:06+01:00
New Revision: fcbdcb13ce1596d777184d95bdb2d4771f8a5510

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

LOG: [AMDGPU] Tweak tuple weight calculation. NFC. (#66490)

This just makes it more obvious that GCNRegPressure does not actually
use pressure sets.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AMDGPU/GCNRegPressure.cpp b/llvm/lib/Target/AMDGPU/GCNRegPressure.cpp
index 68cf971703692e9..1ca0f3b6e06b823 100644
--- a/llvm/lib/Target/AMDGPU/GCNRegPressure.cpp
+++ b/llvm/lib/Target/AMDGPU/GCNRegPressure.cpp
@@ -78,7 +78,9 @@ void GCNRegPressure::inc(unsigned Reg,
 
     if (PrevMask.none()) {
       assert(NewMask.any());
-      Value[Kind] += Sign * MRI.getPressureSets(Reg).getWeight();
+      const TargetRegisterInfo *TRI = MRI.getTargetRegisterInfo();
+      Value[Kind] +=
+          Sign * TRI->getRegClassWeight(MRI.getRegClass(Reg)).RegWeight;
     }
     break;
 


        


More information about the llvm-commits mailing list