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

via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 9 15:33:17 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-amdgpu

Author: Jeffrey Byrnes (jrbyrnes)

<details>
<summary>Changes</summary>

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

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


1 Files Affected:

- (modified) llvm/lib/Target/AMDGPU/GCNRegPressure.h (+2) 


``````````diff
diff --git a/llvm/lib/Target/AMDGPU/GCNRegPressure.h b/llvm/lib/Target/AMDGPU/GCNRegPressure.h
index 98f9b3bc6aada..08102a3524a7a 100644
--- a/llvm/lib/Target/AMDGPU/GCNRegPressure.h
+++ b/llvm/lib/Target/AMDGPU/GCNRegPressure.h
@@ -54,6 +54,8 @@ struct GCNRegPressure {
     }
     return std::max(Value[VGPR32], Value[AGPR32]);
   }
+  unsigned getArchVGPRNum() const { return Value[VGPR32];}
+
   unsigned getAGPRNum() const { return Value[AGPR32]; }
 
   unsigned getVGPRTuplesWeight() const { return std::max(Value[VGPR_TUPLE],

``````````

</details>


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


More information about the llvm-commits mailing list