diff --git a/llvm/lib/Target/AMDGPU/GCNRegPressure.h b/llvm/lib/Target/AMDGPU/GCNRegPressure.h index 98f9b3bc6aada..54dc1972d2761 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],