mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-14 13:57:51 +00:00
Allow custom lowering of DYNAMIC_STACKALLOC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25224 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
140e99babc
commit
a7dce3c6c2
@ -829,7 +829,7 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
|
||||
// legalization process more efficient and also makes libcall insertion
|
||||
// easier.
|
||||
break;
|
||||
case ISD::DYNAMIC_STACKALLOC:
|
||||
case ISD::DYNAMIC_STACKALLOC: {
|
||||
Tmp1 = LegalizeOp(Node->getOperand(0)); // Legalize the chain.
|
||||
Tmp2 = LegalizeOp(Node->getOperand(1)); // Legalize the size.
|
||||
Tmp3 = LegalizeOp(Node->getOperand(2)); // Legalize the alignment.
|
||||
@ -842,12 +842,25 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
|
||||
} else
|
||||
Result = Op.getValue(0);
|
||||
|
||||
// Since this op produces two values, make sure to remember that we
|
||||
// legalized both of them.
|
||||
AddLegalizedOperand(SDOperand(Node, 0), Result);
|
||||
AddLegalizedOperand(SDOperand(Node, 1), Result.getValue(1));
|
||||
return Result.getValue(Op.ResNo);
|
||||
|
||||
switch (TLI.getOperationAction(Node->getOpcode(),
|
||||
Node->getValueType(0))) {
|
||||
default: assert(0 && "This action is not supported yet!");
|
||||
case TargetLowering::Custom: {
|
||||
SDOperand Tmp = TLI.LowerOperation(Result, DAG);
|
||||
if (Tmp.Val) {
|
||||
Result = LegalizeOp(Tmp);
|
||||
}
|
||||
// FALLTHROUGH if the target thinks it is legal.
|
||||
}
|
||||
case TargetLowering::Legal:
|
||||
// Since this op produce two values, make sure to remember that we
|
||||
// legalized both of them.
|
||||
AddLegalizedOperand(SDOperand(Node, 0), Result);
|
||||
AddLegalizedOperand(SDOperand(Node, 1), Result.getValue(1));
|
||||
return Result.getValue(Op.ResNo);
|
||||
}
|
||||
assert(0 && "Unreachable");
|
||||
}
|
||||
case ISD::TAILCALL:
|
||||
case ISD::CALL: {
|
||||
Tmp1 = LegalizeOp(Node->getOperand(0)); // Legalize the chain.
|
||||
|
Loading…
x
Reference in New Issue
Block a user