mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-25 00:35:30 +00:00
Merge isLoadFromStackSlot into one since it behaves the same regardless of sub-target.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77174 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
68e3c6ae49
commit
dced03fc84
@ -491,6 +491,7 @@ ARMBaseInstrInfo::isMoveInstr(const MachineInstr &MI,
|
||||
SrcSubIdx = DstSubIdx = 0; // No sub-registers.
|
||||
|
||||
switch (MI.getOpcode()) {
|
||||
default: break;
|
||||
case ARM::FCPYS:
|
||||
case ARM::FCPYD:
|
||||
case ARM::VMOVD:
|
||||
@ -521,8 +522,10 @@ ARMBaseInstrInfo::isMoveInstr(const MachineInstr &MI,
|
||||
unsigned
|
||||
ARMBaseInstrInfo::isLoadFromStackSlot(const MachineInstr *MI,
|
||||
int &FrameIndex) const {
|
||||
unsigned oc = MI->getOpcode();
|
||||
if (oc == getOpcode(ARMII::LDRrr)) {
|
||||
switch (MI->getOpcode()) {
|
||||
default: break;
|
||||
case ARM::LDR:
|
||||
case ARM::t2LDRs: // FIXME: don't use t2LDRs to access frame.
|
||||
if (MI->getOperand(1).isFI() &&
|
||||
MI->getOperand(2).isReg() &&
|
||||
MI->getOperand(3).isImm() &&
|
||||
@ -531,22 +534,25 @@ ARMBaseInstrInfo::isLoadFromStackSlot(const MachineInstr *MI,
|
||||
FrameIndex = MI->getOperand(1).getIndex();
|
||||
return MI->getOperand(0).getReg();
|
||||
}
|
||||
}
|
||||
else if (oc == getOpcode(ARMII::LDRri)) {
|
||||
break;
|
||||
case ARM::t2LDRi12:
|
||||
case ARM::tRestore:
|
||||
if (MI->getOperand(1).isFI() &&
|
||||
MI->getOperand(2).isImm() &&
|
||||
MI->getOperand(2).getImm() == 0) {
|
||||
FrameIndex = MI->getOperand(1).getIndex();
|
||||
return MI->getOperand(0).getReg();
|
||||
}
|
||||
}
|
||||
else if (oc == ARM::FLDD || oc == ARM::FLDS) {
|
||||
break;
|
||||
case ARM::FLDD:
|
||||
case ARM::FLDS:
|
||||
if (MI->getOperand(1).isFI() &&
|
||||
MI->getOperand(2).isImm() &&
|
||||
MI->getOperand(2).getImm() == 0) {
|
||||
FrameIndex = MI->getOperand(1).getIndex();
|
||||
return MI->getOperand(0).getReg();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@ -555,8 +561,10 @@ ARMBaseInstrInfo::isLoadFromStackSlot(const MachineInstr *MI,
|
||||
unsigned
|
||||
ARMBaseInstrInfo::isStoreToStackSlot(const MachineInstr *MI,
|
||||
int &FrameIndex) const {
|
||||
unsigned oc = MI->getOpcode();
|
||||
if (oc == getOpcode(ARMII::STRrr)) {
|
||||
switch (MI->getOpcode()) {
|
||||
default: break;
|
||||
case ARM::STR:
|
||||
case ARM::t2STRs: // FIXME: don't use t2STRs to access frame.
|
||||
if (MI->getOperand(1).isFI() &&
|
||||
MI->getOperand(2).isReg() &&
|
||||
MI->getOperand(3).isImm() &&
|
||||
@ -565,22 +573,25 @@ ARMBaseInstrInfo::isStoreToStackSlot(const MachineInstr *MI,
|
||||
FrameIndex = MI->getOperand(1).getIndex();
|
||||
return MI->getOperand(0).getReg();
|
||||
}
|
||||
}
|
||||
else if (oc == getOpcode(ARMII::STRri)) {
|
||||
break;
|
||||
case ARM::t2STRi12:
|
||||
case ARM::tSpill:
|
||||
if (MI->getOperand(1).isFI() &&
|
||||
MI->getOperand(2).isImm() &&
|
||||
MI->getOperand(2).getImm() == 0) {
|
||||
FrameIndex = MI->getOperand(1).getIndex();
|
||||
return MI->getOperand(0).getReg();
|
||||
}
|
||||
}
|
||||
else if (oc == ARM::FSTD || oc == ARM::FSTS) {
|
||||
break;
|
||||
case ARM::FSTD:
|
||||
case ARM::FSTS:
|
||||
if (MI->getOperand(1).isFI() &&
|
||||
MI->getOperand(2).isImm() &&
|
||||
MI->getOperand(2).getImm() == 0) {
|
||||
FrameIndex = MI->getOperand(1).getIndex();
|
||||
return MI->getOperand(0).getReg();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -71,38 +71,6 @@ Thumb1InstrInfo::BlockHasNoFallThrough(const MachineBasicBlock &MBB) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
unsigned Thumb1InstrInfo::isLoadFromStackSlot(const MachineInstr *MI,
|
||||
int &FrameIndex) const {
|
||||
switch (MI->getOpcode()) {
|
||||
default: break;
|
||||
case ARM::tRestore:
|
||||
if (MI->getOperand(1).isFI() &&
|
||||
MI->getOperand(2).isImm() &&
|
||||
MI->getOperand(2).getImm() == 0) {
|
||||
FrameIndex = MI->getOperand(1).getIndex();
|
||||
return MI->getOperand(0).getReg();
|
||||
}
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned Thumb1InstrInfo::isStoreToStackSlot(const MachineInstr *MI,
|
||||
int &FrameIndex) const {
|
||||
switch (MI->getOpcode()) {
|
||||
default: break;
|
||||
case ARM::tSpill:
|
||||
if (MI->getOperand(1).isFI() &&
|
||||
MI->getOperand(2).isImm() &&
|
||||
MI->getOperand(2).getImm() == 0) {
|
||||
FrameIndex = MI->getOperand(1).getIndex();
|
||||
return MI->getOperand(0).getReg();
|
||||
}
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool Thumb1InstrInfo::copyRegToReg(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator I,
|
||||
unsigned DestReg, unsigned SrcReg,
|
||||
|
@ -50,11 +50,6 @@ public:
|
||||
MachineBasicBlock::iterator MI,
|
||||
const std::vector<CalleeSavedInfo> &CSI) const;
|
||||
|
||||
unsigned isLoadFromStackSlot(const MachineInstr *MI,
|
||||
int &FrameIndex) const;
|
||||
unsigned isStoreToStackSlot(const MachineInstr *MI,
|
||||
int &FrameIndex) const;
|
||||
|
||||
bool copyRegToReg(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator I,
|
||||
unsigned DestReg, unsigned SrcReg,
|
||||
|
Loading…
x
Reference in New Issue
Block a user