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

via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 15 03:48:57 PDT 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-amdgpu
            
<details>
<summary>Changes</summary>
This just makes it more obvious that GCNRegPressure does not actually
use pressure sets.

--
Full diff: https://github.com/llvm/llvm-project/pull/66490.diff

1 Files Affected:

- (modified) llvm/lib/Target/AMDGPU/GCNRegPressure.cpp (+3-1) 


<pre>
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-&gt;getRegClassWeight(MRI.getRegClass(Reg)).RegWeight;
     }
     break;
 
</pre>
</details>


https://github.com/llvm/llvm-project/pull/66490


More information about the llvm-commits mailing list