diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2007-11-09 01:27:11 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2007-11-09 01:27:11 +0000 |
| commit | 1bf166312b1def41e00be550986a2c038ce228ff (patch) | |
| tree | 9b97d2fcdd94d0b8f4459238240fb96b377a0041 /llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | |
| parent | 0e7937654c7a17412ce751522d32a2234bd483b5 (diff) | |
| download | bcm5719-llvm-1bf166312b1def41e00be550986a2c038ce228ff.tar.gz bcm5719-llvm-1bf166312b1def41e00be550986a2c038ce228ff.zip | |
Bug fix. Passive nodes are not in SUnitMap.
llvm-svn: 43922
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 6e58631f0c1..0731299f359 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -1599,21 +1599,17 @@ 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 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); + // 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)); } + Result = DAG.getNode(ISD::BRIND, MVT::Other, LD.getValue(1), Addr); } } break; |

