diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -10610,6 +10610,11 @@ if (!EnableVPlanNativePath) { PA.preserve(); PA.preserve(); + PA.preserve(); + +#ifdef EXPENSIVE_CHECKS + SE.verify(); +#endif } if (Result.MadeCFGChange) { diff --git a/llvm/test/Transforms/LoopVectorize/novect-lcssa-cfg-invalidation.ll b/llvm/test/Transforms/LoopVectorize/novect-lcssa-cfg-invalidation.ll --- a/llvm/test/Transforms/LoopVectorize/novect-lcssa-cfg-invalidation.ll +++ b/llvm/test/Transforms/LoopVectorize/novect-lcssa-cfg-invalidation.ll @@ -8,7 +8,7 @@ define i32 @novect(ptr %p) { ; CHECK: Running pass: LoopVectorizePass on novect -; CHECK: Invalidating analysis: ScalarEvolutionAnalysis on novect +; CHECK-NOT: Invalidating analysis: ScalarEvolutionAnalysis on novect ; CHECK-NOT: Invalidating analysis: BranchProbabilityAnalysis on novect ; CHECK-NOT: Invalidating analysis: BlockFrequencyAnalysis on novect ; CHECK: Invalidating analysis: DemandedBitsAnalysis on novect