[llvm] [CodeGen] Expand unsupported (de)interleave intrinsics (PR #207439)
Luke Lau via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 14 00:07:17 PDT 2026
================
@@ -13027,34 +12976,44 @@ void SelectionDAGBuilder::visitVectorReverse(const CallInst &I) {
void SelectionDAGBuilder::visitVectorDeinterleave(const CallInst &I,
unsigned Factor) {
auto DL = getCurSDLoc();
+ const TargetLowering &TLI = DAG.getTargetLoweringInfo();
SDValue InVec = getValue(I.getOperand(0));
+ EVT InVT = InVec.getValueType();
SmallVector<EVT, 4> ValueVTs;
- ComputeValueVTs(DAG.getTargetLoweringInfo(), DAG.getDataLayout(), I.getType(),
- ValueVTs);
+ ComputeValueVTs(TLI, DAG.getDataLayout(), I.getType(), ValueVTs);
EVT OutVT = ValueVTs[0];
unsigned OutNumElts = OutVT.getVectorMinNumElements();
- SmallVector<SDValue, 4> SubVecs(Factor);
- for (unsigned i = 0; i != Factor; ++i) {
- assert(ValueVTs[i] == OutVT && "Expected VTs to be the same");
- SubVecs[i] = DAG.getNode(ISD::EXTRACT_SUBVECTOR, DL, OutVT, InVec,
- DAG.getVectorIdxConstant(OutNumElts * i, DL));
- }
-
- // Use VECTOR_SHUFFLE for fixed-length vectors with factor of 2 to benefit
- // from existing legalisation and combines.
- if (OutVT.isFixedLengthVector() && Factor == 2) {
- SDValue Even = DAG.getVectorShuffle(OutVT, DL, SubVecs[0], SubVecs[1],
- createStrideMask(0, 2, OutNumElts));
- SDValue Odd = DAG.getVectorShuffle(OutVT, DL, SubVecs[0], SubVecs[1],
- createStrideMask(1, 2, OutNumElts));
- SDValue Res = DAG.getMergeValues({Even, Odd}, getCurSDLoc());
- setValue(&I, Res);
+ // Use VECTOR_SHUFFLE for fixed-length vectors that the target does not lower
----------------
lukel97 wrote:
Do these regressions show up in this PR or in another PR built on top of this?
https://github.com/llvm/llvm-project/pull/207439
More information about the llvm-commits
mailing list