Re-land [openmp] Fix warnings when building on Windows with latest MSVC or Clang...
[llvm-project.git] / llvm / test / Other / time-passes.ll
blobfd73fe2fd243d4059762c1c658beebcda7c0a00b
1 ; RUN: opt < %s -disable-output -passes='default<O2>' -time-passes 2>&1 | FileCheck %s --check-prefix=TIME
3 ; For new pass manager, check that -time-passes-per-run emit one report for each pass run.
4 ; RUN: opt < %s -disable-output -passes='coro-cleanup,function(instcombine,instcombine,loop-mssa(licm))' -time-passes-per-run 2>&1 | FileCheck %s --check-prefix=TIME --check-prefix=TIME-PER-RUN --check-prefix=TIME-PER-RUN-CORO
5 ; RUN: opt < %s -disable-output -passes='instcombine,loop-mssa(licm),instcombine,loop-mssa(licm)' -time-passes-per-run 2>&1 | FileCheck %s --check-prefix=TIME --check-prefix=TIME-PER-RUN -check-prefix=TIME-DOUBLE-LICM
7 ; For new pass manager, check that -time-passes emit one report for each pass.
8 ; RUN: opt < %s -disable-output -passes='coro-cleanup,function(instcombine,instcombine,loop-mssa(licm))' -time-passes 2>&1 | FileCheck %s --check-prefixes=TIME,TIME-PER-PASS,TIME-PER-PASS-CORO
9 ; RUN: opt < %s -disable-output -passes='instcombine,loop-mssa(licm),instcombine,loop-mssa(licm)' -time-passes 2>&1 | FileCheck %s --check-prefixes=TIME,TIME-PER-PASS
11 ; The following 2 test runs verify -info-output-file interaction (default goes to stderr, '-' goes to stdout).
12 ; RUN: opt < %s -disable-output -passes='default<O2>' -time-passes -info-output-file='-' 2>/dev/null | FileCheck %s --check-prefix=TIME
14 ; RUN: rm -f %t; opt < %s -disable-output -passes='default<O2>' -time-passes -info-output-file=%t
15 ; RUN:   cat %t | FileCheck %s --check-prefix=TIME
17 ; TIME: Pass execution timing report
18 ; TIME: Total Execution Time:
19 ; TIME: Name
20 ; TIME-PER-RUN-DAG:      InstCombinePass #1
21 ; TIME-PER-RUN-DAG:      InstCombinePass #2
22 ; TIME-PER-RUN-DAG:      InstCombinePass #3
23 ; TIME-PER-RUN-DAG:      InstCombinePass #4
24 ; TIME-PER-RUN-DAG:      LICMPass #1
25 ; TIME-PER-RUN-DAG:      LICMPass #2
26 ; TIME-PER-RUN-DAG:      LICMPass #3
27 ; TIME-DOUBLE-LICM-DAG:      LICMPass #4
28 ; TIME-DOUBLE-LICM-DAG:      LICMPass #5
29 ; TIME-DOUBLE-LICM-DAG:      LICMPass #6
30 ; TIME-PER-RUN-DAG:      LCSSAPass
31 ; TIME-PER-RUN-DAG:      LoopSimplifyPass
32 ; TIME-PER-RUN-DAG:      VerifierPass
33 ; TIME-PER-RUN-CORO-DAG:     SimplifyCFGPass #1
34 ; TIME-PER-RUN-CORO-DAG:     CoroCleanupPass #1
35 ; TIME-PER-PASS-DAG:   InstCombinePass
36 ; TIME-PER-PASS-DAG:   LICMPass
37 ; TIME-PER-PASS-DAG:   LCSSAPass
38 ; TIME-PER-PASS-DAG:   LoopSimplifyPass
39 ; TIME-PER-PASS-DAG:   VerifierPass
40 ; TIME-PER-PASS-CORO-DAG:    SimplifyCFGPass
41 ; TIME-PER-PASS-CORO-DAG:    CoroCleanupPass
42 ; TIME-PER-PASS-NOT:   InstCombinePass #
43 ; TIME-PER-PASS-NOT:   LICMPass #
44 ; TIME-PER-PASS-NOT:   LCSSAPass #
45 ; TIME-PER-PASS-NOT:   LoopSimplifyPass #
46 ; TIME-PER-PASS-NOT:   VerifierPass #
47 ; TIME: Total{{$}}
49 ; TIME: Analysis execution timing report
50 ; TIME: Total Execution Time:
51 ; TIME: Name
52 ; TIME-PER-RUN-DAG:      ScalarEvolutionAnalysis
53 ; TIME-PER-RUN-DAG:      LoopAnalysis
54 ; TIME-PER-RUN-DAG:      DominatorTreeAnalysis
55 ; TIME-PER-RUN-DAG:      TargetLibraryAnalysis
56 ; TIME-PER-PASS-DAG:   ScalarEvolutionAnalysis
57 ; TIME-PER-PASS-DAG:   LoopAnalysis
58 ; TIME-PER-PASS-DAG:   DominatorTreeAnalysis
59 ; TIME-PER-PASS-DAG:   TargetLibraryAnalysis
60 ; TIME-PER-PASS-NOT:   ScalarEvolutionAnalysis #
61 ; TIME-PER-PASS-NOT:   LoopAnalysis #
62 ; TIME-PER-PASS-NOT:   DominatorTreeAnalysis #
63 ; TIME-PER-PASS-NOT:   TargetLibraryAnalysis #
64 ; TIME: Total{{$}}
66 define i32 @foo() {
67   %res = add i32 5, 4
68   br label %loop1
69 loop1:
70   br i1 false, label %loop1, label %end
71 end:
72   ret i32 %res
75 define void @bar_with_loops() {
76   br label %loop1
77 loop1:
78   br i1 false, label %loop1, label %loop2
79 loop2:
80   br i1 true, label %loop2, label %end
81 end:
82   ret void
86 define void @baz_coro() {
87   %unused = call ptr @llvm.coro.begin(token none, ptr null)
88   ret void
91 declare ptr @llvm.coro.begin(token, ptr)