@@ -41579,8 +41579,7 @@ static SDValue canonicalizeShuffleWithOp(SDValue N, SelectionDAG &DAG,
4157941579 EVT ShuffleVT = N.getValueType();
4158041580 unsigned Opc = N.getOpcode();
4158141581
41582- auto IsMergeableWithShuffle = [Opc, &DAG](SDValue Op, bool FoldShuf = true,
41583- bool FoldLoad = false) {
41582+ auto IsMergeableWithShuffle = [Opc, &DAG](SDValue Op, bool FoldShuf = true) {
4158441583 // AllZeros/AllOnes constants are freely shuffled and will peek through
4158541584 // bitcasts. Other constant build vectors do not peek through bitcasts. Only
4158641585 // merge with target shuffles if it has one use so shuffle combining is
@@ -41593,7 +41592,6 @@ static SDValue canonicalizeShuffleWithOp(SDValue N, SelectionDAG &DAG,
4159341592 (Op.getOpcode() == Opc && Op->hasOneUse()) ||
4159441593 (Op.getOpcode() == ISD::INSERT_SUBVECTOR && Op->hasOneUse()) ||
4159541594 (FoldShuf && isTargetShuffle(Op.getOpcode()) && Op->hasOneUse()) ||
41596- (FoldLoad && isShuffleFoldableLoad(Op)) ||
4159741595 DAG.isSplatValue(Op, /*AllowUndefs*/ false);
4159841596 };
4159941597 auto IsSafeToMoveShuffle = [ShuffleVT](SDValue Op, unsigned BinOp) {
@@ -41629,9 +41627,8 @@ static SDValue canonicalizeShuffleWithOp(SDValue N, SelectionDAG &DAG,
4162941627 SDValue Op00 = peekThroughOneUseBitcasts(N0.getOperand(0));
4163041628 SDValue Op01 = peekThroughOneUseBitcasts(N0.getOperand(1));
4163141629 bool FoldShuf = Opc != X86ISD::VPERMI;
41632- bool FoldLoad = Opc != X86ISD::PSHUFB;
41633- if (IsMergeableWithShuffle(Op00, FoldShuf, FoldLoad) ||
41634- IsMergeableWithShuffle(Op01, FoldShuf, FoldLoad)) {
41630+ if (IsMergeableWithShuffle(Op00, FoldShuf) ||
41631+ IsMergeableWithShuffle(Op01, FoldShuf)) {
4163541632 SDValue LHS, RHS;
4163641633 Op00 = DAG.getBitcast(ShuffleVT, Op00);
4163741634 Op01 = DAG.getBitcast(ShuffleVT, Op01);
0 commit comments