diff --git a/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp b/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp --- a/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp @@ -1125,7 +1125,7 @@ // extract the value within that BB because we cannot insert any non-PHI // instructions in the BB. for (auto *Pred : PN->blocks()) - if (isa(Pred->getFirstNonPHI())) + if (Pred->getFirstInsertionPt() == Pred->end()) return nullptr; for (User *U : PN->users()) {