@@ -42365,10 +42365,10 @@ static SDValue combineTargetShuffle(SDValue N, const SDLoc &DL,
4236542365 // If we're permuting the upper 256-bits subvectors of a concatenation, then
4236642366 // see if we can peek through and access the subvector directly.
4236742367 if (VT.is512BitVector()) {
42368- // 512-bit mask uses 4 x i2 indices - if the msb is always set then only the
42369- // upper subvector is used.
42370- SDValue LHS = N->getOperand(0);
42371- SDValue RHS = N->getOperand(1);
42368+ // 512-bit mask uses 4 x i2 indices - if the msb is always set then only
42369+ // the upper subvector is used.
42370+ SDValue LHS = peekThroughBitcasts( N->getOperand(0) );
42371+ SDValue RHS = peekThroughBitcasts( N->getOperand(1) );
4237242372 uint64_t Mask = N->getConstantOperandVal(2);
4237342373 SmallVector<SDValue> LHSOps, RHSOps;
4237442374 SDValue NewLHS, NewRHS;
@@ -42383,8 +42383,9 @@ static SDValue combineTargetShuffle(SDValue N, const SDLoc &DL,
4238342383 Mask &= ~0xA0;
4238442384 }
4238542385 if (NewLHS || NewRHS)
42386- return DAG.getNode(X86ISD::SHUF128, DL, VT, NewLHS ? NewLHS : LHS,
42387- NewRHS ? NewRHS : RHS,
42386+ return DAG.getNode(X86ISD::SHUF128, DL, VT,
42387+ DAG.getBitcast(VT, NewLHS ? NewLHS : LHS),
42388+ DAG.getBitcast(VT, NewRHS ? NewRHS : RHS),
4238842389 DAG.getTargetConstant(Mask, DL, MVT::i8));
4238942390 }
4239042391 return SDValue();
0 commit comments