@@ -58071,12 +58071,24 @@ static SDValue combineX86CloadCstore(SDNode *N, SelectionDAG &DAG) {
5807158071 Ops[3] = Op1.getOperand(0);
5807258072 Ops[4] = Op1.getOperand(1);
5807358073 } else if (Op1.getOpcode() == ISD::AND && Sub.getValue(0).use_empty()) {
58074+ SDValue Src = Op1;
58075+ SDValue Op10 = Op1.getOperand(0);
58076+ if (Op10.getOpcode() == ISD::XOR && isAllOnesConstant(Op10.getOperand(1))) {
58077+ // res, flags2 = sub 0, (and (xor X, -1), Y)
58078+ // cload/cstore ..., cond_ne, flag2
58079+ // ->
58080+ // res, flags2 = sub 0, (and X, Y)
58081+ // cload/cstore ..., cond_e, flag2
58082+ Src = DAG.getNode(ISD::AND, DL, Op1.getValueType(), Op10.getOperand(0),
58083+ Op1.getOperand(1));
58084+ Ops[3] = DAG.getTargetConstant(X86::COND_E, DL, MVT::i8);
58085+ }
5807458086 // res, flags2 = sub 0, (and X, Y)
58075- // cload/cstore ..., cond_ne , flag2
58087+ // cload/cstore ..., cc , flag2
5807658088 // ->
5807758089 // res, flags2 = cmp (and X, Y), 0
58078- // cload/cstore ..., cond_ne , flag2
58079- Ops[4] = DAG.getNode(X86ISD::CMP, DL, MVT::i32, Op1 , Sub.getOperand(0));
58090+ // cload/cstore ..., cc , flag2
58091+ Ops[4] = DAG.getNode(X86ISD::CMP, DL, MVT::i32, Src , Sub.getOperand(0));
5808058092 } else {
5808158093 return SDValue();
5808258094 }
0 commit comments