@@ -2778,10 +2778,7 @@ BasicBlock *InnerLoopVectorizer::createVectorizedLoopSkeleton(
2778
2778
}
2779
2779
2780
2780
static bool isValueIncomingFromBlock(BasicBlock *ExitingBB, Value *V,
2781
- Instruction *UI) {
2782
- PHINode *PHI = dyn_cast<PHINode>(UI);
2783
- assert(PHI && "Expected LCSSA form");
2784
-
2781
+ PHINode *PHI) {
2785
2782
// If this loop has an uncountable early exit then there could be
2786
2783
// different users of OrigPhi with either:
2787
2784
// 1. Multiple users, because each exiting block (countable or
@@ -2821,7 +2818,7 @@ void InnerLoopVectorizer::fixupIVUsers(PHINode *OrigPhi,
2821
2818
for (User *U : PostInc->users()) {
2822
2819
Instruction *UI = cast<Instruction>(U);
2823
2820
if (!OrigLoop->contains(UI)) {
2824
- if (isValueIncomingFromBlock(OrigLoopLatch, PostInc, UI ))
2821
+ if (isValueIncomingFromBlock(OrigLoopLatch, PostInc, cast<PHINode>(UI) ))
2825
2822
MissingVals[cast<PHINode>(UI)] = EndValue;
2826
2823
}
2827
2824
}
@@ -2832,7 +2829,7 @@ void InnerLoopVectorizer::fixupIVUsers(PHINode *OrigPhi,
2832
2829
for (User *U : OrigPhi->users()) {
2833
2830
auto *UI = cast<Instruction>(U);
2834
2831
if (!OrigLoop->contains(UI)) {
2835
- if (!isValueIncomingFromBlock(OrigLoopLatch, OrigPhi, UI ))
2832
+ if (!isValueIncomingFromBlock(OrigLoopLatch, OrigPhi, cast<PHINode>(UI) ))
2836
2833
continue;
2837
2834
IRBuilder<> B(MiddleBlock->getTerminator());
2838
2835
0 commit comments