Skip to content

Commit 1e7d047

Browse files
committed
[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.
1 parent ddb87e0 commit 1e7d047

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -10390,15 +10390,15 @@ PreservedAnalyses LoopVectorizePass::run(Function &F,
1039010390
RemoveRedundantDbgInstrs(&BB);
1039110391
}
1039210392

10393-
// We currently do not preserve loopinfo/dominator analyses with outer loop
10393+
// We currently do not preserve dominator analyses with outer loop
1039410394
// vectorization. Until this is addressed, mark these analyses as preserved
1039510395
// only for non-VPlan-native path.
10396-
// TODO: Preserve Loop and Dominator analyses for VPlan-native path.
10396+
// TODO: Preserve Dominator analysis for VPlan-native path.
1039710397
if (!EnableVPlanNativePath) {
10398-
PA.preserve<LoopAnalysis>();
1039910398
PA.preserve<DominatorTreeAnalysis>();
1040010399
PA.preserve<ScalarEvolutionAnalysis>();
1040110400
}
10401+
PA.preserve<LoopAnalysis>();
1040210402

1040310403
if (Result.MadeCFGChange) {
1040410404
// Making CFG changes likely means a loop got vectorized. Indicate that

llvm/test/Transforms/LoopVectorize/outer_loop_test1.ll

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
; }
1414
; }
1515
;
16-
; RUN: opt -S -passes=loop-vectorize -enable-vplan-native-path < %s | FileCheck %s
16+
; RUN: opt -S -passes=loop-vectorize -enable-vplan-native-path -verify-loop-info < %s | FileCheck %s
1717
; CHECK-LABEL: vector.ph:
1818
; CHECK: %[[SplatVal:.*]] = insertelement <4 x i32> poison, i32 %n, i64 0
1919
; CHECK: %[[Splat:.*]] = shufflevector <4 x i32> %[[SplatVal]], <4 x i32> poison, <4 x i32> zeroinitializer

0 commit comments

Comments
 (0)