First part of bug 680:
Remove TLI.LowerVA* and replace it with SDNodes that are lowered the same
way as everything else.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25606 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index ed96bd6..d864042 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -1348,6 +1348,20 @@
return SDOperand(N, 0);
}
+SDOperand SelectionDAG::getVAArg(MVT::ValueType VT,
+ SDOperand Chain, SDOperand Ptr,
+ SDOperand SV) {
+ std::vector<SDOperand> Ops;
+ Ops.reserve(3);
+ Ops.push_back(Chain);
+ Ops.push_back(Ptr);
+ Ops.push_back(SV);
+ std::vector<MVT::ValueType> VTs;
+ VTs.reserve(2);
+ VTs.push_back(VT); VTs.push_back(MVT::Other); // Add token chain.
+ return getNode(ISD::VAARG, VTs, Ops);
+}
+
SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
std::vector<SDOperand> &Ops) {
switch (Ops.size()) {
@@ -2087,14 +2101,17 @@
case ISD::CALLSEQ_END: return "callseq_end";
// Other operators
- case ISD::LOAD: return "load";
- case ISD::STORE: return "store";
- case ISD::VLOAD: return "vload";
- case ISD::EXTLOAD: return "extload";
- case ISD::SEXTLOAD: return "sextload";
- case ISD::ZEXTLOAD: return "zextload";
- case ISD::TRUNCSTORE: return "truncstore";
-
+ case ISD::LOAD: return "load";
+ case ISD::STORE: return "store";
+ case ISD::VLOAD: return "vload";
+ case ISD::EXTLOAD: return "extload";
+ case ISD::SEXTLOAD: return "sextload";
+ case ISD::ZEXTLOAD: return "zextload";
+ case ISD::TRUNCSTORE: return "truncstore";
+ case ISD::VAARG: return "vaarg";
+ case ISD::VACOPY: return "vacopy";
+ case ISD::VAEND: return "vaend";
+ case ISD::VASTART: return "vastart";
case ISD::DYNAMIC_STACKALLOC: return "dynamic_stackalloc";
case ISD::EXTRACT_ELEMENT: return "extract_element";
case ISD::BUILD_PAIR: return "build_pair";