mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-24 08:18:33 +00:00
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
This commit is contained in:
@@ -373,10 +373,12 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
|
|||||||
Tmp2 = LegalizeOp(Node->getOperand(1)); // Legalize the size.
|
Tmp2 = LegalizeOp(Node->getOperand(1)); // Legalize the size.
|
||||||
Tmp3 = LegalizeOp(Node->getOperand(2)); // Legalize the alignment.
|
Tmp3 = LegalizeOp(Node->getOperand(2)); // Legalize the alignment.
|
||||||
if (Tmp1 != Node->getOperand(0) || Tmp2 != Node->getOperand(1) ||
|
if (Tmp1 != Node->getOperand(0) || Tmp2 != Node->getOperand(1) ||
|
||||||
Tmp3 != Node->getOperand(2))
|
Tmp3 != Node->getOperand(2)) {
|
||||||
Result = DAG.getNode(ISD::DYNAMIC_STACKALLOC, Node->getValueType(0),
|
std::vector<MVT::ValueType> VTs(Node->value_begin(), Node->value_end());
|
||||||
Tmp1, Tmp2, Tmp3);
|
std::vector<SDOperand> Ops;
|
||||||
else
|
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);
|
Result = Op.getValue(0);
|
||||||
|
|
||||||
// Since this op produces two values, make sure to remember that we
|
// Since this op produces two values, make sure to remember that we
|
||||||
|
|||||||
@@ -1350,19 +1350,7 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
|
|||||||
}
|
}
|
||||||
|
|
||||||
SDNode *N = new SDNode(Opcode, N1, N2, N3);
|
SDNode *N = new SDNode(Opcode, N1, N2, N3);
|
||||||
switch (Opcode) {
|
N->setValueTypes(VT);
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
// FIXME: memoize NODES
|
// FIXME: memoize NODES
|
||||||
AllNodes.push_back(N);
|
AllNodes.push_back(N);
|
||||||
return SDOperand(N, 0);
|
return SDOperand(N, 0);
|
||||||
|
|||||||
@@ -617,9 +617,14 @@ void SelectionDAGLowering::visitAlloca(AllocaInst &I) {
|
|||||||
getIntPtrConstant(~(uint64_t)(StackAlign-1)));
|
getIntPtrConstant(~(uint64_t)(StackAlign-1)));
|
||||||
}
|
}
|
||||||
|
|
||||||
SDOperand DSA = DAG.getNode(ISD::DYNAMIC_STACKALLOC, AllocSize.getValueType(),
|
std::vector<MVT::ValueType> VTs;
|
||||||
getRoot(), AllocSize,
|
VTs.push_back(AllocSize.getValueType());
|
||||||
getIntPtrConstant(Align));
|
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));
|
DAG.setRoot(setValue(&I, DSA).getValue(1));
|
||||||
|
|
||||||
// Inform the Frame Information that we have just allocated a variable-sized
|
// Inform the Frame Information that we have just allocated a variable-sized
|
||||||
|
|||||||
Reference in New Issue
Block a user