1 ; The IR below was crafted so as:
2 ; 1) To have a loop, so we create a loop pass manager
3 ; 2) To be "immutable" in the sense that no pass in the standard
4 ; pipeline will modify it.
5 ; Since no transformations take place, we don't expect any analyses
7 ; Any invalidation that shows up here is a bug, unless we started modifying
8 ; the IR, in which case we need to make it immutable harder.
10 ; RUN: opt -disable-verify -verify-analysis-invalidation=0 -debug-pass-manager \
11 ; RUN: -passes='default<O0>' -S %s 2>&1 \
12 ; RUN: | FileCheck %s --check-prefixes=CHECK,CHECK-DEFAULT,CHECK-CORO
13 ; RUN: opt -disable-verify -verify-analysis-invalidation=0 -debug-pass-manager -enable-matrix \
14 ; RUN: -passes='default<O0>' -S %s 2>&1 \
15 ; RUN: | FileCheck %s --check-prefixes=CHECK,CHECK-DEFAULT,CHECK-MATRIX,CHECK-CORO
16 ; RUN: opt -disable-verify -verify-analysis-invalidation=0 -debug-pass-manager -debug-info-for-profiling \
17 ; RUN: -passes='default<O0>' -S %s 2>&1 \
18 ; RUN: | FileCheck %s --check-prefixes=CHECK,CHECK-DIS,CHECK-CORO
19 ; RUN: opt -disable-verify -verify-analysis-invalidation=0 -debug-pass-manager \
20 ; RUN: -passes='thinlto-pre-link<O0>' -S %s 2>&1 \
21 ; RUN: | FileCheck %s --check-prefixes=CHECK,CHECK-DEFAULT,CHECK-PRE-LINK,CHECK-CORO
22 ; RUN: opt -disable-verify -verify-analysis-invalidation=0 -debug-pass-manager \
23 ; RUN: -passes='lto-pre-link<O0>' -S %s 2>&1 \
24 ; RUN: | FileCheck %s --check-prefixes=CHECK,CHECK-DEFAULT,CHECK-PRE-LINK,CHECK-CORO
25 ; RUN: opt -disable-verify -verify-analysis-invalidation=0 -debug-pass-manager \
26 ; RUN: -passes='thinlto<O0>' -S %s 2>&1 \
27 ; RUN: | FileCheck %s --check-prefixes=CHECK,CHECK-THINLTO
28 ; RUN: opt -disable-verify -verify-analysis-invalidation=0 -debug-pass-manager \
29 ; RUN: -passes='lto<O0>' -S %s 2>&1 \
30 ; RUN: | FileCheck %s --check-prefixes=CHECK,CHECK-LTO
32 ; CHECK-DIS: Running analysis: InnerAnalysisManagerProxy
33 ; CHECK-DIS-NEXT: Running pass: AddDiscriminatorsPass
34 ; CHECK-DIS-NEXT: Running pass: AlwaysInlinerPass
35 ; CHECK-DIS-NEXT: Running analysis: ProfileSummaryAnalysis
36 ; CHECK-DEFAULT: Running pass: AlwaysInlinerPass
37 ; CHECK-DEFAULT-NEXT: Running analysis: InnerAnalysisManagerProxy
38 ; CHECK-DEFAULT-NEXT: Running analysis: ProfileSummaryAnalysis
39 ; CHECK-MATRIX: Running pass: LowerMatrixIntrinsicsPass
40 ; CHECK-MATRIX-NEXT: Running analysis: TargetIRAnalysis
41 ; CHECK-CORO-NEXT: Running pass: CoroConditionalWrapper
42 ; CHECK-PRE-LINK: Running pass: CanonicalizeAliasesPass
43 ; CHECK-PRE-LINK-NEXT: Running pass: NameAnonGlobalPass
44 ; CHECK-THINLTO: Running pass: LowerTypeTestsPass
45 ; CHECK-THINLTO-NEXT: Running pass: EliminateAvailableExternallyPass
46 ; CHECK-THINLTO-NEXT: Running pass: GlobalDCEPass
47 ; CHECK-LTO: Running pass: CrossDSOCFIPass on [module]
48 ; CHECK-LTO-NEXT: Running pass: WholeProgramDevirtPass
49 ; CHECK-LTO-NEXT: Running analysis: InnerAnalysisManagerProxy
50 ; CHECK-LTO-NEXT: Running pass: LowerTypeTestsPass
51 ; CHECK-LTO-NEXT: Running pass: LowerTypeTestsPass
52 ; CHECK-CORO-NEXT: Running pass: AnnotationRemarksPass
53 ; CHECK-CORO-NEXT: Running analysis: TargetLibraryAnalysis
54 ; CHECK-LTO-NEXT: Running pass: AnnotationRemarksPass
55 ; CHECK-LTO-NEXT: Running analysis: TargetLibraryAnalysis
56 ; CHECK-NEXT: Running pass: PrintModulePass
58 ; Make sure we get the IR back out without changes when we print the module.
59 ; CHECK-LABEL: define void @foo(i32 %n) local_unnamed_addr {
61 ; CHECK-NEXT: br label %loop
63 ; CHECK-NEXT: %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
64 ; CHECK-NEXT: %iv.next = add i32 %iv, 1
65 ; CHECK-NEXT: tail call void @bar()
66 ; CHECK-NEXT: %cmp = icmp eq i32 %iv, %n
67 ; CHECK-NEXT: br i1 %cmp, label %exit, label %loop
69 ; CHECK-NEXT: ret void
73 declare void @bar() local_unnamed_addr
75 define void @foo(i32 %n) local_unnamed_addr {
79 %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
80 %iv.next = add i32 %iv, 1
82 %cmp = icmp eq i32 %iv, %n
83 br i1 %cmp, label %exit, label %loop