forked from OSchip/llvm-project
parent
a1523a38f9
commit
96658d0189
|
@ -1140,8 +1140,11 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
|
||||||
case TargetLowering::Legal: {
|
case TargetLowering::Legal: {
|
||||||
SDOperand Ops[6];
|
SDOperand Ops[6];
|
||||||
Ops[0] = LegalizeOp(Node->getOperand(0)); // Legalize the chain.
|
Ops[0] = LegalizeOp(Node->getOperand(0)); // Legalize the chain.
|
||||||
for (int x = 1; x < 6; ++x)
|
for (int x = 1; x < 6; ++x) {
|
||||||
Ops[x] = PromoteOp(Node->getOperand(x));
|
Ops[x] = Node->getOperand(x);
|
||||||
|
if (!isTypeLegal(Ops[x].getValueType()))
|
||||||
|
Ops[x] = PromoteOp(Ops[x]);
|
||||||
|
}
|
||||||
Result = DAG.UpdateNodeOperands(Result, &Ops[0], 6);
|
Result = DAG.UpdateNodeOperands(Result, &Ops[0], 6);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -190,6 +190,7 @@ private:
|
||||||
SDOperand PromoteOperand_FP_EXTEND(SDNode *N);
|
SDOperand PromoteOperand_FP_EXTEND(SDNode *N);
|
||||||
SDOperand PromoteOperand_FP_ROUND(SDNode *N);
|
SDOperand PromoteOperand_FP_ROUND(SDNode *N);
|
||||||
SDOperand PromoteOperand_INT_TO_FP(SDNode *N);
|
SDOperand PromoteOperand_INT_TO_FP(SDNode *N);
|
||||||
|
SDOperand PromoteOperand_MEMBARRIER(SDNode *N);
|
||||||
SDOperand PromoteOperand_RET(SDNode *N, unsigned OpNo);
|
SDOperand PromoteOperand_RET(SDNode *N, unsigned OpNo);
|
||||||
SDOperand PromoteOperand_SELECT(SDNode *N, unsigned OpNo);
|
SDOperand PromoteOperand_SELECT(SDNode *N, unsigned OpNo);
|
||||||
SDOperand PromoteOperand_SETCC(SDNode *N, unsigned OpNo);
|
SDOperand PromoteOperand_SETCC(SDNode *N, unsigned OpNo);
|
||||||
|
|
|
@ -359,6 +359,8 @@ bool DAGTypeLegalizer::PromoteOperand(SDNode *N, unsigned OpNo) {
|
||||||
case ISD::BUILD_VECTOR: Res = PromoteOperand_BUILD_VECTOR(N); break;
|
case ISD::BUILD_VECTOR: Res = PromoteOperand_BUILD_VECTOR(N); break;
|
||||||
|
|
||||||
case ISD::RET: Res = PromoteOperand_RET(N, OpNo); break;
|
case ISD::RET: Res = PromoteOperand_RET(N, OpNo); break;
|
||||||
|
|
||||||
|
case ISD::MEMBARRIER: Res = PromoteOperand_MEMBARRIER(N); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the result is null, the sub-method took care of registering results etc.
|
// If the result is null, the sub-method took care of registering results etc.
|
||||||
|
@ -612,3 +614,14 @@ SDOperand DAGTypeLegalizer::PromoteOperand_RET(SDNode *N, unsigned OpNo) {
|
||||||
return DAG.UpdateNodeOperands(SDOperand (N, 0),
|
return DAG.UpdateNodeOperands(SDOperand (N, 0),
|
||||||
&NewValues[0], NewValues.size());
|
&NewValues[0], NewValues.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SDOperand DAGTypeLegalizer::PromoteOperand_MEMBARRIER(SDNode *N) {
|
||||||
|
SDOperand NewOps[6];
|
||||||
|
NewOps[0] = N->getOperand(0);
|
||||||
|
for (unsigned i = 1; i < array_lengthof(NewOps); ++i) {
|
||||||
|
SDOperand Flag = GetPromotedOp(N->getOperand(i));
|
||||||
|
NewOps[i] = DAG.getZeroExtendInReg(Flag, MVT::i1);
|
||||||
|
}
|
||||||
|
return DAG.UpdateNodeOperands(SDOperand (N, 0), NewOps,
|
||||||
|
array_lengthof(NewOps));
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue