Skip to content

Commit d12dbae

Browse files
committed
Address review comment
* Updated comments around calls to getSymbolicMaxBackedgeTakenCount
1 parent d8c2e12 commit d12dbae

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4054,9 +4054,10 @@ LoopVectorizationCostModel::computeMaxVF(ElementCount UserVF, unsigned UserIC) {
40544054
unsigned MaxVFtimesIC =
40554055
UserIC ? *MaxPowerOf2RuntimeVF * UserIC : *MaxPowerOf2RuntimeVF;
40564056
ScalarEvolution *SE = PSE.getSE();
4057-
// Currently only loops with countable exits are vectorized so it's safe to
4058-
// use getSymbolicMaxBackedgeTakenCount as it should give the same result
4059-
// as getBackedgeTakenCount.
4057+
// Currently only loops with countable exits are vectorized, but calling
4058+
// getSymbolicMaxBackedgeTakenCount allows enablement work for loops with
4059+
// uncountable exits whilst also ensuring the symbolic maximum and known
4060+
// back-edge taken count remain identical for loops with countable exits.
40604061
const SCEV *BackedgeTakenCount = PSE.getSymbolicMaxBackedgeTakenCount();
40614062
assert(!isa<SCEVCouldNotCompute>(BackedgeTakenCount) &&
40624063
"Invalid loop count");

llvm/lib/Transforms/Vectorize/VPlan.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -881,9 +881,10 @@ VPlanPtr VPlan::createInitialVPlan(Type *InductionTy,
881881

882882
// Create SCEV and VPValue for the trip count.
883883

884-
// Using getSymbolicMaxBackedgeTakenCount instead of getBackedgeTakenCount,
885-
// since they should be identical as we currently only vectorize loops when
886-
// all exits are countable.
884+
// Currently only loops with countable exits are vectorized, but calling
885+
// getSymbolicMaxBackedgeTakenCount allows enablement work for loops with
886+
// uncountable exits whilst also ensuring the symbolic maximum and known
887+
// back-edge taken count remain identical for loops with countable exits.
887888
const SCEV *BackedgeTakenCountSCEV = PSE.getSymbolicMaxBackedgeTakenCount();
888889
assert(!isa<SCEVCouldNotCompute>(BackedgeTakenCountSCEV) &&
889890
"Invalid loop count");

0 commit comments

Comments
 (0)