-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[AMDGPU] NFCI: Track AV Register Pressure separately #149863
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
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,43 +29,58 @@ class raw_ostream; | |
| class SlotIndex; | ||
|
|
||
| struct GCNRegPressure { | ||
| enum RegKind { SGPR, VGPR, AGPR, TOTAL_KINDS }; | ||
| enum RegKind { SGPR, VGPR, AGPR, AVGPR, TOTAL_KINDS }; | ||
|
|
||
| GCNRegPressure() { | ||
| clear(); | ||
| } | ||
|
|
||
| bool empty() const { return !Value[SGPR] && !Value[VGPR] && !Value[AGPR]; } | ||
| bool empty() const { | ||
| return !Value[SGPR] && !Value[VGPR] && !Value[AGPR] && !Value[AVGPR]; | ||
| } | ||
|
|
||
| void clear() { std::fill(&Value[0], &Value[ValueArraySize], 0); } | ||
|
|
||
| /// \returns the SGPR32 pressure | ||
| unsigned getSGPRNum() const { return Value[SGPR]; } | ||
| /// \returns the aggregated ArchVGPR32, AccVGPR32 pressure dependent upon \p | ||
| /// UnifiedVGPRFile | ||
| /// \returns the aggregated ArchVGPR32, AccVGPR32, and Pseudo AVGPR pressure | ||
| /// dependent upon \p UnifiedVGPRFile | ||
| unsigned getVGPRNum(bool UnifiedVGPRFile) const { | ||
| if (UnifiedVGPRFile) { | ||
| return Value[AGPR] ? getUnifiedVGPRNum(Value[VGPR], Value[AGPR]) | ||
| : Value[VGPR]; | ||
| return Value[AGPR] | ||
| ? getUnifiedVGPRNum(Value[VGPR], Value[AGPR], Value[AVGPR]) | ||
| : Value[VGPR] + Value[AVGPR]; | ||
| } | ||
| return std::max(Value[VGPR], Value[AGPR]); | ||
| // Until we hit the VGPRThreshold, we will assign AV as VGPR. After that | ||
| // point, we will assign as AGPR. | ||
| return std::max(Value[VGPR] + Value[AVGPR], Value[AGPR]); | ||
| } | ||
|
|
||
| /// Returns the aggregated VGPR pressure, assuming \p NumArchVGPRs ArchVGPRs | ||
| /// and \p NumAGPRs AGPRS, for a target with a unified VGPR file. | ||
| /// \p NumAGPRs AGPRS, and \p NumAVGPRs AVGPRs for a target with a unified | ||
| /// VGPR file. | ||
| inline static unsigned getUnifiedVGPRNum(unsigned NumArchVGPRs, | ||
| unsigned NumAGPRs) { | ||
| return alignTo(NumArchVGPRs, AMDGPU::IsaInfo::getArchVGPRAllocGranule()) + | ||
| unsigned NumAGPRs, | ||
| unsigned NumAVGPRs) { | ||
|
|
||
| // Until we hit the VGPRThreshold, we will assign AV as VGPR. After that | ||
|
||
| // point, we will assign as AGPR. | ||
| return alignTo(NumArchVGPRs + NumAVGPRs, | ||
| AMDGPU::IsaInfo::getArchVGPRAllocGranule()) + | ||
| NumAGPRs; | ||
| } | ||
|
|
||
| /// \returns the ArchVGPR32 pressure | ||
| unsigned getArchVGPRNum() const { return Value[VGPR]; } | ||
| /// \returns the ArchVGPR32 pressure, plus the AVGPRS which we assume will be | ||
| /// allocated as VGPR | ||
| unsigned getArchVGPRNum() const { return Value[VGPR] + Value[AVGPR]; } | ||
| /// \returns the AccVGPR32 pressure | ||
| unsigned getAGPRNum() const { return Value[AGPR]; } | ||
| /// \returns the AVGPR32 pressure | ||
| unsigned getAVGPRNum() const { return Value[AVGPR]; } | ||
|
|
||
| unsigned getVGPRTuplesWeight() const { | ||
| return std::max(Value[TOTAL_KINDS + VGPR], Value[TOTAL_KINDS + AGPR]); | ||
| return std::max(Value[TOTAL_KINDS + VGPR] + Value[TOTAL_KINDS + AVGPR], | ||
| Value[TOTAL_KINDS + AGPR]); | ||
| } | ||
| unsigned getSGPRTuplesWeight() const { return Value[TOTAL_KINDS + SGPR]; } | ||
|
|
||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.