[llvm] 1e7d047 - [VPlan] Mark LoopInfo preserved in native-path as well (NFC).
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Fri May 17 04:18:16 PDT 2024
Author: Florian Hahn
Date: 2024-05-17T12:18:01+01:00
New Revision: 1e7d047c71ce0a8076f774b9106cd7a499a1c542
URL: https://github.com/llvm/llvm-project/commit/1e7d047c71ce0a8076f774b9106cd7a499a1c542
DIFF: https://github.com/llvm/llvm-project/commit/1e7d047c71ce0a8076f774b9106cd7a499a1c542.diff
LOG: [VPlan] Mark LoopInfo preserved in native-path as well (NFC).
LoopInfo is updated during VPlan execution now, so it will also be
updated correctly in the native path.
Added:
Modified:
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
llvm/test/Transforms/LoopVectorize/outer_loop_test1.ll
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index f2a541f5167a0..fd652cb789549 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -10390,15 +10390,15 @@ PreservedAnalyses LoopVectorizePass::run(Function &F,
RemoveRedundantDbgInstrs(&BB);
}
- // We currently do not preserve loopinfo/dominator analyses with outer loop
+ // We currently do not preserve dominator analyses with outer loop
// vectorization. Until this is addressed, mark these analyses as preserved
// only for non-VPlan-native path.
- // TODO: Preserve Loop and Dominator analyses for VPlan-native path.
+ // TODO: Preserve Dominator analysis for VPlan-native path.
if (!EnableVPlanNativePath) {
- PA.preserve<LoopAnalysis>();
PA.preserve<DominatorTreeAnalysis>();
PA.preserve<ScalarEvolutionAnalysis>();
}
+ PA.preserve<LoopAnalysis>();
if (Result.MadeCFGChange) {
// Making CFG changes likely means a loop got vectorized. Indicate that
diff --git a/llvm/test/Transforms/LoopVectorize/outer_loop_test1.ll b/llvm/test/Transforms/LoopVectorize/outer_loop_test1.ll
index 4294212ecb747..3b5811d2c9f01 100644
--- a/llvm/test/Transforms/LoopVectorize/outer_loop_test1.ll
+++ b/llvm/test/Transforms/LoopVectorize/outer_loop_test1.ll
@@ -13,7 +13,7 @@
; }
; }
;
-; RUN: opt -S -passes=loop-vectorize -enable-vplan-native-path < %s | FileCheck %s
+; RUN: opt -S -passes=loop-vectorize -enable-vplan-native-path -verify-loop-info < %s | FileCheck %s
; CHECK-LABEL: vector.ph:
; CHECK: %[[SplatVal:.*]] = insertelement <4 x i32> poison, i32 %n, i64 0
; CHECK: %[[Splat:.*]] = shufflevector <4 x i32> %[[SplatVal]], <4 x i32> poison, <4 x i32> zeroinitializer
More information about the llvm-commits
mailing list