Skip to content

Commit d4baf61

Browse files
committed
[X86] combineConcatVectorOps - add outstanding TODOs for missing op concatenation cases. NFC.
Keep track of the remaining issues - many of these are inter-related making them difficult to deal with one at a time.
1 parent 0aa5ba4 commit d4baf61

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58013,6 +58013,7 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
5801358013
break;
5801458014
}
5801558015
case X86ISD::VBROADCAST: {
58016+
// TODO: 512-bit VBROADCAST concatenation.
5801658017
if (!IsSplat && llvm::all_of(Ops, [](SDValue Op) {
5801758018
return Op.getOperand(0).getValueType().is128BitVector();
5801858019
})) {
@@ -58039,7 +58040,7 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
5803958040
break;
5804058041
}
5804158042
case X86ISD::SHUFP: {
58042-
// Add SHUFPD support if/when necessary.
58043+
// TODO: Add SHUFPD support if/when necessary.
5804358044
if (!IsSplat &&
5804458045
(VT == MVT::v8f32 ||
5804558046
(VT == MVT::v16f32 && Subtarget.useAVX512Regs())) &&
@@ -58058,6 +58059,7 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
5805858059
}
5805958060
case X86ISD::UNPCKH:
5806058061
case X86ISD::UNPCKL: {
58062+
// TODO: UNPCK should use CombineSubOperand
5806158063
// Don't concatenate build_vector patterns.
5806258064
if (!IsSplat && EltSizeInBits >= 32 &&
5806358065
((VT.is256BitVector() && Subtarget.hasInt256()) ||
@@ -58077,6 +58079,7 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
5807758079
case X86ISD::PSHUFHW:
5807858080
case X86ISD::PSHUFLW:
5807958081
case X86ISD::PSHUFD:
58082+
// TODO: 512-bit PSHUFD/LW/HW handling
5808058083
if (!IsSplat && NumOps == 2 && VT.is256BitVector() &&
5808158084
Subtarget.hasInt256() && llvm::all_of(Ops, [Op0](SDValue Op) {
5808258085
return Op.getOperand(1) == Op0.getOperand(1);
@@ -58098,6 +58101,7 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
5809858101
DAG.getNode(X86ISD::VPERMILPI, DL, FloatVT, Res, Op0.getOperand(1));
5809958102
return DAG.getBitcast(VT, Res);
5810058103
}
58104+
// TODO: v8f64 VPERMILPI concatenation.
5810158105
if (!IsSplat && NumOps == 2 && VT == MVT::v4f64) {
5810258106
uint64_t Idx0 = Ops[0].getConstantOperandVal(1);
5810358107
uint64_t Idx1 = Ops[1].getConstantOperandVal(1);
@@ -58259,7 +58263,7 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
5825958263
case ISD::ANY_EXTEND_VECTOR_INREG:
5826058264
case ISD::SIGN_EXTEND_VECTOR_INREG:
5826158265
case ISD::ZERO_EXTEND_VECTOR_INREG: {
58262-
// TODO: Handle ANY_EXTEND combos with SIGN/ZERO_EXTEND.
58266+
// TODO: Handle ANY_EXTEND_INREG combos with SIGN/ZERO_EXTEND_INREG.
5826358267
if (!IsSplat && NumOps == 2 &&
5826458268
((VT.is256BitVector() && Subtarget.hasInt256()) ||
5826558269
(VT.is512BitVector() && Subtarget.useAVX512Regs() &&
@@ -58285,7 +58289,6 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
5828558289
case X86ISD::VSHLI:
5828658290
case X86ISD::VSRLI:
5828758291
// Special case: SHL/SRL AVX1 V4i64 by 32-bits can lower as a shuffle.
58288-
// TODO: Move this to LowerShiftByScalarImmediate?
5828958292
if (VT == MVT::v4i64 && !Subtarget.hasInt256() &&
5829058293
llvm::all_of(Ops, [](SDValue Op) {
5829158294
return Op.getConstantOperandAPInt(1) == 32;
@@ -58319,6 +58322,7 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
5831958322
case X86ISD::VPERMI:
5832058323
case X86ISD::VROTLI:
5832158324
case X86ISD::VROTRI:
58325+
// TODO: 256-bit VROT?I handling
5832258326
if (VT.is512BitVector() && Subtarget.useAVX512Regs() &&
5832358327
llvm::all_of(Ops, [Op0](SDValue Op) {
5832458328
return Op0.getOperand(1) == Op.getOperand(1);
@@ -58335,6 +58339,7 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
5833558339
if (!IsSplat && (VT.is256BitVector() ||
5833658340
(VT.is512BitVector() && Subtarget.useAVX512Regs()))) {
5833758341
// Don't concatenate root AVX1 NOT patterns.
58342+
// TODO: Allow NOT folding if Concat0 succeeds.
5833858343
if (Op0.getOpcode() == ISD::XOR && Depth == 0 &&
5833958344
!Subtarget.hasInt256() && llvm::all_of(Ops, [](SDValue X) {
5834058345
return ISD::isBuildVectorAllOnes(X.getOperand(1).getNode());
@@ -58350,6 +58355,7 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
5835058355
break;
5835158356
case X86ISD::PCMPEQ:
5835258357
case X86ISD::PCMPGT:
58358+
// TODO: 512-bit PCMPEQ/PCMPGT -> VPCMP+VPMOVM2 handling.
5835358359
if (!IsSplat && VT.is256BitVector() && Subtarget.hasInt256()) {
5835458360
SDValue Concat0 = CombineSubOperand(VT, Ops, 0);
5835558361
SDValue Concat1 = CombineSubOperand(VT, Ops, 1);
@@ -58413,6 +58419,7 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
5841358419
}
5841458420
break;
5841558421
case X86ISD::GF2P8AFFINEQB:
58422+
// TODO: GF2P8AFFINEQB should use CombineSubOperand.
5841658423
if (!IsSplat &&
5841758424
(VT.is256BitVector() ||
5841858425
(VT.is512BitVector() && Subtarget.useAVX512Regs())) &&
@@ -58427,6 +58434,7 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
5842758434
case ISD::ADD:
5842858435
case ISD::SUB:
5842958436
case ISD::MUL:
58437+
// TODO: Add more integer binops?
5843058438
if (!IsSplat && ((VT.is256BitVector() && Subtarget.hasInt256()) ||
5843158439
(VT.is512BitVector() && Subtarget.useAVX512Regs() &&
5843258440
(EltSizeInBits >= 32 || Subtarget.useBWIRegs())))) {
@@ -58549,6 +58557,7 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
5854958557
}
5855058558
break;
5855158559
case ISD::VSELECT:
58560+
// TODO: VSELECT should use CombineSubOperand.
5855258561
if (!IsSplat && Subtarget.hasAVX512() &&
5855358562
(VT.is256BitVector() ||
5855458563
(VT.is512BitVector() && Subtarget.useAVX512Regs())) &&
@@ -58566,6 +58575,7 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
5856658575
}
5856758576
[[fallthrough]];
5856858577
case X86ISD::BLENDV:
58578+
// TODO: BLENDV should use CombineSubOperand.
5856958579
if (!IsSplat && VT.is256BitVector() && NumOps == 2 &&
5857058580
(EltSizeInBits >= 32 || Subtarget.hasInt256()) &&
5857158581
IsConcatFree(VT, Ops, 1) && IsConcatFree(VT, Ops, 2)) {

0 commit comments

Comments
 (0)