diff --git a/lib/Transforms/Vectorize/LoopVectorize.cpp b/lib/Transforms/Vectorize/LoopVectorize.cpp index 7e3a8ead04a..6c1800d2141 100644 --- a/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -6119,6 +6119,12 @@ bool LoopVectorizationCostModel::isCandidateForEpilogueVectorization( })) return false; + // Epilogue vectorization code has not been auditted to ensure it handles + // non-latch exits properly. It may be fine, but it needs auditted and + // tested. + if (L.getExitingBlock() != L.getLoopLatch()) + return false; + return true; }