Skip to content

Commit 3717776

Browse files
committed
[LV] Assert uniform recipes don't get predicated for when vectorizing.
Add assertion ensuring invariant on construction, split off as suggested from #98892.
1 parent 06ab30b commit 3717776

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8578,6 +8578,12 @@ VPReplicateRecipe *VPRecipeBuilder::handleReplication(Instruction *I,
85788578
BlockInMask = getBlockInMask(I->getParent());
85798579
}
85808580

8581+
// Note that there is some custom logic to mark some intrinsics as uniform
8582+
// manually above for scalable vectors, which this assert needs to account for
8583+
// as well.
8584+
assert((Range.Start.isScalar() || !IsUniform || !IsPredicated ||
8585+
(Range.Start.isScalable() && isa<IntrinsicInst>(I))) &&
8586+
"Should not predicate a uniform recipe");
85818587
auto *Recipe = new VPReplicateRecipe(I, mapToVPValues(I->operands()),
85828588
IsUniform, BlockInMask);
85838589
return Recipe;

0 commit comments

Comments
 (0)