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

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 15 03:47:53 PDT 2023


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

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


>From 3b5dcf4cd981dba58a52aa0ba13b1ec26a08e6bd Mon Sep 17 00:00:00 2001
From: Jay Foad <jay.foad at amd.com>
Date: Fri, 15 Sep 2023 11:46:38 +0100
Subject: [PATCH] [AMDGPU] Tweak tuple weight calculation. NFC.

This just makes it more obvious that GCNRegPressure does not actually
use pressure sets.
---
 llvm/lib/Target/AMDGPU/GCNRegPressure.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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