@@ -2778,10 +2778,7 @@ BasicBlock *InnerLoopVectorizer::createVectorizedLoopSkeleton(
27782778}
27792779
27802780static 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) {
27852782 // If this loop has an uncountable early exit then there could be
27862783 // different users of OrigPhi with either:
27872784 // 1. Multiple users, because each exiting block (countable or
@@ -2821,7 +2818,7 @@ void InnerLoopVectorizer::fixupIVUsers(PHINode *OrigPhi,
28212818 for (User *U : PostInc->users ()) {
28222819 Instruction *UI = cast<Instruction>(U);
28232820 if (!OrigLoop->contains (UI)) {
2824- if (isValueIncomingFromBlock (OrigLoopLatch, PostInc, UI ))
2821+ if (isValueIncomingFromBlock (OrigLoopLatch, PostInc, cast<PHINode>(UI) ))
28252822 MissingVals[cast<PHINode>(UI)] = EndValue;
28262823 }
28272824 }
@@ -2832,7 +2829,7 @@ void InnerLoopVectorizer::fixupIVUsers(PHINode *OrigPhi,
28322829 for (User *U : OrigPhi->users ()) {
28332830 auto *UI = cast<Instruction>(U);
28342831 if (!OrigLoop->contains (UI)) {
2835- if (!isValueIncomingFromBlock (OrigLoopLatch, OrigPhi, UI ))
2832+ if (!isValueIncomingFromBlock (OrigLoopLatch, OrigPhi, cast<PHINode>(UI) ))
28362833 continue ;
28372834 IRBuilder<> B (MiddleBlock->getTerminator ());
28382835
0 commit comments