summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-05-14 07:29:57 +0000
committerChris Lattner <sabre@nondot.org>2005-05-14 07:29:57 +0000
commitadf6c2a0cb638e8b211200b57b927d16f6e1cfc4 (patch)
treeb381bba04185735b2a413cbae1ae40a55b08c75b /lib
parente89083a9300dc463e3b79eabe2b9913d85338d28 (diff)
downloadllvm-adf6c2a0cb638e8b211200b57b927d16f6e1cfc4.tar.gz
llvm-adf6c2a0cb638e8b211200b57b927d16f6e1cfc4.tar.bz2
llvm-adf6c2a0cb638e8b211200b57b927d16f6e1cfc4.tar.xz
Eliminate special purpose hacks for dynamic_stack_alloc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22015 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeDAG.cpp10
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAG.cpp14
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp11
3 files changed, 15 insertions, 20 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index d0de8c9b81..2f259b1eb4 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -373,10 +373,12 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
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
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 165b3c92f1..3643f77f93 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -1350,19 +1350,7 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
}
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);
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index c08232c7f0..52bcc9ab75 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -617,9 +617,14 @@ void SelectionDAGLowering::visitAlloca(AllocaInst &I) {
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