Skip to content

Commit 7c4ef67

Browse files
committed
[VPlan] Update hasEarlyExit check to consider no-exit block case
If we call this API during vectorization without any exit blocks, we need to first check there is atleast one exit block. PR: #145730
1 parent d386b3b commit 7c4ef67

File tree

1 file changed

+2
-1
lines changed
  • llvm/lib/Transforms/Vectorize

1 file changed

+2
-1
lines changed

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4183,7 +4183,8 @@ class VPlan {
41834183
/// block with multiple predecessors (one for the exit via the latch and one
41844184
/// via the other early exit).
41854185
bool hasEarlyExit() const {
4186-
return ExitBlocks.size() > 1 || ExitBlocks[0]->getNumPredecessors() > 1;
4186+
return ExitBlocks.size() > 1 ||
4187+
(ExitBlocks.size() == 1 && ExitBlocks[0]->getNumPredecessors() > 1);
41874188
}
41884189

41894190
/// Returns true if the scalar tail may execute after the vector loop. Note

0 commit comments

Comments
 (0)