-
Notifications
You must be signed in to change notification settings - Fork 15.2k
AMDGPU: Stop using the wavemask register class for SCC cross class copies #161801
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: users/arsenm/amdgpu/no-agpr-case-getCrossCopyRegClass
Are you sure you want to change the base?
Conversation
…pies SCC should be copied to a 32-bit SGPR. Using a wave mask doesn't make sense.
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
@llvm/pr-subscribers-backend-amdgpu Author: Matt Arsenault (arsenm) ChangesSCC should be copied to a 32-bit SGPR. Using a wave mask doesn't make Full diff: https://github.com/llvm/llvm-project/pull/161801.diff 1 Files Affected:
diff --git a/llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp b/llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
index 21735f91f4ad7..ba29dd4ae61d4 100644
--- a/llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
@@ -1118,9 +1118,7 @@ SIRegisterInfo::getPointerRegClass(unsigned Kind) const {
const TargetRegisterClass *
SIRegisterInfo::getCrossCopyRegClass(const TargetRegisterClass *RC) const {
- if (RC == &AMDGPU::SCC_CLASSRegClass)
- return getWaveMaskRegClass();
- return RC;
+ return RC == &AMDGPU::SCC_CLASSRegClass ? &AMDGPU::SReg_32RegClass : RC;
}
static unsigned getNumSubRegsForSpillOp(const MachineInstr &MI,
|
if (RC == &AMDGPU::SCC_CLASSRegClass) | ||
return getWaveMaskRegClass(); | ||
return RC; | ||
return RC == &AMDGPU::SCC_CLASSRegClass ? &AMDGPU::SReg_32RegClass : RC; |
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.
Shouldn't SCC_CLASS depend on the wavesize?
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.
No. These have nothing to do with each other. To extract a value into an allocatable register, a 32-bit SGPR is the natural choice
Are there any codegen changes? |
I don't think so. There could maybe be dag scheduling changes but I haven't found them |
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.
That's a scalar condition, so really does not depend on wave size. LGTM.
SCC should be copied to a 32-bit SGPR. Using a wave mask doesn't make
sense.