mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 19:52:54 +01:00
R600/SI: Replace TRI->getRegClass(Reg) with TRI->getPhysRegClass(Reg)
TRI->getRegClass() takes a register class ID, not a register. We were using this incorrectly in a few places. llvm-svn: 237132
This commit is contained in:
parent
bd877a1b65
commit
adcfdabda4
@ -140,7 +140,7 @@ const TargetRegisterClass *SIFixSGPRCopies::inferRegClassFromUses(
|
||||
const TargetRegisterClass *RC
|
||||
= TargetRegisterInfo::isVirtualRegister(Reg) ?
|
||||
MRI.getRegClass(Reg) :
|
||||
TRI->getRegClass(Reg);
|
||||
TRI->getPhysRegClass(Reg);
|
||||
|
||||
RC = TRI->getSubRegClass(RC, SubReg);
|
||||
for (MachineRegisterInfo::use_instr_iterator
|
||||
@ -183,10 +183,13 @@ bool SIFixSGPRCopies::isVGPRToSGPRCopy(const MachineInstr &Copy,
|
||||
unsigned SrcReg = Copy.getOperand(1).getReg();
|
||||
unsigned SrcSubReg = Copy.getOperand(1).getSubReg();
|
||||
|
||||
const TargetRegisterClass *DstRC
|
||||
= TargetRegisterInfo::isVirtualRegister(DstReg) ?
|
||||
MRI.getRegClass(DstReg) :
|
||||
TRI->getRegClass(DstReg);
|
||||
if (!TargetRegisterInfo::isVirtualRegister(DstReg)) {
|
||||
// If the destination register is a physical register there isn't really
|
||||
// much we can do to fix this.
|
||||
return false;
|
||||
}
|
||||
|
||||
const TargetRegisterClass *DstRC = MRI.getRegClass(DstReg);
|
||||
|
||||
const TargetRegisterClass *SrcRC;
|
||||
|
||||
|
@ -216,7 +216,7 @@ bool SIFoldOperands::runOnMachineFunction(MachineFunction &MF) {
|
||||
const TargetRegisterClass *UseRC
|
||||
= TargetRegisterInfo::isVirtualRegister(UseReg) ?
|
||||
MRI.getRegClass(UseReg) :
|
||||
TRI.getRegClass(UseReg);
|
||||
TRI.getPhysRegClass(UseReg);
|
||||
|
||||
Imm = APInt(64, OpToFold.getImm());
|
||||
|
||||
@ -240,7 +240,7 @@ bool SIFoldOperands::runOnMachineFunction(MachineFunction &MF) {
|
||||
const TargetRegisterClass *DestRC
|
||||
= TargetRegisterInfo::isVirtualRegister(DestReg) ?
|
||||
MRI.getRegClass(DestReg) :
|
||||
TRI.getRegClass(DestReg);
|
||||
TRI.getPhysRegClass(DestReg);
|
||||
|
||||
unsigned MovOp = TII->getMovOpcode(DestRC);
|
||||
if (MovOp == AMDGPU::COPY)
|
||||
|
@ -347,6 +347,7 @@ const TargetRegisterClass *SIRegisterInfo::getPhysRegClass(unsigned Reg) const {
|
||||
assert(!TargetRegisterInfo::isVirtualRegister(Reg));
|
||||
|
||||
static const TargetRegisterClass *BaseClasses[] = {
|
||||
&AMDGPU::M0RegRegClass,
|
||||
&AMDGPU::VGPR_32RegClass,
|
||||
&AMDGPU::SReg_32RegClass,
|
||||
&AMDGPU::VReg_64RegClass,
|
||||
|
Loading…
Reference in New Issue
Block a user