mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-22 21:41:38 +00:00
Support for legalizing MEMBARRIER.
llvm-svn: 47667
This commit is contained in:
parent
2cae66e28b
commit
f8ac836240
@ -1140,8 +1140,11 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
|
||||
case TargetLowering::Legal: {
|
||||
SDOperand Ops[6];
|
||||
Ops[0] = LegalizeOp(Node->getOperand(0)); // Legalize the chain.
|
||||
for (int x = 1; x < 6; ++x)
|
||||
Ops[x] = PromoteOp(Node->getOperand(x));
|
||||
for (int x = 1; x < 6; ++x) {
|
||||
Ops[x] = Node->getOperand(x);
|
||||
if (!isTypeLegal(Ops[x].getValueType()))
|
||||
Ops[x] = PromoteOp(Ops[x]);
|
||||
}
|
||||
Result = DAG.UpdateNodeOperands(Result, &Ops[0], 6);
|
||||
break;
|
||||
}
|
||||
|
@ -190,6 +190,7 @@ private:
|
||||
SDOperand PromoteOperand_FP_EXTEND(SDNode *N);
|
||||
SDOperand PromoteOperand_FP_ROUND(SDNode *N);
|
||||
SDOperand PromoteOperand_INT_TO_FP(SDNode *N);
|
||||
SDOperand PromoteOperand_MEMBARRIER(SDNode *N);
|
||||
SDOperand PromoteOperand_RET(SDNode *N, unsigned OpNo);
|
||||
SDOperand PromoteOperand_SELECT(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::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.
|
||||
@ -612,3 +614,14 @@ SDOperand DAGTypeLegalizer::PromoteOperand_RET(SDNode *N, unsigned OpNo) {
|
||||
return DAG.UpdateNodeOperands(SDOperand (N, 0),
|
||||
&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…
x
Reference in New Issue
Block a user