Skip to content

Commit 0e7f187

Browse files
committed
[LV] Relax assertion in fixupIVUsers (NFC).
Adjust the assertion in fixupIVUsers to only require a unique exit block if there are any values to fix up. This enables the bring up of multi-exit loop vectorization without requiring a scalar epilogue. Split off as suggested from #112138.
1 parent d44518c commit 0e7f187

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2823,8 +2823,6 @@ void InnerLoopVectorizer::fixupIVUsers(PHINode *OrigPhi,
28232823
// value (the value that feeds into the phi from the loop latch).
28242824
// We allow both, but they, obviously, have different values.
28252825

2826-
assert(OrigLoop->getUniqueExitBlock() && "Expected a single exit block");
2827-
28282826
DenseMap<Value *, Value *> MissingVals;
28292827

28302828
Value *EndValue = cast<PHINode>(OrigPhi->getIncomingValueForBlock(
@@ -2878,6 +2876,9 @@ void InnerLoopVectorizer::fixupIVUsers(PHINode *OrigPhi,
28782876
}
28792877
}
28802878

2879+
assert((MissingVals.empty() || OrigLoop->getUniqueExitBlock()) &&
2880+
"Expected a single exit block for escaping values");
2881+
28812882
for (auto &I : MissingVals) {
28822883
PHINode *PHI = cast<PHINode>(I.first);
28832884
// One corner case we have to handle is two IVs "chasing" each-other,

0 commit comments

Comments
 (0)