mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
handle the "mov reg1, reg2" case in isMoveInstr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28945 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
cccef1c6ff
commit
49e4415587
@ -183,10 +183,12 @@ void ARMDAGToDAGISel::InstructionSelectBasicBlock(SelectionDAG &DAG) {
|
||||
ScheduleAndEmitDAG(DAG);
|
||||
}
|
||||
|
||||
static void SelectFrameIndex(SelectionDAG *CurDAG, SDOperand &Result, SDNode *N) {
|
||||
static void SelectFrameIndex(SelectionDAG *CurDAG, SDOperand &Result, SDNode *N, SDOperand Op) {
|
||||
int FI = cast<FrameIndexSDNode>(N)->getIndex();
|
||||
Result = CurDAG->SelectNodeTo(N, ARM::movrr, MVT::i32,
|
||||
CurDAG->getTargetFrameIndex(FI, MVT::i32));
|
||||
|
||||
SDOperand TFI = CurDAG->getTargetFrameIndex(FI, Op.getValueType());
|
||||
|
||||
Result = CurDAG->SelectNodeTo(N, ARM::movri, Op.getValueType(), TFI);
|
||||
}
|
||||
|
||||
void ARMDAGToDAGISel::Select(SDOperand &Result, SDOperand Op) {
|
||||
@ -198,7 +200,7 @@ void ARMDAGToDAGISel::Select(SDOperand &Result, SDOperand Op) {
|
||||
break;
|
||||
|
||||
case ISD::FrameIndex:
|
||||
SelectFrameIndex(CurDAG, Result, N);
|
||||
SelectFrameIndex(CurDAG, Result, N, Op);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -27,7 +27,19 @@ ARMInstrInfo::ARMInstrInfo()
|
||||
///
|
||||
bool ARMInstrInfo::isMoveInstr(const MachineInstr &MI,
|
||||
unsigned &SrcReg, unsigned &DstReg) const {
|
||||
return false;
|
||||
MachineOpCode oc = MI.getOpcode();
|
||||
switch (oc) {
|
||||
default:
|
||||
return false;
|
||||
case ARM::movrr:
|
||||
assert(MI.getNumOperands() == 2 &&
|
||||
MI.getOperand(0).isRegister() &&
|
||||
MI.getOperand(1).isRegister() &&
|
||||
"Invalid ARM MOV instruction");
|
||||
SrcReg = MI.getOperand(1).getReg();;
|
||||
DstReg = MI.getOperand(0).getReg();;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/// isLoadFromStackSlot - If the specified machine instruction is a direct
|
||||
|
@ -81,7 +81,7 @@ ARMRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II) const {
|
||||
MachineBasicBlock &MBB = *MI.getParent();
|
||||
MachineFunction &MF = *MBB.getParent();
|
||||
|
||||
assert (MI.getOpcode() == ARM::movrr);
|
||||
assert (MI.getOpcode() == ARM::movri);
|
||||
|
||||
unsigned FrameIdx = 1;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user