mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-15 22:28:18 +00:00
Remove redundant match for frame index from imm8 addrmode, it is handled by the imm12 addrmode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77632 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -630,18 +630,7 @@ bool ARMDAGToDAGISel::SelectT2AddrModeImm12(SDValue Op, SDValue N,
|
|||||||
bool ARMDAGToDAGISel::SelectT2AddrModeImm8(SDValue Op, SDValue N,
|
bool ARMDAGToDAGISel::SelectT2AddrModeImm8(SDValue Op, SDValue N,
|
||||||
SDValue &Base, SDValue &OffImm) {
|
SDValue &Base, SDValue &OffImm) {
|
||||||
// Match simple R - imm8 operands.
|
// Match simple R - imm8 operands.
|
||||||
|
if ((N.getOpcode() == ISD::ADD) || (N.getOpcode() == ISD::SUB)) {
|
||||||
// Match frame index...
|
|
||||||
if ((N.getOpcode() != ISD::ADD) && (N.getOpcode() != ISD::SUB)) {
|
|
||||||
if (N.getOpcode() == ISD::FrameIndex) {
|
|
||||||
int FI = cast<FrameIndexSDNode>(N)->getIndex();
|
|
||||||
Base = CurDAG->getTargetFrameIndex(FI, TLI.getPointerTy());
|
|
||||||
OffImm = CurDAG->getTargetConstant(0, MVT::i32);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ConstantSDNode *RHS = dyn_cast<ConstantSDNode>(N.getOperand(1))) {
|
if (ConstantSDNode *RHS = dyn_cast<ConstantSDNode>(N.getOperand(1))) {
|
||||||
int RHSC = (int)RHS->getSExtValue();
|
int RHSC = (int)RHS->getSExtValue();
|
||||||
if (N.getOpcode() == ISD::SUB)
|
if (N.getOpcode() == ISD::SUB)
|
||||||
@@ -657,6 +646,7 @@ bool ARMDAGToDAGISel::SelectT2AddrModeImm8(SDValue Op, SDValue N,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user