[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp SelectionDAG.cpp
Chris Lattner
lattner at cs.uiuc.edu
Wed Aug 16 15:58:01 PDT 2006
Changes in directory llvm/lib/CodeGen/SelectionDAG:
SelectionDAGISel.cpp updated: 1.269 -> 1.270
SelectionDAG.cpp updated: 1.332 -> 1.333
---
Log message:
minor changes.
---
Diffs of the changes: (+24 -22)
SelectionDAG.cpp | 37 +++++++++++++++++++------------------
SelectionDAGISel.cpp | 9 +++++----
2 files changed, 24 insertions(+), 22 deletions(-)
Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.269 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.270
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.269 Mon Aug 14 18:53:35 2006
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Wed Aug 16 17:57:46 2006
@@ -2515,7 +2515,7 @@
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 @@
}
// 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 @@
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
Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.332 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.333
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.332 Wed Aug 16 15:59:32 2006
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Wed Aug 16 17:57:46 2006
@@ -1459,26 +1459,21 @@
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 @@
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 @@
// 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);
More information about the llvm-commits
mailing list