diff options
author | Evan Cheng <evan.cheng@apple.com> | 2007-11-09 01:28:33 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2007-11-09 01:28:33 +0000 |
commit | d5d2f0295f4abd084348d8a047836ef65433406a (patch) | |
tree | cf46fb4a71e8342219c71a269100853a8fe3a89c | |
parent | a81a770f0f290e9f1f6c71a886d5294a0adeef8d (diff) | |
download | external_llvm-d5d2f0295f4abd084348d8a047836ef65433406a.zip external_llvm-d5d2f0295f4abd084348d8a047836ef65433406a.tar.gz external_llvm-d5d2f0295f4abd084348d8a047836ef65433406a.tar.bz2 |
Didn't mean to check these in.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43923 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 18 | ||||
-rw-r--r-- | lib/CodeGen/SelectionDAG/TargetLowering.cpp | 7 |
2 files changed, 11 insertions, 14 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 0731299..6e58631 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -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); } - Result = DAG.getNode(ISD::BRIND, MVT::Other, LD.getValue(1), Addr); } } break; diff --git a/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/lib/CodeGen/SelectionDAG/TargetLowering.cpp index eadfa1f..3708b1c 100644 --- a/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -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 //===----------------------------------------------------------------------===// |