Index: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp =================================================================== --- llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -2670,8 +2670,6 @@ // pointer operand of the interleaved access is supposed to be uniform. For // uniform instructions, we're only required to generate a value for the // first vector lane in each unroll iteration. - assert(!VF.isScalable() && - "scalable vector reverse operation is not implemented"); if (Group->isReverse()) Index += (VF.getKnownMinValue() - 1) * Group->getFactor(); @@ -2708,11 +2706,13 @@ Value *MaskForGaps = nullptr; if (Group->requiresScalarEpilogue() && !Cost->isScalarEpilogueAllowed()) { - assert(!VF.isScalable() && "scalable vectors not yet supported."); MaskForGaps = createBitMaskForGaps(Builder, VF.getKnownMinValue(), *Group); assert(MaskForGaps && "Mask for Gaps is required but it is null"); } + assert(((!MaskForGaps && !BlockInMask) || !VF.isScalable()) && + "Interleaving with masks not yet supported for scalable vectors"); + // Vectorize the interleaved load group. if (isa(Instr)) { // For each unroll part, create a wide load for the group. @@ -2725,7 +2725,6 @@ Value *GroupMask = MaskForGaps; if (BlockInMask) { Value *BlockInMaskPart = State.get(BlockInMask, Part); - assert(!VF.isScalable() && "scalable vectors not yet supported."); Value *ShuffledMask = Builder.CreateShuffleVector( BlockInMaskPart, createReplicatedMask(InterleaveFactor, VF.getKnownMinValue()), @@ -2756,7 +2755,6 @@ if (!Member) continue; - assert(!VF.isScalable() && "scalable vectors not yet supported."); auto StrideMask = createStrideMask(I, InterleaveFactor, VF.getKnownMinValue()); for (unsigned Part = 0; Part < UF; Part++) { @@ -2781,7 +2779,6 @@ } // The sub vector type for current instruction. - assert(!VF.isScalable() && "VF is assumed to be non scalable."); auto *SubVT = VectorType::get(ScalarTy, VF); // Vectorize the interleaved store group. @@ -2809,7 +2806,6 @@ Value *WideVec = concatenateVectors(Builder, StoredVecs); // Interleave the elements in the wide vector. - assert(!VF.isScalable() && "scalable vectors not yet supported."); Value *IVec = Builder.CreateShuffleVector( WideVec, createInterleaveMask(VF.getKnownMinValue(), InterleaveFactor), "interleaved.vec"); @@ -6764,7 +6760,9 @@ ElementCount VF) { assert(VF.isVector() && "Scalarization cost of instruction implies vectorization."); - assert(!VF.isScalable() && "scalable vectors not yet supported."); + if (VF.isScalable()) + return InstructionCost::getInvalid(); + Type *ValTy = getMemInstValueType(I); auto SE = PSE.getSE(); @@ -7189,8 +7187,7 @@ : InstructionCost::getInvalid(); InstructionCost ScalarizationCost = - !VF.isScalable() ? getMemInstScalarizationCost(&I, VF) * NumAccesses - : InstructionCost::getInvalid(); + getMemInstScalarizationCost(&I, VF) * NumAccesses; // Choose better solution for the current VF, // write down this decision and use it during vectorization.