mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-07 14:33:15 +00:00
R600/SI: Fix phys reg copies in SIFoldOperands
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229227 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9b6d620f89
commit
e7ff4c1321
@ -210,7 +210,12 @@ bool SIFoldOperands::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
APInt Imm;
|
APInt Imm;
|
||||||
|
|
||||||
if (FoldingImm) {
|
if (FoldingImm) {
|
||||||
const TargetRegisterClass *UseRC = MRI.getRegClass(UseOp.getReg());
|
unsigned UseReg = UseOp.getReg();
|
||||||
|
const TargetRegisterClass *UseRC
|
||||||
|
= TargetRegisterInfo::isVirtualRegister(UseReg) ?
|
||||||
|
MRI.getRegClass(UseReg) :
|
||||||
|
TRI.getRegClass(UseReg);
|
||||||
|
|
||||||
Imm = APInt(64, OpToFold.getImm());
|
Imm = APInt(64, OpToFold.getImm());
|
||||||
|
|
||||||
// Split 64-bit constants into 32-bits for folding.
|
// Split 64-bit constants into 32-bits for folding.
|
||||||
@ -229,8 +234,13 @@ bool SIFoldOperands::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
// In order to fold immediates into copies, we need to change the
|
// In order to fold immediates into copies, we need to change the
|
||||||
// copy to a MOV.
|
// copy to a MOV.
|
||||||
if (UseMI->getOpcode() == AMDGPU::COPY) {
|
if (UseMI->getOpcode() == AMDGPU::COPY) {
|
||||||
unsigned MovOp = TII->getMovOpcode(
|
unsigned DestReg = UseMI->getOperand(0).getReg();
|
||||||
MRI.getRegClass(UseMI->getOperand(0).getReg()));
|
const TargetRegisterClass *DestRC
|
||||||
|
= TargetRegisterInfo::isVirtualRegister(DestReg) ?
|
||||||
|
MRI.getRegClass(DestReg) :
|
||||||
|
TRI.getRegClass(DestReg);
|
||||||
|
|
||||||
|
unsigned MovOp = TII->getMovOpcode(DestRC);
|
||||||
if (MovOp == AMDGPU::COPY)
|
if (MovOp == AMDGPU::COPY)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user