1 ;RUN: opt %s -passes='adce,loop(rotate),adce' -S -debug-pass-manager -debug-only=loop-rotate 2>&1 | FileCheck %s
4 ; This test is to make sure we invalidate the post dominator pass after loop rotate simplifies the loop latch.
5 ; The adce passes are here to make sure post dominator analysis is required.
7 ; CHECK: Starting llvm::Function pass manager run.
8 ; CHECK-NEXT: Running pass: ADCEPass on f
9 ; CHECK-NEXT: Running analysis: PostDominatorTreeAnalysis on f
10 ; CHECK-NEXT: Running pass: FunctionToLoopPassAdaptor{{.*}} on f
11 ; CHECK-NEXT: Starting llvm::Function pass manager run.
12 ; CHECK-NEXT: Running pass: LoopSimplifyPass on f
13 ; CHECK-NEXT: Running analysis: LoopAnalysis on f
14 ; CHECK-NEXT: Running analysis: DominatorTreeAnalysis on f
15 ; CHECK-NEXT: Running analysis: AssumptionAnalysis on f
16 ; CHECK-NEXT: Running pass: LCSSAPass on f
17 ; CHECK-NEXT: Finished llvm::Function pass manager run.
18 ; CHECK-NEXT: Running analysis: AAManager on f
19 ; CHECK-NEXT: Running analysis: TargetLibraryAnalysis on f
20 ; CHECK-NEXT: Running analysis: ScalarEvolutionAnalysis on f
21 ; CHECK-NEXT: Running analysis: TargetIRAnalysis on f
22 ; CHECK-NEXT: Running analysis: InnerAnalysisManagerProxy{{.*}} on f
23 ; CHECK-NEXT: Starting Loop pass manager run.
24 ; CHECK-NEXT: Running pass: LoopRotatePass on Loop at depth 1 containing: %bb<header><exiting>,%bb4<latch>
25 ; CHECK-NEXT: Folding loop latch bb4 into bb
26 ; CHECK-NEXT: Invalidating all non-preserved analyses for: bb
27 ; CHECK-NEXT: Finished Loop pass manager run.
28 ; CHECK-NEXT: Invalidating all non-preserved analyses for: f
29 ; CHECK-NEXT: Invalidating analysis: PostDominatorTreeAnalysis on f
30 ; CHECK-NEXT: Running pass: ADCEPass on f
31 ; CHECK-NEXT: Running analysis: PostDominatorTreeAnalysis on f
32 ; CHECK-NEXT: Finished llvm::Function pass manager run.
34 ; CHECK-LABEL: define i8 @f() {
36 ; CHECK-NEXT : br label %bb
38 ; CHECK-NEXT : bb: ; preds = %bb, %entry
39 ; CHECK-NEXT : %mode.0 = phi i8 [ 0, %entry ], [ %indvar.next, %bb ]
40 ; CHECK-NEXT : %tmp5 = icmp eq i8 %mode.0, 1
41 ; CHECK-NEXT : %indvar.next = add i8 %mode.0, 1
42 ; CHECK-NEXT : br i1 %tmp5, label %bb5, label %bb
44 ; CHECK-NEXT : bb5: ; preds = %bb
45 ; CHECK-NEXT : tail call void @raise_exception() #0
46 ; CHECK-NEXT : unreachable
49 ; CHECK-NEXT : ; Function Attrs: noreturn
50 ; CHECK-NEXT : declare void @raise_exception() #0
52 ; CHECK-NEXT : attributes #0 = { noreturn }
58 bb: ; preds = %bb4, %entry
59 %mode.0 = phi i8 [ 0, %entry ], [ %indvar.next, %bb4 ]
60 %tmp5 = icmp eq i8 %mode.0, 1
61 br i1 %tmp5, label %bb5, label %bb4
64 %indvar.next = add i8 %mode.0, 1
68 tail call void @raise_exception() #0
72 ; Function Attrs: noreturn
73 declare void @raise_exception() #0
75 attributes #0 = { noreturn }