diff options
author | Chris Lattner <sabre@nondot.org> | 2006-08-16 22:57:46 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-08-16 22:57:46 +0000 |
commit | be384162c68641233deba8702666af51bdfd4b83 (patch) | |
tree | 89b395ac997b3e0e9229c4e41ff4d84333f5d161 /lib | |
parent | 67bb42aa5957bb24c0604cc08243cde9fe938e94 (diff) | |
download | external_llvm-be384162c68641233deba8702666af51bdfd4b83.zip external_llvm-be384162c68641233deba8702666af51bdfd4b83.tar.gz external_llvm-be384162c68641233deba8702666af51bdfd4b83.tar.bz2 |
minor changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29740 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 37 | ||||
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 9 |
2 files changed, 24 insertions, 22 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index c53cf53..15e3193 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -1459,26 +1459,21 @@ SDOperand SelectionDAG::getVecLoad(unsigned Count, MVT::ValueType EVT, SDOperand SV) { SDOperand Ops[] = { Chain, Ptr, SV, getConstant(Count, MVT::i32), getValueType(EVT) }; - // Add token chain. - const MVT::ValueType *VTs = getNodeValueTypes(MVT::Vector, MVT::Other); - return getNode(ISD::VLOAD, VTs, 2, Ops, 5); + return getNode(ISD::VLOAD, getVTList(MVT::Vector, MVT::Other), Ops, 5); } SDOperand SelectionDAG::getExtLoad(unsigned Opcode, MVT::ValueType VT, SDOperand Chain, SDOperand Ptr, SDOperand SV, MVT::ValueType EVT) { SDOperand Ops[] = { Chain, Ptr, SV, getValueType(EVT) }; - const MVT::ValueType *VTs = getNodeValueTypes(VT, MVT::Other); - return getNode(Opcode, VTs, 2, Ops, 4); + return getNode(Opcode, getVTList(VT, MVT::Other), Ops, 4); } SDOperand SelectionDAG::getVAArg(MVT::ValueType VT, SDOperand Chain, SDOperand Ptr, SDOperand SV) { SDOperand Ops[] = { Chain, Ptr, SV }; - // Add token chain. - const MVT::ValueType *VTs = getNodeValueTypes(VT, MVT::Other); - return getNode(ISD::VAARG, VTs, 2, Ops, 3); + return getNode(ISD::VAARG, getVTList(VT, MVT::Other), Ops, 3); } SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT, @@ -1562,27 +1557,34 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, const SDOperand *Ops, unsigned NumOps) { if (NumVTs == 1) return getNode(Opcode, VTs[0], Ops, NumOps); + return getNode(Opcode, makeVTList(VTs, NumVTs), Ops, NumOps); +} + +SDOperand SelectionDAG::getNode(unsigned Opcode, SDVTList VTList, + const SDOperand *Ops, unsigned NumOps) { + if (VTList.NumVTs == 1) + return getNode(Opcode, VTList.VTs[0], Ops, NumOps); switch (Opcode) { case ISD::EXTLOAD: case ISD::SEXTLOAD: case ISD::ZEXTLOAD: { MVT::ValueType EVT = cast<VTSDNode>(Ops[3])->getVT(); - assert(NumOps == 4 && NumVTs == 2 && "Bad *EXTLOAD!"); + assert(NumOps == 4 && VTList.NumVTs == 2 && "Bad *EXTLOAD!"); // If they are asking for an extending load from/to the same thing, return a // normal load. - if (VTs[0] == EVT) - return getLoad(VTs[0], Ops[0], Ops[1], Ops[2]); - if (MVT::isVector(VTs[0])) { - assert(EVT == MVT::getVectorBaseType(VTs[0]) && + if (VTList.VTs[0] == EVT) + return getLoad(VTList.VTs[0], Ops[0], Ops[1], Ops[2]); + if (MVT::isVector(VTList.VTs[0])) { + assert(EVT == MVT::getVectorBaseType(VTList.VTs[0]) && "Invalid vector extload!"); } else { - assert(EVT < VTs[0] && + assert(EVT < VTList.VTs[0] && "Should only be an extending load, not truncating!"); } - assert((Opcode == ISD::EXTLOAD || MVT::isInteger(VTs[0])) && + assert((Opcode == ISD::EXTLOAD || MVT::isInteger(VTList.VTs[0])) && "Cannot sign/zero extend a FP/Vector load!"); - assert(MVT::isInteger(VTs[0]) == MVT::isInteger(EVT) && + assert(MVT::isInteger(VTList.VTs[0]) == MVT::isInteger(EVT) && "Cannot convert from FP to Int or Int -> FP!"); break; } @@ -1611,8 +1613,7 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, // Memoize the node unless it returns a flag. SDNode *N; - SDVTList VTList = makeVTList(VTs, NumVTs); - if (VTs[NumVTs-1] != MVT::Flag) { + if (VTList.VTs[VTList.NumVTs-1] != MVT::Flag) { SelectionDAGCSEMap::NodeID ID; ID.SetOpcode(Opcode); ID.SetValueTypes(VTList); diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 9886582..0fd7ef7 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -2515,7 +2515,7 @@ TargetLowering::LowerCallTo(SDOperand Chain, const Type *RetTy, bool isVarArg, unsigned CallingConv, bool isTailCall, SDOperand Callee, ArgListTy &Args, SelectionDAG &DAG) { - std::vector<SDOperand> Ops; + SmallVector<SDOperand, 32> Ops; Ops.push_back(Chain); // Op#0 - Chain Ops.push_back(DAG.getConstant(CallingConv, getPointerTy())); // Op#1 - CC Ops.push_back(DAG.getConstant(isVarArg, getPointerTy())); // Op#2 - VarArg @@ -2592,7 +2592,7 @@ TargetLowering::LowerCallTo(SDOperand Chain, const Type *RetTy, bool isVarArg, } // Figure out the result value types. - std::vector<MVT::ValueType> RetTys; + SmallVector<MVT::ValueType, 4> RetTys; if (RetTy != Type::VoidTy) { MVT::ValueType VT = getValueType(RetTy); @@ -2636,8 +2636,9 @@ TargetLowering::LowerCallTo(SDOperand Chain, const Type *RetTy, bool isVarArg, RetTys.push_back(MVT::Other); // Always has a chain. // Finally, create the CALL node. - SDOperand Res = DAG.getNode(ISD::CALL, DAG.getNodeValueTypes(RetTys), - RetTys.size(), &Ops[0], Ops.size()); + SDOperand Res = DAG.getNode(ISD::CALL, + DAG.getVTList(&RetTys[0], RetTys.size()), + &Ops[0], Ops.size()); // This returns a pair of operands. The first element is the // return value for the function (if RetTy is not VoidTy). The second |