-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[AMDGPU] Prioritize allocation of low 256 VGPR classes #167978
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -644,7 +644,7 @@ def VGPR_32_Lo128 : SIRegisterClass<"AMDGPU", !listconcat(Reg32Types.types, Reg1 | |
| // Identical to VGPR_32 except it only contains the low 256 (Lo256) registers. | ||
| def VGPR_32_Lo256 : SIRegisterClass<"AMDGPU", !listconcat(Reg32Types.types, Reg16Types.types), 32, | ||
| (add (sequence "VGPR%u", 0, 255))> { | ||
| let AllocationPriority = 0; | ||
| let AllocationPriority = !add(3, !mul(BaseClassPriority, BaseClassScaleFactor)); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you try setting CostPerUse? I think that makes more sense than changing priority
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's for registers, right? In this case it shall be per regclass. I.e., even if I increase it for low 256, it will be the same for a smaller and larger size. Here it is really a property of operand, not a register itself.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. More or less that would make almost everything worse. Setting CostPerUse to non-zero for all low 256 VGPRs will persuade RA to allocate registers above 256 by default. At the end you will have programs using registers starting just from v256 and nothing at the range v0-v255. |
||
| let GeneratePressureSet = 0; | ||
| let Size = 32; | ||
| let Weight = 1; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't require manual overriding
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At some level this is even right. Using this or that register is not more expensive. That is when it comes to spilling it matters.