mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-14 17:34:41 +00:00
CopyToReg source operand can be a physical register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35213 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3a7f7ab73f
commit
8334b9fa3b
@ -475,9 +475,25 @@ void ScheduleDAG::EmitNode(SDNode *Node,
|
|||||||
else
|
else
|
||||||
InReg = getVR(Node->getOperand(2), VRBaseMap);
|
InReg = getVR(Node->getOperand(2), VRBaseMap);
|
||||||
unsigned DestReg = cast<RegisterSDNode>(Node->getOperand(1))->getReg();
|
unsigned DestReg = cast<RegisterSDNode>(Node->getOperand(1))->getReg();
|
||||||
if (InReg != DestReg) // Coalesced away the copy?
|
if (InReg != DestReg) {// Coalesced away the copy?
|
||||||
MRI->copyRegToReg(*BB, BB->end(), DestReg, InReg,
|
const TargetRegisterClass *TRC = 0;
|
||||||
RegMap->getRegClass(InReg));
|
// Get the target register class
|
||||||
|
if (MRegisterInfo::isVirtualRegister(InReg)) {
|
||||||
|
TRC = RegMap->getRegClass(InReg);
|
||||||
|
} else {
|
||||||
|
// Pick the register class of the right type that contains this
|
||||||
|
// physreg.
|
||||||
|
for (MRegisterInfo::regclass_iterator I = MRI->regclass_begin(),
|
||||||
|
E = MRI->regclass_end(); I != E; ++I)
|
||||||
|
if ((*I)->hasType(Node->getOperand(2).getValueType()) &&
|
||||||
|
(*I)->contains(InReg)) {
|
||||||
|
TRC = *I;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
assert(TRC && "Couldn't find register class for reg copy!");
|
||||||
|
}
|
||||||
|
MRI->copyRegToReg(*BB, BB->end(), DestReg, InReg, TRC);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ISD::CopyFromReg: {
|
case ISD::CopyFromReg: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user