Skip to content

Commit 76e3dd0

Browse files
committed
AMDGPU: Implement isConstantPhysReg
I don't think any of these registers are used in contexts where this would do anything yet.
1 parent 2e82667 commit 76e3dd0

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1849,3 +1849,16 @@ MCPhysReg SIRegisterInfo::get32BitRegister(MCPhysReg Reg) const {
18491849

18501850
return AMDGPU::NoRegister;
18511851
}
1852+
1853+
bool SIRegisterInfo::isConstantPhysReg(MCRegister PhysReg) const {
1854+
switch (PhysReg) {
1855+
case AMDGPU::SGPR_NULL:
1856+
case AMDGPU::SRC_SHARED_BASE:
1857+
case AMDGPU::SRC_PRIVATE_BASE:
1858+
case AMDGPU::SRC_SHARED_LIMIT:
1859+
case AMDGPU::SRC_PRIVATE_LIMIT:
1860+
return true;
1861+
default:
1862+
return false;
1863+
}
1864+
}

llvm/lib/Target/AMDGPU/SIRegisterInfo.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,8 @@ class SIRegisterInfo final : public AMDGPUGenRegisterInfo {
210210
return isVGPR(MRI, Reg) || isAGPR(MRI, Reg);
211211
}
212212

213+
bool isConstantPhysReg(MCRegister PhysReg) const override;
214+
213215
bool isDivergentRegClass(const TargetRegisterClass *RC) const override {
214216
return !isSGPRClass(RC);
215217
}

0 commit comments

Comments
 (0)