@@ -59577,7 +59577,6 @@ static SDValue combineEXTRACT_SUBVECTOR(SDNode *N, SelectionDAG &DAG,
59577
59577
MVT VT = N->getSimpleValueType(0);
59578
59578
SDValue InVec = N->getOperand(0);
59579
59579
unsigned IdxVal = N->getConstantOperandVal(1);
59580
- SDValue InVecBC = peekThroughBitcasts(InVec);
59581
59580
EVT InVecVT = InVec.getValueType();
59582
59581
unsigned SizeInBits = VT.getSizeInBits();
59583
59582
unsigned InSizeInBits = InVecVT.getSizeInBits();
@@ -59594,20 +59593,20 @@ static SDValue combineEXTRACT_SUBVECTOR(SDNode *N, SelectionDAG &DAG,
59594
59593
// This pattern emerges during AVX1 legalization. We handle it before lowering
59595
59594
// to avoid complications like splitting constant vector loads.
59596
59595
if (Subtarget.hasAVX() && !Subtarget.hasAVX2() && TLI.isTypeLegal(InVecVT) &&
59597
- InSizeInBits == 256 && InVecBC .getOpcode() == ISD::AND) {
59596
+ InSizeInBits == 256 && InVec .getOpcode() == ISD::AND) {
59598
59597
auto isConcatenatedNot = [](SDValue V) {
59599
59598
V = peekThroughBitcasts(V);
59600
59599
if (!isBitwiseNot(V))
59601
59600
return false;
59602
59601
SDValue NotOp = V->getOperand(0);
59603
59602
return peekThroughBitcasts(NotOp).getOpcode() == ISD::CONCAT_VECTORS;
59604
59603
};
59605
- if (isConcatenatedNot(InVecBC .getOperand(0)) ||
59606
- isConcatenatedNot(InVecBC .getOperand(1))) {
59604
+ if (isConcatenatedNot(InVec .getOperand(0)) ||
59605
+ isConcatenatedNot(InVec .getOperand(1))) {
59607
59606
// extract (and v4i64 X, (not (concat Y1, Y2))), n -> andnp v2i64 X(n), Y1
59608
- SDValue Concat = splitVectorIntBinary(InVecBC, DAG, SDLoc(InVecBC));
59609
59607
return DAG.getNode(ISD::EXTRACT_SUBVECTOR, DL, VT,
59610
- DAG.getBitcast(InVecVT, Concat), N->getOperand(1));
59608
+ splitVectorIntBinary(InVec, DAG, DL),
59609
+ N->getOperand(1));
59611
59610
}
59612
59611
}
59613
59612
@@ -59691,7 +59690,7 @@ static SDValue combineEXTRACT_SUBVECTOR(SDNode *N, SelectionDAG &DAG,
59691
59690
SmallVector<SDValue, 2> ShuffleInputs;
59692
59691
unsigned NumSubVecs = InSizeInBits / SizeInBits;
59693
59692
// Decode the shuffle mask and scale it so its shuffling subvectors.
59694
- if (getTargetShuffleInputs(InVecBC , ShuffleInputs, ShuffleMask, DAG) &&
59693
+ if (getTargetShuffleInputs(InVec , ShuffleInputs, ShuffleMask, DAG) &&
59695
59694
scaleShuffleElements(ShuffleMask, NumSubVecs, ScaledMask)) {
59696
59695
unsigned SubVecIdx = IdxVal / NumSubElts;
59697
59696
if (ScaledMask[SubVecIdx] == SM_SentinelUndef)
0 commit comments