Skip to content

Commit d35f56a

Browse files
committed
!fixup address latest comments, thanks!
1 parent 73dc257 commit d35f56a

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

llvm/lib/Transforms/Vectorize/VPlan.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -989,9 +989,11 @@ void VPlan::prepareToExecute(Value *TripCountV, Value *VectorTripCountV,
989989
}
990990

991991
VPIRBasicBlock *VPlan::getExitBlock(BasicBlock *IRBB) const {
992-
return *find_if(getExitBlocks(), [IRBB](const VPIRBasicBlock *VPIRBB) {
992+
auto Iter = find_if(getExitBlocks(), [IRBB](const VPIRBasicBlock *VPIRBB) {
993993
return VPIRBB->getIRBasicBlock() == IRBB;
994994
});
995+
assert(Iter != getExitBlocks().end() && "no exit block found");
996+
return *Iter;
995997
}
996998

997999
bool VPlan::isExitBlock(VPBlockBase *VPBB) {

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3427,8 +3427,8 @@ class VPlan {
34273427
VPIRBasicBlock *ScalarHeader;
34283428

34293429
/// Immutable list of VPIRBasicBlocks wrapping the exit blocks of the original
3430-
/// scalar loop. Note that some exit blocks may be unreachable, e.g. if the
3431-
/// scalar epilogue always executes
3430+
/// scalar loop. Note that some exit blocks may be unreachable at the moment,
3431+
/// e.g. if the scalar epilogue always executes.
34323432
SmallVector<VPIRBasicBlock *, 2> ExitBlocks;
34333433

34343434
/// Holds the VFs applicable to this VPlan.

0 commit comments

Comments
 (0)