Skip to content

Commit fc077d8

Browse files
committed
[VPlanVerifier] Add comment for new EVL check
1 parent 9368948 commit fc077d8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,8 @@ bool VPlanVerifier::verifyEVLRecipe(const VPInstruction &EVL) const {
166166
if (all_of(VEPRs, [&EVL](VPUser *U) {
167167
auto *VEPR = cast<VPVectorEndPointerRecipe>(U);
168168
return match(VEPR->getOffset(),
169-
m_c_Mul(m_VPValue(), m_Sub(m_Specific(&EVL), m_One())));
169+
m_c_Mul(m_SpecificSInt(VEPR->getStride()),
170+
m_Sub(m_Specific(&EVL), m_One())));
170171
}))
171172
return true;
172173
errs() << "Expected VectorEndPointer with EVL operand\n";
@@ -196,6 +197,10 @@ bool VPlanVerifier::verifyEVLRecipe(const VPInstruction &EVL) const {
196197
I->getOpcode() == Instruction::ICmp)
197198
return VerifyEVLUse(*I, 1);
198199
if (I->getOpcode() == Instruction::Sub) {
200+
// If Sub has a single user that's a SingleDefRecipe (which is
201+
// exepcted to be a Mul), filter its users, in turn, to get
202+
// VectorEndPointerRecipes, and verify that all the offsets match
203+
// (EVL - 1) * Stride.
199204
auto *VPI =
200205
dyn_cast_if_present<VPSingleDefRecipe>(I->getSingleUser());
201206
if (VPI) {

0 commit comments

Comments
 (0)