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 | f14006f4d692ae78ae448ca21e6282c9b75d42f5 (patch) | |
| tree | 2505a058ab4565ec83d4813870a19fcabf67df99 /llvm/lib/CodeGen | |
| parent | 1bf166312b1def41e00be550986a2c038ce228ff (diff) | |
| download | bcm5719-llvm-f14006f4d692ae78ae448ca21e6282c9b75d42f5.tar.gz bcm5719-llvm-f14006f4d692ae78ae448ca21e6282c9b75d42f5.zip | |
Didn't mean to check these in.
llvm-svn: 43923
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 18 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | 7 |
2 files changed, 11 insertions, 14 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 0731299f359..6e58631f0c1 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/llvm/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/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp index eadfa1fbb29..3708b1cb9a7 100644 --- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/llvm/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 //===----------------------------------------------------------------------===// |

