As far as I can tell, LoopVectorize preserves SCEV, mainly by dint
of forgetting the loop being vectorized. We should mark it as
preserved in the pass manager.
This is a very small compile-time improvement.
Differential Revision: https://reviews.llvm.org/D149147
if (!EnableVPlanNativePath) {
PA.preserve<LoopAnalysis>();
PA.preserve<DominatorTreeAnalysis>();
+ PA.preserve<ScalarEvolutionAnalysis>();
+
+#ifdef EXPENSIVE_CHECKS
+ SE.verify();
+#endif
}
if (Result.MadeCFGChange) {
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