@@ -57982,7 +57982,8 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
57982
57982
return combineConcatVectorOps(DL, VT, Subs, DAG, Subtarget, Depth + 1);
57983
57983
};
57984
57984
57985
- switch (Op0.getOpcode()) {
57985
+ unsigned Opcode = Op0.getOpcode();
57986
+ switch (Opcode) {
57986
57987
case ISD::VECTOR_SHUFFLE: {
57987
57988
// TODO: Generalize NumOps support.
57988
57989
if (!IsSplat && NumOps == 2 &&
@@ -58039,8 +58040,7 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
58039
58040
case X86ISD::MOVSLDUP: {
58040
58041
if (!IsSplat && (VT.is256BitVector() ||
58041
58042
(VT.is512BitVector() && Subtarget.useAVX512Regs())))
58042
- return DAG.getNode(Op0.getOpcode(), DL, VT,
58043
- ConcatSubOperand(VT, Ops, 0));
58043
+ return DAG.getNode(Opcode, DL, VT, ConcatSubOperand(VT, Ops, 0));
58044
58044
break;
58045
58045
}
58046
58046
case X86ISD::SHUFP: {
@@ -58054,7 +58054,7 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
58054
58054
SDValue Concat0 = CombineSubOperand(VT, Ops, 0);
58055
58055
SDValue Concat1 = CombineSubOperand(VT, Ops, 1);
58056
58056
if (Concat0 || Concat1)
58057
- return DAG.getNode(Op0.getOpcode() , DL, VT,
58057
+ return DAG.getNode(Opcode , DL, VT,
58058
58058
Concat0 ? Concat0 : ConcatSubOperand(VT, Ops, 0),
58059
58059
Concat1 ? Concat1 : ConcatSubOperand(VT, Ops, 1),
58060
58060
Op0.getOperand(2));
@@ -58074,8 +58074,7 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
58074
58074
peekThroughBitcasts(Op.getOperand(1)).getOpcode() ==
58075
58075
ISD::SCALAR_TO_VECTOR;
58076
58076
})) {
58077
- return DAG.getNode(Op0.getOpcode(), DL, VT,
58078
- ConcatSubOperand(VT, Ops, 0),
58077
+ return DAG.getNode(Opcode, DL, VT, ConcatSubOperand(VT, Ops, 0),
58079
58078
ConcatSubOperand(VT, Ops, 1));
58080
58079
}
58081
58080
break;
@@ -58090,8 +58089,8 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
58090
58089
llvm::all_of(Ops, [Op0](SDValue Op) {
58091
58090
return Op.getOperand(1) == Op0.getOperand(1);
58092
58091
})) {
58093
- return DAG.getNode(Op0.getOpcode() , DL, VT,
58094
- ConcatSubOperand(VT, Ops, 0), Op0.getOperand(1));
58092
+ return DAG.getNode(Opcode , DL, VT, ConcatSubOperand(VT, Ops, 0) ,
58093
+ Op0.getOperand(1));
58095
58094
}
58096
58095
[[fallthrough]];
58097
58096
case X86ISD::VPERMILPI:
@@ -58112,7 +58111,7 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
58112
58111
uint64_t Idx0 = Ops[0].getConstantOperandVal(1);
58113
58112
uint64_t Idx1 = Ops[1].getConstantOperandVal(1);
58114
58113
uint64_t Idx = ((Idx1 & 3) << 2) | (Idx0 & 3);
58115
- return DAG.getNode(Op0.getOpcode() , DL, VT,
58114
+ return DAG.getNode(X86ISD::VPERMILPI , DL, VT,
58116
58115
ConcatSubOperand(VT, Ops, 0),
58117
58116
DAG.getTargetConstant(Idx, DL, MVT::i8));
58118
58117
}
@@ -58130,7 +58129,7 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
58130
58129
SDValue Concat1 = CombineSubOperand(SrcVT, Ops, 1);
58131
58130
if (Concat0 || Concat1)
58132
58131
return DAG.getNode(
58133
- Op0.getOpcode() , DL, VT,
58132
+ Opcode , DL, VT,
58134
58133
Concat0 ? Concat0 : ConcatSubOperand(SrcVT, Ops, 0),
58135
58134
Concat1 ? Concat1 : ConcatSubOperand(SrcVT, Ops, 1));
58136
58135
}
@@ -58261,7 +58260,7 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
58261
58260
if (SrcVT.isSimple() && SrcVT.is128BitVector() &&
58262
58261
SrcVT == Ops[1].getOperand(0).getValueType()) {
58263
58262
EVT NewSrcVT = SrcVT.getDoubleNumVectorElementsVT(Ctx);
58264
- return DAG.getNode(Op0.getOpcode() , DL, VT,
58263
+ return DAG.getNode(Opcode , DL, VT,
58265
58264
ConcatSubOperand(NewSrcVT, Ops, 0));
58266
58265
}
58267
58266
}
@@ -58287,7 +58286,7 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
58287
58286
DAG.getNode(X86ISD::UNPCKL, DL, UnpackVT,
58288
58287
DAG.getBitcast(UnpackVT, Ops[0].getOperand(0)),
58289
58288
DAG.getBitcast(UnpackVT, Ops[1].getOperand(0)));
58290
- return getEXTEND_VECTOR_INREG(Op0.getOpcode() , DL, VT,
58289
+ return getEXTEND_VECTOR_INREG(Opcode , DL, VT,
58291
58290
DAG.getBitcast(SrcVT, Unpack), DAG);
58292
58291
}
58293
58292
break;
@@ -58301,7 +58300,7 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
58301
58300
})) {
58302
58301
SDValue Res = DAG.getBitcast(MVT::v8i32, ConcatSubOperand(VT, Ops, 0));
58303
58302
SDValue Zero = getZeroVector(MVT::v8i32, Subtarget, DAG, DL);
58304
- if (Op0.getOpcode() == X86ISD::VSHLI) {
58303
+ if (Opcode == X86ISD::VSHLI) {
58305
58304
Res = DAG.getVectorShuffle(MVT::v8i32, DL, Res, Zero,
58306
58305
{8, 0, 8, 2, 8, 4, 8, 6});
58307
58306
} else {
@@ -58321,8 +58320,8 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
58321
58320
llvm::all_of(Ops, [Op0](SDValue Op) {
58322
58321
return Op0.getOperand(1) == Op.getOperand(1);
58323
58322
})) {
58324
- return DAG.getNode(Op0.getOpcode() , DL, VT,
58325
- ConcatSubOperand(VT, Ops, 0), Op0.getOperand(1));
58323
+ return DAG.getNode(Opcode , DL, VT, ConcatSubOperand(VT, Ops, 0) ,
58324
+ Op0.getOperand(1));
58326
58325
}
58327
58326
break;
58328
58327
case X86ISD::VPERMI:
@@ -58333,8 +58332,8 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
58333
58332
llvm::all_of(Ops, [Op0](SDValue Op) {
58334
58333
return Op0.getOperand(1) == Op.getOperand(1);
58335
58334
})) {
58336
- return DAG.getNode(Op0.getOpcode() , DL, VT,
58337
- ConcatSubOperand(VT, Ops, 0), Op0.getOperand(1));
58335
+ return DAG.getNode(Opcode , DL, VT, ConcatSubOperand(VT, Ops, 0) ,
58336
+ Op0.getOperand(1));
58338
58337
}
58339
58338
break;
58340
58339
case ISD::AND:
@@ -58346,15 +58345,15 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
58346
58345
(VT.is512BitVector() && Subtarget.useAVX512Regs()))) {
58347
58346
// Don't concatenate root AVX1 NOT patterns.
58348
58347
// TODO: Allow NOT folding if Concat0 succeeds.
58349
- if (Op0.getOpcode() == ISD::XOR && Depth == 0 &&
58350
- !Subtarget.hasInt256() && llvm::all_of(Ops, [](SDValue X) {
58348
+ if (Opcode == ISD::XOR && Depth == 0 && !Subtarget.hasInt256() &&
58349
+ llvm::all_of(Ops, [](SDValue X) {
58351
58350
return ISD::isBuildVectorAllOnes(X.getOperand(1).getNode());
58352
58351
}))
58353
58352
break;
58354
58353
SDValue Concat0 = CombineSubOperand(VT, Ops, 0);
58355
58354
SDValue Concat1 = CombineSubOperand(VT, Ops, 1);
58356
58355
if (Concat0 || Concat1 || Subtarget.hasInt256())
58357
- return DAG.getNode(Op0.getOpcode() , DL, VT,
58356
+ return DAG.getNode(Opcode , DL, VT,
58358
58357
Concat0 ? Concat0 : ConcatSubOperand(VT, Ops, 0),
58359
58358
Concat1 ? Concat1 : ConcatSubOperand(VT, Ops, 1));
58360
58359
}
@@ -58366,7 +58365,7 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
58366
58365
SDValue Concat0 = CombineSubOperand(VT, Ops, 0);
58367
58366
SDValue Concat1 = CombineSubOperand(VT, Ops, 1);
58368
58367
if (Concat0 || Concat1)
58369
- return DAG.getNode(Op0.getOpcode() , DL, VT,
58368
+ return DAG.getNode(Opcode , DL, VT,
58370
58369
Concat0 ? Concat0 : ConcatSubOperand(VT, Ops, 0),
58371
58370
Concat1 ? Concat1 : ConcatSubOperand(VT, Ops, 1));
58372
58371
break;
@@ -58388,9 +58387,9 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
58388
58387
}
58389
58388
58390
58389
ISD::CondCode ICC =
58391
- Op0.getOpcode() == X86ISD::PCMPEQ ? ISD::SETEQ : ISD::SETGT;
58390
+ Opcode == X86ISD::PCMPEQ ? ISD::SETEQ : ISD::SETGT;
58392
58391
ISD::CondCode FCC =
58393
- Op0.getOpcode() == X86ISD::PCMPEQ ? ISD::SETOEQ : ISD::SETOGT;
58392
+ Opcode == X86ISD::PCMPEQ ? ISD::SETOEQ : ISD::SETOGT;
58394
58393
58395
58394
MVT FpSVT = MVT::getFloatingPointVT(EltSizeInBits);
58396
58395
MVT FpVT = VT.changeVectorElementType(FpSVT);
@@ -58420,8 +58419,7 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
58420
58419
case ISD::CTLZ_ZERO_UNDEF:
58421
58420
if (!IsSplat && ((VT.is256BitVector() && Subtarget.hasInt256()) ||
58422
58421
(VT.is512BitVector() && Subtarget.useBWIRegs()))) {
58423
- return DAG.getNode(Op0.getOpcode(), DL, VT,
58424
- ConcatSubOperand(VT, Ops, 0));
58422
+ return DAG.getNode(Opcode, DL, VT, ConcatSubOperand(VT, Ops, 0));
58425
58423
}
58426
58424
break;
58427
58425
case X86ISD::GF2P8AFFINEQB:
@@ -58432,8 +58430,7 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
58432
58430
llvm::all_of(Ops, [Op0](SDValue Op) {
58433
58431
return Op0.getOperand(2) == Op.getOperand(2);
58434
58432
})) {
58435
- return DAG.getNode(Op0.getOpcode(), DL, VT,
58436
- ConcatSubOperand(VT, Ops, 0),
58433
+ return DAG.getNode(Opcode, DL, VT, ConcatSubOperand(VT, Ops, 0),
58437
58434
ConcatSubOperand(VT, Ops, 1), Op0.getOperand(2));
58438
58435
}
58439
58436
break;
@@ -58447,7 +58444,7 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
58447
58444
SDValue Concat0 = CombineSubOperand(VT, Ops, 0);
58448
58445
SDValue Concat1 = CombineSubOperand(VT, Ops, 1);
58449
58446
if (Concat0 || Concat1)
58450
- return DAG.getNode(Op0.getOpcode() , DL, VT,
58447
+ return DAG.getNode(Opcode , DL, VT,
58451
58448
Concat0 ? Concat0 : ConcatSubOperand(VT, Ops, 0),
58452
58449
Concat1 ? Concat1 : ConcatSubOperand(VT, Ops, 1));
58453
58450
}
@@ -58463,7 +58460,7 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
58463
58460
SDValue Concat0 = CombineSubOperand(VT, Ops, 0);
58464
58461
SDValue Concat1 = CombineSubOperand(VT, Ops, 1);
58465
58462
if (Concat0 || Concat1)
58466
- return DAG.getNode(Op0.getOpcode() , DL, VT,
58463
+ return DAG.getNode(Opcode , DL, VT,
58467
58464
Concat0 ? Concat0 : ConcatSubOperand(VT, Ops, 0),
58468
58465
Concat1 ? Concat1 : ConcatSubOperand(VT, Ops, 1));
58469
58466
}
@@ -58472,8 +58469,7 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
58472
58469
case ISD::FDIV:
58473
58470
if (!IsSplat && (VT.is256BitVector() ||
58474
58471
(VT.is512BitVector() && Subtarget.useAVX512Regs()))) {
58475
- return DAG.getNode(Op0.getOpcode(), DL, VT,
58476
- ConcatSubOperand(VT, Ops, 0),
58472
+ return DAG.getNode(Opcode, DL, VT, ConcatSubOperand(VT, Ops, 0),
58477
58473
ConcatSubOperand(VT, Ops, 1));
58478
58474
}
58479
58475
break;
@@ -58486,7 +58482,7 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
58486
58482
SDValue Concat0 = CombineSubOperand(VT, Ops, 0);
58487
58483
SDValue Concat1 = CombineSubOperand(VT, Ops, 1);
58488
58484
if (Concat0 || Concat1)
58489
- return DAG.getNode(Op0.getOpcode() , DL, VT,
58485
+ return DAG.getNode(Opcode , DL, VT,
58490
58486
Concat0 ? Concat0 : ConcatSubOperand(VT, Ops, 0),
58491
58487
Concat1 ? Concat1 : ConcatSubOperand(VT, Ops, 1));
58492
58488
}
@@ -58502,7 +58498,7 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
58502
58498
SDValue Concat1 = CombineSubOperand(SrcVT, Ops, 1);
58503
58499
if (Concat0 || Concat1)
58504
58500
return DAG.getNode(
58505
- Op0.getOpcode() , DL, VT,
58501
+ Opcode , DL, VT,
58506
58502
Concat0 ? Concat0 : ConcatSubOperand(SrcVT, Ops, 0),
58507
58503
Concat1 ? Concat1 : ConcatSubOperand(SrcVT, Ops, 1));
58508
58504
}
@@ -58517,7 +58513,7 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
58517
58513
SDValue Concat0 = CombineSubOperand(VT, Ops, 0);
58518
58514
SDValue Concat1 = CombineSubOperand(VT, Ops, 1);
58519
58515
if (Concat0 || Concat1)
58520
- return DAG.getNode(Op0.getOpcode() , DL, VT,
58516
+ return DAG.getNode(Opcode , DL, VT,
58521
58517
Concat0 ? Concat0 : ConcatSubOperand(VT, Ops, 0),
58522
58518
Concat1 ? Concat1 : ConcatSubOperand(VT, Ops, 1),
58523
58519
Op0.getOperand(2));
@@ -58535,7 +58531,7 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
58535
58531
APInt Mask = getBLENDIBlendMask(Ops[0]).zext(NumElts);
58536
58532
Mask.insertBits(getBLENDIBlendMask(Ops[1]), NumElts / 2);
58537
58533
Mask = Mask.zextOrTrunc(8);
58538
- return DAG.getNode(Op0.getOpcode() , DL, VT,
58534
+ return DAG.getNode(Opcode , DL, VT,
58539
58535
Concat0 ? Concat0 : ConcatSubOperand(VT, Ops, 0),
58540
58536
Concat1 ? Concat1 : ConcatSubOperand(VT, Ops, 1),
58541
58537
DAG.getTargetConstant(Mask, DL, MVT::i8));
@@ -58573,25 +58569,23 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
58573
58569
SelVT = EVT::getVectorVT(Ctx, MVT::i1,
58574
58570
NumOps * SelVT.getVectorNumElements());
58575
58571
if (TLI.isTypeLegal(SelVT))
58576
- return DAG.getNode(Op0.getOpcode(), DL, VT,
58577
- ConcatSubOperand(SelVT.getSimpleVT(), Ops, 0),
58578
- ConcatSubOperand(VT, Ops, 1),
58579
- ConcatSubOperand(VT, Ops, 2));
58572
+ return DAG.getNode(
58573
+ Opcode, DL, VT, ConcatSubOperand(SelVT.getSimpleVT(), Ops, 0),
58574
+ ConcatSubOperand(VT, Ops, 1), ConcatSubOperand(VT, Ops, 2));
58580
58575
}
58581
58576
}
58582
58577
[[fallthrough]];
58583
58578
case X86ISD::BLENDV:
58584
- // TODO: BLENDV should use CombineSubOperand.
58579
+ // TODO: BLENDV should use CombineSubOperand.
58585
58580
if (!IsSplat && VT.is256BitVector() && NumOps == 2 &&
58586
58581
(EltSizeInBits >= 32 || Subtarget.hasInt256()) &&
58587
58582
IsConcatFree(VT, Ops, 1) && IsConcatFree(VT, Ops, 2)) {
58588
58583
EVT SelVT = Ops[0].getOperand(0).getValueType();
58589
58584
SelVT = SelVT.getDoubleNumVectorElementsVT(Ctx);
58590
58585
if (TLI.isTypeLegal(SelVT))
58591
- return DAG.getNode(Op0.getOpcode(), DL, VT,
58592
- ConcatSubOperand(SelVT.getSimpleVT(), Ops, 0),
58593
- ConcatSubOperand(VT, Ops, 1),
58594
- ConcatSubOperand(VT, Ops, 2));
58586
+ return DAG.getNode(
58587
+ Opcode, DL, VT, ConcatSubOperand(SelVT.getSimpleVT(), Ops, 0),
58588
+ ConcatSubOperand(VT, Ops, 1), ConcatSubOperand(VT, Ops, 2));
58595
58589
}
58596
58590
break;
58597
58591
}
0 commit comments