mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 19:52:54 +01:00
Didn't mean to check these in.
llvm-svn: 43923
This commit is contained in:
parent
7e1d8b99ab
commit
781ed42681
@ -1599,17 +1599,21 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
|
||||
case 8: LD = DAG.getLoad(MVT::i64, Chain, Addr, NULL, 0); break;
|
||||
}
|
||||
|
||||
Addr = LD;
|
||||
if (TLI.getTargetMachine().getRelocationModel() == Reloc::PIC_) {
|
||||
// For PIC, the sequence is:
|
||||
// BRIND(load(Jumptable + index) + RelocBase)
|
||||
// RelocBase can be JumpTable, GOT or some sort of global base.
|
||||
if (PTy != MVT::i32)
|
||||
Addr = DAG.getNode(ISD::SIGN_EXTEND, PTy, Addr);
|
||||
Addr = DAG.getNode(ISD::ADD, PTy, Addr,
|
||||
TLI.getPICJumpTableRelocBase(Table, DAG));
|
||||
}
|
||||
// RelocBase is the JumpTable on PPC and X86, GOT on Alpha
|
||||
SDOperand Reloc;
|
||||
if (TLI.usesGlobalOffsetTable())
|
||||
Reloc = DAG.getNode(ISD::GLOBAL_OFFSET_TABLE, PTy);
|
||||
else
|
||||
Reloc = Table;
|
||||
Addr = (PTy != MVT::i32) ? DAG.getNode(ISD::SIGN_EXTEND, PTy, LD) : LD;
|
||||
Addr = DAG.getNode(ISD::ADD, PTy, Addr, Reloc);
|
||||
Result = DAG.getNode(ISD::BRIND, MVT::Other, LD.getValue(1), Addr);
|
||||
} else {
|
||||
Result = DAG.getNode(ISD::BRIND, MVT::Other, LD.getValue(1), LD);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -393,13 +393,6 @@ unsigned TargetLowering::getVectorTypeBreakdown(MVT::ValueType VT,
|
||||
return 1;
|
||||
}
|
||||
|
||||
SDOperand TargetLowering::getPICJumpTableRelocBase(SDOperand Table,
|
||||
SelectionDAG &DAG) const {
|
||||
if (usesGlobalOffsetTable())
|
||||
return DAG.getNode(ISD::GLOBAL_OFFSET_TABLE, getPointerTy());
|
||||
return Table;
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Optimization Methods
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
Loading…
Reference in New Issue
Block a user