@@ -59683,16 +59683,6 @@ static SDValue narrowExtractedVectorSelect(SDNode *Ext, const SDLoc &DL,
59683
59683
static SDValue combineEXTRACT_SUBVECTOR(SDNode *N, SelectionDAG &DAG,
59684
59684
TargetLowering::DAGCombinerInfo &DCI,
59685
59685
const X86Subtarget &Subtarget) {
59686
- // For AVX1 only, if we are extracting from a 256-bit and+not (which will
59687
- // eventually get combined/lowered into ANDNP) with a concatenated operand,
59688
- // split the 'and' into 128-bit ops to avoid the concatenate and extract.
59689
- // We let generic combining take over from there to simplify the
59690
- // insert/extract and 'not'.
59691
- // This pattern emerges during AVX1 legalization. We handle it before lowering
59692
- // to avoid complications like splitting constant vector loads.
59693
-
59694
- // Capture the original wide type in the likely case that we need to bitcast
59695
- // back to this type.
59696
59686
if (!N->getValueType(0).isSimple())
59697
59687
return SDValue();
59698
59688
@@ -59708,8 +59698,14 @@ static SDValue combineEXTRACT_SUBVECTOR(SDNode *N, SelectionDAG &DAG,
59708
59698
const TargetLowering &TLI = DAG.getTargetLoweringInfo();
59709
59699
SDLoc DL(N);
59710
59700
59711
- if (Subtarget.hasAVX() && !Subtarget.hasAVX2() &&
59712
- TLI.isTypeLegal(InVecVT) &&
59701
+ // For AVX1 only, if we are extracting from a 256-bit and+not (which will
59702
+ // eventually get combined/lowered into ANDNP) with a concatenated operand,
59703
+ // split the 'and' into 128-bit ops to avoid the concatenate and extract.
59704
+ // We let generic combining take over from there to simplify the
59705
+ // insert/extract and 'not'.
59706
+ // This pattern emerges during AVX1 legalization. We handle it before lowering
59707
+ // to avoid complications like splitting constant vector loads.
59708
+ if (Subtarget.hasAVX() && !Subtarget.hasAVX2() && TLI.isTypeLegal(InVecVT) &&
59713
59709
InSizeInBits == 256 && InVecBC.getOpcode() == ISD::AND) {
59714
59710
auto isConcatenatedNot = [](SDValue V) {
59715
59711
V = peekThroughBitcasts(V);
0 commit comments