1 ;RUN: opt %s -aa-pipeline= -passes='adce,loop(loop-rotate),adce' -S -verify-analysis-invalidation=0 -debug-pass-manager -debug-only=loop-rotate 2>&1 | FileCheck %s
2 ;RUN: opt %s -aa-pipeline= -passes='adce,loop-mssa(loop-rotate),adce' -S -verify-analysis-invalidation=0 -debug-pass-manager -debug-only=loop-rotate -verify-memoryssa 2>&1 | FileCheck %s --check-prefix=MSSA
5 ; This test is to make sure we invalidate the post dominator pass after loop rotate simplifies the loop latch.
6 ; The adce passes are here to make sure post dominator analysis is required.
8 ; CHECK: Running pass: ADCEPass on f
9 ; CHECK-NEXT: Running analysis: PostDominatorTreeAnalysis on f
10 ; CHECK-NEXT: Running pass: LoopSimplifyPass on f
11 ; CHECK-NEXT: Running analysis: LoopAnalysis on f
12 ; CHECK-NEXT: Running analysis: DominatorTreeAnalysis on f
13 ; CHECK-NEXT: Running analysis: AssumptionAnalysis on f
14 ; CHECK-NEXT: Running analysis: TargetIRAnalysis on f
15 ; CHECK-NEXT: Running pass: LCSSAPass on f
16 ; CHECK-NEXT: Running analysis: AAManager on f
17 ; CHECK-NEXT: Running analysis: TargetLibraryAnalysis on f
18 ; CHECK-NEXT: Running analysis: ScalarEvolutionAnalysis on f
19 ; CHECK-NEXT: Running analysis: InnerAnalysisManagerProxy{{.*}} on f
20 ; CHECK-NEXT: Running pass: LoopRotatePass on loop %bb in function f
21 ; CHECK-NEXT: Folding loop latch bb4 into bb
22 ; CHECK-NEXT: Invalidating analysis: PostDominatorTreeAnalysis on f
23 ; CHECK-NEXT: Running pass: ADCEPass on f
24 ; CHECK-NEXT: Running analysis: PostDominatorTreeAnalysis on f
26 ; MSSA: Running pass: ADCEPass on f
27 ; MSSA-NEXT: Running analysis: PostDominatorTreeAnalysis on f
28 ; MSSA-NEXT: Running pass: LoopSimplifyPass on f
29 ; MSSA-NEXT: Running analysis: LoopAnalysis on f
30 ; MSSA-NEXT: Running analysis: DominatorTreeAnalysis on f
31 ; MSSA-NEXT: Running analysis: AssumptionAnalysis on f
32 ; MSSA-NEXT: Running analysis: TargetIRAnalysis on f
33 ; MSSA-NEXT: Running pass: LCSSAPass on f
34 ; MSSA-NEXT: Running analysis: MemorySSAAnalysis on f
35 ; MSSA-NEXT: Running analysis: AAManager on f
36 ; MSSA-NEXT: Running analysis: TargetLibraryAnalysis on f
37 ; MSSA-NEXT: Running analysis: ScalarEvolutionAnalysis on f
38 ; MSSA-NEXT: Running analysis: InnerAnalysisManagerProxy{{.*}} on f
39 ; MSSA-NEXT: Running pass: LoopRotatePass on loop %bb in function f
40 ; MSSA-NEXT: Folding loop latch bb4 into bb
41 ; MSSA-NEXT: Invalidating analysis: PostDominatorTreeAnalysis on f
42 ; MSSA-NEXT: Running pass: ADCEPass on f
43 ; MSSA-NEXT: Running analysis: PostDominatorTreeAnalysis on f
45 ; CHECK-LABEL: define i8 @f() {
47 ; CHECK-NEXT: br label %bb
48 ; CHECK: bb: ; preds = %bb, %entry
49 ; CHECK-NEXT: %mode.0 = phi i8 [ 0, %entry ], [ %indvar.next, %bb ]
50 ; CHECK-NEXT: %tmp5 = icmp eq i8 %mode.0, 1
51 ; CHECK-NEXT: %indvar.next = add i8 %mode.0, 1
52 ; CHECK-NEXT: br i1 %tmp5, label %bb5, label %bb
53 ; CHECK: bb5: ; preds = %bb
54 ; CHECK-NEXT: tail call void @raise_exception() #0
55 ; CHECK-NEXT: unreachable
57 ; CHECK: ; Function Attrs: noreturn
58 ; CHECK: declare void @raise_exception() #0
59 ; CHECK: attributes #0 = { noreturn }
61 ; MSSA-LABEL: define i8 @f() {
63 ; MSSA-NEXT: br label %bb
64 ; MSSA: bb: ; preds = %bb, %entry
65 ; MSSA-NEXT: %mode.0 = phi i8 [ 0, %entry ], [ %indvar.next, %bb ]
66 ; MSSA-NEXT: %tmp5 = icmp eq i8 %mode.0, 1
67 ; MSSA-NEXT: %indvar.next = add i8 %mode.0, 1
68 ; MSSA-NEXT: br i1 %tmp5, label %bb5, label %bb
69 ; MSSA: bb5: ; preds = %bb
70 ; MSSA-NEXT: tail call void @raise_exception() #0
71 ; MSSA-NEXT: unreachable
73 ; MSSA: ; Function Attrs: noreturn
74 ; MSSA: declare void @raise_exception() #0
75 ; MSSA: attributes #0 = { noreturn }
81 bb: ; preds = %bb4, %entry
82 %mode.0 = phi i8 [ 0, %entry ], [ %indvar.next, %bb4 ]
83 %tmp5 = icmp eq i8 %mode.0, 1
84 br i1 %tmp5, label %bb5, label %bb4
87 %indvar.next = add i8 %mode.0, 1
91 tail call void @raise_exception() #0
95 ; Function Attrs: noreturn
96 declare void @raise_exception() #0
98 attributes #0 = { noreturn }