Skip to content

Commit 7823ef8

Browse files
fhahnyuxuanchen1997
authored andcommitted
[LV] Assert uniform recipes don't get predicated for when vectorizing.
Summary: Add assertion ensuring invariant on construction, split off as suggested from #98892. Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: https://phabricator.intern.facebook.com/D60250783
1 parent 6bd291b commit 7823ef8

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)