From: Nikita Popov Date: Tue, 25 Apr 2023 10:20:52 +0000 (+0200) Subject: [LoopVectorize] Preserve SCEV X-Git-Tag: upstream/17.0.6~10391 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1745341296495bf50203122cfcc3c4996871590c;p=platform%2Fupstream%2Fllvm.git [LoopVectorize] Preserve SCEV 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 --- diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index 645b62d..c9fd816 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -10610,6 +10610,11 @@ PreservedAnalyses LoopVectorizePass::run(Function &F, 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 index 24bcfe0..c78e005 100644 --- a/llvm/test/Transforms/LoopVectorize/novect-lcssa-cfg-invalidation.ll +++ b/llvm/test/Transforms/LoopVectorize/novect-lcssa-cfg-invalidation.ll @@ -8,7 +8,7 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 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