[llvm] 825dbbb - [AMDGPU] NFC: Add helper to query archVGPR (#102690)

via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 12 14:01:15 PDT 2024


Author: Jeffrey Byrnes
Date: 2024-08-12T14:01:12-07:00
New Revision: 825dbbbb94c985da4fd18da3e6e3baac05b11e23

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

LOG: [AMDGPU] NFC: Add helper to query archVGPR (#102690)

For any users that is interested in just the ArchVGPR count (without
comparing to AGPR count)

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AMDGPU/GCNRegPressure.h b/llvm/lib/Target/AMDGPU/GCNRegPressure.h
index 98f9b3bc6aadad..54dc1972d27619 100644
--- a/llvm/lib/Target/AMDGPU/GCNRegPressure.h
+++ b/llvm/lib/Target/AMDGPU/GCNRegPressure.h
@@ -46,7 +46,10 @@ struct GCNRegPressure {
 
   void clear() { std::fill(&Value[0], &Value[TOTAL_KINDS], 0); }
 
+  /// \returns the SGPR32 pressure
   unsigned getSGPRNum() const { return Value[SGPR32]; }
+  /// \returns the aggregated ArchVGPR32, AccVGPR32 pressure dependent upon \p
+  /// UnifiedVGPRFile
   unsigned getVGPRNum(bool UnifiedVGPRFile) const {
     if (UnifiedVGPRFile) {
       return Value[AGPR32] ? alignTo(Value[VGPR32], 4) + Value[AGPR32]
@@ -54,6 +57,9 @@ struct GCNRegPressure {
     }
     return std::max(Value[VGPR32], Value[AGPR32]);
   }
+  /// \returns the ArchVGPR32 pressure
+  unsigned getArchVGPRNum() const { return Value[VGPR32]; }
+  /// \returns the AccVGPR32 pressure
   unsigned getAGPRNum() const { return Value[AGPR32]; }
 
   unsigned getVGPRTuplesWeight() const { return std::max(Value[VGPR_TUPLE],


        


More information about the llvm-commits mailing list