Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 12, 2024
Merged

Conversation

jrbyrnes
Copy link
Contributor

@jrbyrnes jrbyrnes commented Aug 9, 2024

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

Change-Id: Ie7d10498c0b1bb2d00a54fa17fd978752a9f1d52
@llvmbot
Copy link
Member

llvmbot commented Aug 9, 2024

@llvm/pr-subscribers-backend-amdgpu

Author: Jeffrey Byrnes (jrbyrnes)

Changes

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 --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],

Copy link

github-actions bot commented Aug 9, 2024

✅ With the latest revision this PR passed the C/C++ code formatter.

@shiltian
Copy link
Contributor

shiltian commented Aug 9, 2024

Where is the use of it?

@jrbyrnes
Copy link
Contributor Author

jrbyrnes commented Aug 9, 2024

Where is the use of it?

For intended use, see

https://github.com/llvm/llvm-project/pull/93090/files -- changes to llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp :: getRegisterPressures

I have not yet used getArchVGPRNum there, but I am working on putting together a body of work for that PR.

In this function, we copy over the GCNRegisterPressure into the Pressure vector. Pressure[AMDGPU::RegisterPressureSets::VGPR_32] should be the archVGPR pressure, but GCNRegisterPressure interface only has getVGPRNum which aggregates the archVGPR + AGPR pressure

@@ -54,6 +54,8 @@ struct GCNRegPressure {
}
return std::max(Value[VGPR32], Value[AGPR32]);
}
unsigned getArchVGPRNum() const { return Value[VGPR32];}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should get comments? Also could just fold this into the usage PR

Change-Id: I4d7cc3128724afa4bb6c19468d1b04f9a7b2e886
@jrbyrnes jrbyrnes merged commit 825dbbb into llvm:main Aug 12, 2024
5 of 7 checks passed
jrbyrnes added a commit to jrbyrnes/llvm-project that referenced this pull request Sep 12, 2024
For any users that is interested in just the ArchVGPR count (without
comparing to AGPR count)
jrbyrnes added a commit to jrbyrnes/llvm-project that referenced this pull request Sep 23, 2024
For any users that is interested in just the ArchVGPR count (without
comparing to AGPR count)
jrbyrnes added a commit to jrbyrnes/llvm-project that referenced this pull request Oct 4, 2024
For any users that is interested in just the ArchVGPR count (without
comparing to AGPR count)
searlmc1 pushed a commit to ROCm/llvm-project that referenced this pull request Dec 12, 2024
For any users that is interested in just the ArchVGPR count (without
comparing to AGPR count)

(cherry picked from commit 825dbbb)
Change-Id: I16c4ef3cdcd12ceb8d4f7ed8a72722e5cb3b49ba
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants