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;
}
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);
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.
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));
+}