[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp SelectionDAG.cpp SelectionDAGISel.cpp
Chris Lattner
lattner at cs.uiuc.edu
Sat May 14 00:30:11 PDT 2005
Changes in directory llvm/lib/CodeGen/SelectionDAG:
LegalizeDAG.cpp updated: 1.127 -> 1.128
SelectionDAG.cpp updated: 1.114 -> 1.115
SelectionDAGISel.cpp updated: 1.58 -> 1.59
---
Log message:
Eliminate special purpose hacks for dynamic_stack_alloc.
---
Diffs of the changes: (+15 -20)
LegalizeDAG.cpp | 10 ++++++----
SelectionDAG.cpp | 14 +-------------
SelectionDAGISel.cpp | 11 ++++++++---
3 files changed, 15 insertions(+), 20 deletions(-)
Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.127 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.128
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.127 Sat May 14 02:25:05 2005
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Sat May 14 02:29:57 2005
@@ -373,10 +373,12 @@
Tmp2 = LegalizeOp(Node->getOperand(1)); // Legalize the size.
Tmp3 = LegalizeOp(Node->getOperand(2)); // Legalize the alignment.
if (Tmp1 != Node->getOperand(0) || Tmp2 != Node->getOperand(1) ||
- Tmp3 != Node->getOperand(2))
- Result = DAG.getNode(ISD::DYNAMIC_STACKALLOC, Node->getValueType(0),
- Tmp1, Tmp2, Tmp3);
- else
+ Tmp3 != Node->getOperand(2)) {
+ std::vector<MVT::ValueType> VTs(Node->value_begin(), Node->value_end());
+ std::vector<SDOperand> Ops;
+ Ops.push_back(Tmp1); Ops.push_back(Tmp2); Ops.push_back(Tmp3);
+ Result = DAG.getNode(ISD::DYNAMIC_STACKALLOC, VTs, Ops);
+ } else
Result = Op.getValue(0);
// Since this op produces two values, make sure to remember that we
Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.114 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.115
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.114 Sat May 14 02:25:05 2005
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Sat May 14 02:29:57 2005
@@ -1350,19 +1350,7 @@
}
SDNode *N = new SDNode(Opcode, N1, N2, N3);
- switch (Opcode) {
- case ISD::SRA_PARTS:
- case ISD::SRL_PARTS:
- case ISD::SHL_PARTS:
- assert(0 && "Should not get here!");
- default:
- N->setValueTypes(VT);
- break;
- case ISD::DYNAMIC_STACKALLOC: // DYNAMIC_STACKALLOC produces pointer and chain
- N->setValueTypes(VT, MVT::Other);
- break;
- }
-
+ N->setValueTypes(VT);
// FIXME: memoize NODES
AllNodes.push_back(N);
return SDOperand(N, 0);
Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.58 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.59
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.58 Sat May 14 00:50:48 2005
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Sat May 14 02:29:57 2005
@@ -617,9 +617,14 @@
getIntPtrConstant(~(uint64_t)(StackAlign-1)));
}
- SDOperand DSA = DAG.getNode(ISD::DYNAMIC_STACKALLOC, AllocSize.getValueType(),
- getRoot(), AllocSize,
- getIntPtrConstant(Align));
+ std::vector<MVT::ValueType> VTs;
+ VTs.push_back(AllocSize.getValueType());
+ VTs.push_back(MVT::Other);
+ std::vector<SDOperand> Ops;
+ Ops.push_back(getRoot());
+ Ops.push_back(AllocSize);
+ Ops.push_back(getIntPtrConstant(Align));
+ SDOperand DSA = DAG.getNode(ISD::DYNAMIC_STACKALLOC, VTs, Ops);
DAG.setRoot(setValue(&I, DSA).getValue(1));
// Inform the Frame Information that we have just allocated a variable-sized
More information about the llvm-commits
mailing list