forked from OSchip/llvm-project
parent
67b35bd4d1
commit
8badb674eb
|
@ -5148,7 +5148,6 @@ SDValue DAGCombiner::visitVECTOR_SHUFFLE(SDNode *N) {
|
|||
}
|
||||
|
||||
SDValue DAGCombiner::visitSADDO(SDNode *N) {
|
||||
SDValue Chain = N->getOperand(2);
|
||||
SDValue LHS = N->getOperand(0);
|
||||
SDValue RHS = N->getOperand(1);
|
||||
|
||||
|
@ -5157,17 +5156,16 @@ SDValue DAGCombiner::visitSADDO(SDNode *N) {
|
|||
SDValue Cmp = DAG.getSetCC(MVT::i1, Sum, LHS, ISD::SETLT);
|
||||
AddToWorkList(Cmp.getNode());
|
||||
|
||||
MVT ValueVTs[] = { LHS.getValueType(), MVT::i1, MVT::Other };
|
||||
SDValue Ops[] = { Sum, Cmp, Chain };
|
||||
MVT ValueVTs[] = { LHS.getValueType(), MVT::i1 };
|
||||
SDValue Ops[] = { Sum, Cmp };
|
||||
|
||||
SDValue Merge = DAG.getMergeValues(DAG.getVTList(&ValueVTs[0], 3),
|
||||
&Ops[0], 3);
|
||||
SDValue Merge = DAG.getMergeValues(DAG.getVTList(&ValueVTs[0], 2),
|
||||
&Ops[0], 2);
|
||||
SDNode *MNode = Merge.getNode();
|
||||
|
||||
AddToWorkList(MNode);
|
||||
DAG.ReplaceAllUsesOfValueWith(SDValue(N, 0), SDValue(MNode, 0));
|
||||
DAG.ReplaceAllUsesOfValueWith(SDValue(N, 1), SDValue(MNode, 1));
|
||||
DAG.ReplaceAllUsesOfValueWith(SDValue(N, 2), SDValue(MNode, 2));
|
||||
|
||||
// Since the node is now dead, remove it from the graph.
|
||||
removeFromWorkList(N);
|
||||
|
|
|
@ -4095,21 +4095,17 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
|
|||
|
||||
case Intrinsic::sadd_with_overflow: {
|
||||
// Convert to "ISD::SADDO" instruction.
|
||||
SDValue Chain = getRoot();
|
||||
SDValue Op1 = getValue(I.getOperand(1));
|
||||
SDValue Op2 = getValue(I.getOperand(2));
|
||||
MVT Ty = Op1.getValueType();
|
||||
|
||||
MVT ValueVTs[] = { Ty, MVT::i1, MVT::Other };
|
||||
SDValue Ops[] = { Op1, Op2, Chain };
|
||||
MVT ValueVTs[] = { Ty, MVT::i1 };
|
||||
SDValue Ops[] = { Op1, Op2 };
|
||||
|
||||
SDValue Result = DAG.getNode(ISD::SADDO, DAG.getVTList(&ValueVTs[0], 3),
|
||||
&Ops[0], 3);
|
||||
SDValue Result = DAG.getNode(ISD::SADDO, DAG.getVTList(&ValueVTs[0], 2),
|
||||
&Ops[0], 2);
|
||||
|
||||
setValue(&I, Result);
|
||||
|
||||
unsigned NumArgRegs = Result.getNode()->getNumValues() - 1;
|
||||
DAG.setRoot(SDValue(Result.getNode(), NumArgRegs));
|
||||
return 0;
|
||||
}
|
||||
case Intrinsic::uadd_with_overflow: {
|
||||
|
|
Loading…
Reference in New Issue