mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-26 14:25:18 +00:00
Fix custom lowering of dynamic_stackalloc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25329 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3776fea371
commit
5f652295c2
@ -842,22 +842,25 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
|
|||||||
} else
|
} else
|
||||||
Result = Op.getValue(0);
|
Result = Op.getValue(0);
|
||||||
|
|
||||||
|
Tmp1 = Result;
|
||||||
|
Tmp2 = Result.getValue(1);
|
||||||
switch (TLI.getOperationAction(Node->getOpcode(),
|
switch (TLI.getOperationAction(Node->getOpcode(),
|
||||||
Node->getValueType(0))) {
|
Node->getValueType(0))) {
|
||||||
default: assert(0 && "This action is not supported yet!");
|
default: assert(0 && "This action is not supported yet!");
|
||||||
case TargetLowering::Custom: {
|
case TargetLowering::Custom: {
|
||||||
SDOperand Tmp = TLI.LowerOperation(Result, DAG);
|
Tmp3 = TLI.LowerOperation(Tmp1, DAG);
|
||||||
if (Tmp.Val) {
|
if (Tmp3.Val) {
|
||||||
Result = LegalizeOp(Tmp);
|
Tmp1 = LegalizeOp(Tmp3);
|
||||||
|
Tmp2 = LegalizeOp(Tmp3.getValue(1));
|
||||||
}
|
}
|
||||||
// FALLTHROUGH if the target thinks it is legal.
|
// FALLTHROUGH if the target thinks it is legal.
|
||||||
}
|
}
|
||||||
case TargetLowering::Legal:
|
case TargetLowering::Legal:
|
||||||
// Since this op produce two values, make sure to remember that we
|
// Since this op produce two values, make sure to remember that we
|
||||||
// legalized both of them.
|
// legalized both of them.
|
||||||
AddLegalizedOperand(SDOperand(Node, 0), Result);
|
AddLegalizedOperand(SDOperand(Node, 0), Tmp1);
|
||||||
AddLegalizedOperand(SDOperand(Node, 1), Result.getValue(1));
|
AddLegalizedOperand(SDOperand(Node, 1), Tmp2);
|
||||||
return Result.getValue(Op.ResNo);
|
return Op.ResNo ? Tmp2 : Tmp1;
|
||||||
}
|
}
|
||||||
assert(0 && "Unreachable");
|
assert(0 && "Unreachable");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user