@@ -49789,13 +49789,13 @@ static unsigned convertIntLogicToFPLogicOpcode(unsigned Opcode) {
4978949789/// If both input operands of a logic op are being cast from floating-point
4979049790/// types or FP compares, try to convert this into a floating-point logic node
4979149791/// to avoid unnecessary moves from SSE to integer registers.
49792- static SDValue convertIntLogicToFPLogic(SDNode *N, SelectionDAG &DAG,
49792+ static SDValue convertIntLogicToFPLogic(unsigned Opc, const SDLoc &DL, EVT VT,
49793+ SDValue N0, SDValue N1,
49794+ SelectionDAG &DAG,
4979349795 TargetLowering::DAGCombinerInfo &DCI,
4979449796 const X86Subtarget &Subtarget) {
49795- EVT VT = N->getValueType(0);
49796- SDValue N0 = N->getOperand(0);
49797- SDValue N1 = N->getOperand(1);
49798- SDLoc DL(N);
49797+ assert((Opc == ISD::OR || Opc == ISD::AND || Opc == ISD::XOR) &&
49798+ "Unexpected bit opcode");
4979949799
4980049800 if (!((N0.getOpcode() == ISD::BITCAST && N1.getOpcode() == ISD::BITCAST) ||
4980149801 (N0.getOpcode() == ISD::SETCC && N1.getOpcode() == ISD::SETCC)))
@@ -49813,7 +49813,7 @@ static SDValue convertIntLogicToFPLogic(SDNode *N, SelectionDAG &DAG,
4981349813 return SDValue();
4981449814
4981549815 if (N0.getOpcode() == ISD::BITCAST && !DCI.isBeforeLegalizeOps()) {
49816- unsigned FPOpcode = convertIntLogicToFPLogicOpcode(N->getOpcode() );
49816+ unsigned FPOpcode = convertIntLogicToFPLogicOpcode(Opc );
4981749817 SDValue FPLogic = DAG.getNode(FPOpcode, DL, N00Type, N00, N10);
4981849818 return DAG.getBitcast(VT, FPLogic);
4981949819 }
@@ -49847,7 +49847,7 @@ static SDValue convertIntLogicToFPLogic(SDNode *N, SelectionDAG &DAG,
4984749847 SDValue Vec11 = DAG.getNode(ISD::SCALAR_TO_VECTOR, DL, VecVT, N11);
4984849848 SDValue Setcc0 = DAG.getSetCC(DL, BoolVecVT, Vec00, Vec01, CC0);
4984949849 SDValue Setcc1 = DAG.getSetCC(DL, BoolVecVT, Vec10, Vec11, CC1);
49850- SDValue Logic = DAG.getNode(N->getOpcode() , DL, BoolVecVT, Setcc0, Setcc1);
49850+ SDValue Logic = DAG.getNode(Opc , DL, BoolVecVT, Setcc0, Setcc1);
4985149851 return DAG.getNode(ISD::EXTRACT_VECTOR_ELT, DL, VT, Logic, ZeroIndex);
4985249852}
4985349853
@@ -50521,7 +50521,8 @@ static SDValue combineAnd(SDNode *N, SelectionDAG &DAG,
5052150521 if (SDValue R = combineBitOpWithPACK(N->getOpcode(), dl, VT, N0, N1, DAG))
5052250522 return R;
5052350523
50524- if (SDValue FPLogic = convertIntLogicToFPLogic(N, DAG, DCI, Subtarget))
50524+ if (SDValue FPLogic = convertIntLogicToFPLogic(N->getOpcode(), dl, VT, N0, N1,
50525+ DAG, DCI, Subtarget))
5052550526 return FPLogic;
5052650527
5052750528 if (SDValue R = combineAndShuffleNot(N, DAG, Subtarget))
@@ -51306,7 +51307,8 @@ static SDValue combineOr(SDNode *N, SelectionDAG &DAG,
5130651307 if (SDValue R = combineBitOpWithPACK(N->getOpcode(), dl, VT, N0, N1, DAG))
5130751308 return R;
5130851309
51309- if (SDValue FPLogic = convertIntLogicToFPLogic(N, DAG, DCI, Subtarget))
51310+ if (SDValue FPLogic = convertIntLogicToFPLogic(N->getOpcode(), dl, VT, N0, N1,
51311+ DAG, DCI, Subtarget))
5131051312 return FPLogic;
5131151313
5131251314 if (DCI.isBeforeLegalizeOps())
@@ -53623,7 +53625,8 @@ static SDValue combineXor(SDNode *N, SelectionDAG &DAG,
5362353625 if (SDValue R = combineBitOpWithPACK(N->getOpcode(), DL, VT, N0, N1, DAG))
5362453626 return R;
5362553627
53626- if (SDValue FPLogic = convertIntLogicToFPLogic(N, DAG, DCI, Subtarget))
53628+ if (SDValue FPLogic = convertIntLogicToFPLogic(N->getOpcode(), DL, VT, N0, N1,
53629+ DAG, DCI, Subtarget))
5362753630 return FPLogic;
5362853631
5362953632 if (SDValue R = combineXorSubCTLZ(N, DL, DAG, Subtarget))
0 commit comments