Skip to content

Commit 825dbbb

Browse files
authored
[AMDGPU] NFC: Add helper to query archVGPR (#102690)
For any users that is interested in just the ArchVGPR count (without comparing to AGPR count)
1 parent 05901e9 commit 825dbbb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

llvm/lib/Target/AMDGPU/GCNRegPressure.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,20 @@ struct GCNRegPressure {
4646

4747
void clear() { std::fill(&Value[0], &Value[TOTAL_KINDS], 0); }
4848

49+
/// \returns the SGPR32 pressure
4950
unsigned getSGPRNum() const { return Value[SGPR32]; }
51+
/// \returns the aggregated ArchVGPR32, AccVGPR32 pressure dependent upon \p
52+
/// UnifiedVGPRFile
5053
unsigned getVGPRNum(bool UnifiedVGPRFile) const {
5154
if (UnifiedVGPRFile) {
5255
return Value[AGPR32] ? alignTo(Value[VGPR32], 4) + Value[AGPR32]
5356
: Value[VGPR32] + Value[AGPR32];
5457
}
5558
return std::max(Value[VGPR32], Value[AGPR32]);
5659
}
60+
/// \returns the ArchVGPR32 pressure
61+
unsigned getArchVGPRNum() const { return Value[VGPR32]; }
62+
/// \returns the AccVGPR32 pressure
5763
unsigned getAGPRNum() const { return Value[AGPR32]; }
5864

5965
unsigned getVGPRTuplesWeight() const { return std::max(Value[VGPR_TUPLE],

0 commit comments

Comments
 (0)