diff --git a/llvm/lib/Transforms/Vectorize/VPlan.cpp b/llvm/lib/Transforms/Vectorize/VPlan.cpp index 85fd34d79be4..a6e807b616ce 100644 --- a/llvm/lib/Transforms/Vectorize/VPlan.cpp +++ b/llvm/lib/Transforms/Vectorize/VPlan.cpp @@ -921,7 +921,7 @@ VPIRBasicBlock *VPlan::getExitBlock(BasicBlock *IRBB) const { } bool VPlan::isExitBlock(VPBlockBase *VPBB) { - return isa(VPBB) && VPBB->getNumSuccessors() == 0; + return is_contained(ExitBlocks, VPBB); } /// Generate the code inside the preheader and body of the vectorized loop.