Skip to content

Commit f6e3d4b

Browse files
committed
Address comments
1 parent 965d35b commit f6e3d4b

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2419,14 +2419,13 @@ void VPlanTransforms::canonicalizeEVLLoops(VPlan &Plan) {
24192419
EVLPhi->eraseFromParent();
24202420

24212421
// Replace CanonicalIVInc with EVL-PHI increment.
2422-
VPRecipeBase *CanonicalIV = &*HeaderVPBB->begin();
2422+
auto *CanonicalIV = cast<VPPhi>(&*HeaderVPBB->begin());
24232423
assert(
2424-
isa<VPPhi>(CanonicalIV) &&
2425-
match(CanonicalIV->getOperand(1),
2424+
match(CanonicalIV->getIncomingValue(1),
24262425
m_c_Binary<Instruction::Add>(m_Specific(cast<VPPhi>(CanonicalIV)),
24272426
m_Specific(&Plan.getVFxUF()))) &&
2428-
"Unexpected canoincal iv");
2429-
VPValue *Backedge = CanonicalIV->getOperand(1);
2427+
"Unexpected canonical iv");
2428+
VPValue *Backedge = CanonicalIV->getIncomingValue(1);
24302429
Backedge->replaceAllUsesWith(EVLIncrement);
24312430

24322431
// Remove unused phi and increment.

llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ bool VPlanVerifier::verifyEVLRecipe(const VPInstruction &EVL) const {
197197
// EVLIVIncrement is only used by EVLIV & BranchOnCount.
198198
// Having more than two users is unexpected.
199199
if ((I->getNumUsers() != 1) &&
200-
(I->getNumUsers() != 2 || !any_of(I->users(), [&I](VPUser *U) {
200+
(I->getNumUsers() != 2 || none_of(I->users(), [&I](VPUser *U) {
201201
using namespace llvm::VPlanPatternMatch;
202202
return match(U, m_BranchOnCount(m_Specific(I), m_VPValue()));
203203
}))) {

0 commit comments

Comments
 (0)