[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp SelectionDAGISel.cpp
Andrew Lenharth
alenhar2 at cs.uiuc.edu
Sun Sep 24 12:45:24 PDT 2006
Changes in directory llvm/lib/CodeGen/SelectionDAG:
LegalizeDAG.cpp updated: 1.399 -> 1.400
SelectionDAGISel.cpp updated: 1.278 -> 1.279
---
Log message:
Add support for other relocation bases to jump tables, as well as custom asm directives
---
Diffs of the changes: (+13 -1)
LegalizeDAG.cpp | 11 +++++++++++
SelectionDAGISel.cpp | 3 ++-
2 files changed, 13 insertions(+), 1 deletion(-)
Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.399 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.400
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.399 Tue Sep 19 22:38:48 2006
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Sun Sep 24 14:44:59 2006
@@ -558,6 +558,17 @@
#endif
assert(0 && "Do not know how to legalize this operator!");
abort();
+ case ISD::JumpTableRelocBase:
+ switch (TLI.getOperationAction(Node->getOpcode(), Node->getValueType(0))) {
+ case TargetLowering::Custom:
+ Tmp1 = TLI.LowerOperation(Op, DAG);
+ if (Tmp1.Val) Result = Tmp1;
+ break;
+ default:
+ Result = LegalizeOp(Node->getOperand(0));
+ break;
+ }
+ break;
case ISD::GlobalAddress:
case ISD::ExternalSymbol:
case ISD::ConstantPool:
Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.278 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.279
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.278 Sun Sep 24 00:22:38 2006
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Sun Sep 24 14:44:59 2006
@@ -868,8 +868,9 @@
SDOperand LD = DAG.getLoad(isPIC ? MVT::i32 : PTy, Copy.getValue(1), ADD,
DAG.getSrcValue(0));
if (isPIC) {
+ 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), TAB);
+ ((PTy != MVT::i32) ? DAG.getNode(ISD::SIGN_EXTEND, PTy, LD) : LD), Reloc);
DAG.setRoot(DAG.getNode(ISD::BRIND, MVT::Other, LD.getValue(1), ADD));
} else {
DAG.setRoot(DAG.getNode(ISD::BRIND, MVT::Other, LD.getValue(1), LD));
More information about the llvm-commits
mailing list