diff options
author | Andrew Lenharth <andrewl@lenharth.org> | 2006-09-26 20:02:30 +0000 |
---|---|---|
committer | Andrew Lenharth <andrewl@lenharth.org> | 2006-09-26 20:02:30 +0000 |
commit | 16113431e84bb8adba21fc73bb5715a1297000ae (patch) | |
tree | b1d0c26816bc5c846c320f5c21396f5dfef10b11 | |
parent | bb1518585b2f2b2f501f70cc45c49a2d2ea57804 (diff) |
Comments on JumpTableness
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30615 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 1 | ||||
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index c310ac7fae..c47852b0f3 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -2403,6 +2403,7 @@ const char *SDNode::getOperationName(const SelectionDAG *G) const { case ISD::GlobalAddress: return "GlobalAddress"; case ISD::FrameIndex: return "FrameIndex"; case ISD::JumpTable: return "JumpTable"; + case ISD::JumpTableRelocBase: return "JumpTableRelocBase"; case ISD::ConstantPool: return "ConstantPool"; case ISD::ExternalSymbol: return "ExternalSymbol"; case ISD::INTRINSIC_WO_CHAIN: { diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 27a45a1d52..e9fd888ead 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -868,6 +868,9 @@ void SelectionDAGLowering::visitJumpTable(SelectionDAGISel::JumpTable &JT) { SDOperand LD = DAG.getLoad(isPIC ? MVT::i32 : PTy, Copy.getValue(1), ADD, DAG.getSrcValue(0)); if (isPIC) { + // For Pic, the sequence is: + // BRIND(load(Jumptable + index) + RelocBase) + // RelocBase is the JumpTable on PPC and X86, GOT on Alpha SDOperand Reloc = DAG.getNode(ISD::JumpTableRelocBase, PTy, TAB); ADD = DAG.getNode(ISD::ADD, PTy, ((PTy != MVT::i32) ? DAG.getNode(ISD::SIGN_EXTEND, PTy, LD) : LD), Reloc); |