@@ -49922,15 +49922,11 @@ static SDValue combineBitOpWithShift(unsigned Opc, const SDLoc &DL, EVT VT,
49922
49922
// Attempt to fold:
49923
49923
// BITOP(PACKSS(X,Z),PACKSS(Y,W)) --> PACKSS(BITOP(X,Y),BITOP(Z,W)).
49924
49924
// TODO: Handle PACKUS handling.
49925
- static SDValue combineBitOpWithPACK(SDNode *N, SelectionDAG &DAG) {
49926
- unsigned Opc = N->getOpcode();
49925
+ static SDValue combineBitOpWithPACK(unsigned Opc, const SDLoc &DL, EVT VT,
49926
+ SDValue N0, SDValue N1, SelectionDAG &DAG) {
49927
49927
assert((Opc == ISD::OR || Opc == ISD::AND || Opc == ISD::XOR) &&
49928
49928
"Unexpected bit opcode");
49929
49929
49930
- SDValue N0 = N->getOperand(0);
49931
- SDValue N1 = N->getOperand(1);
49932
- EVT VT = N->getValueType(0);
49933
-
49934
49930
// Both operands must be single use.
49935
49931
if (!N0.hasOneUse() || !N1.hasOneUse())
49936
49932
return SDValue();
@@ -49956,7 +49952,6 @@ static SDValue combineBitOpWithPACK(SDNode *N, SelectionDAG &DAG) {
49956
49952
DAG.ComputeNumSignBits(N1.getOperand(1)) != NumSrcBits)
49957
49953
return SDValue();
49958
49954
49959
- SDLoc DL(N);
49960
49955
SDValue LHS = DAG.getNode(Opc, DL, SrcVT, N0.getOperand(0), N1.getOperand(0));
49961
49956
SDValue RHS = DAG.getNode(Opc, DL, SrcVT, N0.getOperand(1), N1.getOperand(1));
49962
49957
return DAG.getBitcast(VT, DAG.getNode(X86ISD::PACKSS, DL, DstVT, LHS, RHS));
@@ -50523,7 +50518,7 @@ static SDValue combineAnd(SDNode *N, SelectionDAG &DAG,
50523
50518
if (SDValue R = combineBitOpWithShift(N->getOpcode(), dl, VT, N0, N1, DAG))
50524
50519
return R;
50525
50520
50526
- if (SDValue R = combineBitOpWithPACK(N, DAG))
50521
+ if (SDValue R = combineBitOpWithPACK(N->getOpcode(), dl, VT, N0, N1 , DAG))
50527
50522
return R;
50528
50523
50529
50524
if (SDValue FPLogic = convertIntLogicToFPLogic(N, DAG, DCI, Subtarget))
@@ -51308,7 +51303,7 @@ static SDValue combineOr(SDNode *N, SelectionDAG &DAG,
51308
51303
if (SDValue R = combineBitOpWithShift(N->getOpcode(), dl, VT, N0, N1, DAG))
51309
51304
return R;
51310
51305
51311
- if (SDValue R = combineBitOpWithPACK(N, DAG))
51306
+ if (SDValue R = combineBitOpWithPACK(N->getOpcode(), dl, VT, N0, N1 , DAG))
51312
51307
return R;
51313
51308
51314
51309
if (SDValue FPLogic = convertIntLogicToFPLogic(N, DAG, DCI, Subtarget))
@@ -53625,7 +53620,7 @@ static SDValue combineXor(SDNode *N, SelectionDAG &DAG,
53625
53620
if (SDValue R = combineBitOpWithShift(N->getOpcode(), DL, VT, N0, N1, DAG))
53626
53621
return R;
53627
53622
53628
- if (SDValue R = combineBitOpWithPACK(N, DAG))
53623
+ if (SDValue R = combineBitOpWithPACK(N->getOpcode(), DL, VT, N0, N1 , DAG))
53629
53624
return R;
53630
53625
53631
53626
if (SDValue FPLogic = convertIntLogicToFPLogic(N, DAG, DCI, Subtarget))
0 commit comments