mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
fix a long standing wart: all the ComplexPattern's were being
passed the root of the match, even though only a few patterns actually needed this (one in X86, several in ARM [which should be refactored anyway], and some in CellSPU that I don't feel like detangling). Instead of requiring all ComplexPatterns to take the dead root, have targets opt into getting the root by putting SDNPWantRoot on the ComplexPattern. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114471 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -44,9 +44,8 @@ public:
|
||||
SDNode *Select(SDNode *N);
|
||||
|
||||
// Complex Pattern Selectors.
|
||||
bool SelectADDRrr(SDNode *Op, SDValue N, SDValue &R1, SDValue &R2);
|
||||
bool SelectADDRri(SDNode *Op, SDValue N, SDValue &Base,
|
||||
SDValue &Offset);
|
||||
bool SelectADDRrr(SDValue N, SDValue &R1, SDValue &R2);
|
||||
bool SelectADDRri(SDValue N, SDValue &Base, SDValue &Offset);
|
||||
|
||||
/// SelectInlineAsmMemoryOperand - Implement addressing mode selection for
|
||||
/// inline asm expressions.
|
||||
@@ -71,7 +70,7 @@ SDNode* SparcDAGToDAGISel::getGlobalBaseReg() {
|
||||
return CurDAG->getRegister(GlobalBaseReg, TLI.getPointerTy()).getNode();
|
||||
}
|
||||
|
||||
bool SparcDAGToDAGISel::SelectADDRri(SDNode *Op, SDValue Addr,
|
||||
bool SparcDAGToDAGISel::SelectADDRri(SDValue Addr,
|
||||
SDValue &Base, SDValue &Offset) {
|
||||
if (FrameIndexSDNode *FIN = dyn_cast<FrameIndexSDNode>(Addr)) {
|
||||
Base = CurDAG->getTargetFrameIndex(FIN->getIndex(), MVT::i32);
|
||||
@@ -112,8 +111,7 @@ bool SparcDAGToDAGISel::SelectADDRri(SDNode *Op, SDValue Addr,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SparcDAGToDAGISel::SelectADDRrr(SDNode *Op, SDValue Addr,
|
||||
SDValue &R1, SDValue &R2) {
|
||||
bool SparcDAGToDAGISel::SelectADDRrr(SDValue Addr, SDValue &R1, SDValue &R2) {
|
||||
if (Addr.getOpcode() == ISD::FrameIndex) return false;
|
||||
if (Addr.getOpcode() == ISD::TargetExternalSymbol ||
|
||||
Addr.getOpcode() == ISD::TargetGlobalAddress)
|
||||
@@ -196,8 +194,8 @@ SparcDAGToDAGISel::SelectInlineAsmMemoryOperand(const SDValue &Op,
|
||||
switch (ConstraintCode) {
|
||||
default: return true;
|
||||
case 'm': // memory
|
||||
if (!SelectADDRrr(Op.getNode(), Op, Op0, Op1))
|
||||
SelectADDRri(Op.getNode(), Op, Op0, Op1);
|
||||
if (!SelectADDRrr(Op, Op0, Op1))
|
||||
SelectADDRri(Op, Op0, Op1);
|
||||
break;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user