Skip to content

Commit a9f036a

Browse files
committed
Address comments
1 parent 1e39b93 commit a9f036a

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
@@ -2402,14 +2402,13 @@ void VPlanTransforms::canonicalizeEVLLoops(VPlan &Plan) {
24022402
EVLPhi->eraseFromParent();
24032403

24042404
// Replace CanonicalIVInc with EVL-PHI increment.
2405-
VPRecipeBase *CanonicalIV = &*HeaderVPBB->begin();
2405+
auto *CanonicalIV = cast<VPPhi>(&*HeaderVPBB->begin());
24062406
assert(
2407-
isa<VPPhi>(CanonicalIV) &&
2408-
match(CanonicalIV->getOperand(1),
2407+
match(CanonicalIV->getIncomingValue(1),
24092408
m_c_Binary<Instruction::Add>(m_Specific(cast<VPPhi>(CanonicalIV)),
24102409
m_Specific(&Plan.getVFxUF()))) &&
2411-
"Unexpected canoincal iv");
2412-
VPValue *Backedge = CanonicalIV->getOperand(1);
2410+
"Unexpected canonical iv");
2411+
VPValue *Backedge = CanonicalIV->getIncomingValue(1);
24132412
Backedge->replaceAllUsesWith(EVLIncrement);
24142413

24152414
// 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
@@ -196,7 +196,7 @@ bool VPlanVerifier::verifyEVLRecipe(const VPInstruction &EVL) const {
196196
// EVLIVIncrement is only used by EVLIV & BranchOnCount.
197197
// Having more than two users is unexpected.
198198
if ((I->getNumUsers() != 1) &&
199-
(I->getNumUsers() != 2 || !any_of(I->users(), [&I](VPUser *U) {
199+
(I->getNumUsers() != 2 || none_of(I->users(), [&I](VPUser *U) {
200200
using namespace llvm::VPlanPatternMatch;
201201
return match(U, m_BranchOnCount(m_Specific(I), m_VPValue()));
202202
}))) {

0 commit comments

Comments
 (0)