Debian Codegraph @

flang/test/Driver/mlir-pass-pipeline.f90

raw
1 ! Test the MLIR pass pipeline
2
3 ! RUN: %flang_fc1 -S -mmlir --mlir-pass-statistics -mmlir --mlir-pass-statistics-display=pipeline -o /dev/null %s 2>&1 | FileCheck --check-prefixes=ALL %s
4 ! -O0 is the default:
5 ! RUN: %flang_fc1 -S -mmlir --mlir-pass-statistics -mmlir --mlir-pass-statistics-display=pipeline %s -O0 -o /dev/null 2>&1 | FileCheck --check-prefixes=ALL %s
6 ! RUN: %flang_fc1 -S -mmlir --mlir-pass-statistics -mmlir --mlir-pass-statistics-display=pipeline %s -O2 -o /dev/null 2>&1 | FileCheck --check-prefixes=ALL,O2 %s
7
8 ! REQUIRES: asserts
9
10 end program
11
12 ! ALL: Pass statistics report
13
14 ! ALL: Fortran::lower::VerifierPass
15 ! O2-NEXT: Canonicalizer
16 ! ALL: Pipeline Collection : ['fir.global', 'func.func', 'omp.declare_reduction', 'omp.private']
17 ! ALL-NEXT:'fir.global' Pipeline
18 ! O2-NEXT: SimplifyHLFIRIntrinsics
19 ! ALL: InlineElementals
20 ! ALL-NEXT:'func.func' Pipeline
21 ! O2-NEXT: SimplifyHLFIRIntrinsics
22 ! ALL: InlineElementals
23 ! ALL-NEXT:'omp.declare_reduction' Pipeline
24 ! O2-NEXT: SimplifyHLFIRIntrinsics
25 ! ALL: InlineElementals
26 ! ALL-NEXT:'omp.private' Pipeline
27 ! O2-NEXT: SimplifyHLFIRIntrinsics
28 ! ALL: InlineElementals
29 ! O2-NEXT: Canonicalizer
30 ! O2-NEXT: CSE
31 ! O2-NEXT: (S) {{.*}} num-cse'd
32 ! O2-NEXT: (S) {{.*}} num-dce'd
33 ! O2-NEXT: Pipeline Collection : ['fir.global', 'func.func', 'omp.declare_reduction', 'omp.private']
34 ! O2-NEXT: 'fir.global' Pipeline
35 ! O2-NEXT: OptimizedBufferization
36 ! O2-NEXT: 'func.func' Pipeline
37 ! O2-NEXT: OptimizedBufferization
38 ! O2-NEXT: 'omp.declare_reduction' Pipeline
39 ! O2-NEXT: OptimizedBufferization
40 ! O2-NEXT: 'omp.private' Pipeline
41 ! O2-NEXT: OptimizedBufferization
42 ! ALL: LowerHLFIROrderedAssignments
43 ! ALL-NEXT: LowerHLFIRIntrinsics
44 ! ALL-NEXT: BufferizeHLFIR
45 ! ALL-NEXT: ConvertHLFIRtoFIR
46 ! ALL-NEXT: CSE
47 ! Ideally, we need an output with only the pass names, but
48 ! there is currently no way to get that, so in order to
49 ! guarantee that the passes are in the expected order
50 ! (i.e. use -NEXT) we have to check the statistics output as well.
51 ! ALL-NEXT: (S) 0 num-cse'd - Number of operations CSE'd
52 ! ALL-NEXT: (S) 0 num-dce'd - Number of operations DCE'd
53
54 ! ALL-NEXT: Pipeline Collection : ['fir.global', 'func.func', 'omp.declare_reduction', 'omp.private']
55 ! ALL-NEXT: 'fir.global' Pipeline
56 ! ALL-NEXT: CharacterConversion
57 ! ALL-NEXT: 'func.func' Pipeline
58 ! ALL-NEXT: ArrayValueCopy
59 ! ALL-NEXT: CharacterConversion
60 ! ALL-NEXT: 'omp.declare_reduction' Pipeline
61 ! ALL-NEXT: CharacterConversion
62 ! ALL-NEXT: 'omp.private' Pipeline
63 ! ALL-NEXT: CharacterConversion
64
65 ! ALL-NEXT: Canonicalizer
66 ! ALL-NEXT: SimplifyRegionLite
67 ! O2-NEXT: SimplifyIntrinsics
68 ! O2-NEXT: AlgebraicSimplification
69 ! ALL-NEXT: CSE
70 ! ALL-NEXT: (S) 0 num-cse'd - Number of operations CSE'd
71 ! ALL-NEXT: (S) 0 num-dce'd - Number of operations DCE'd
72
73 ! ALL-NEXT: 'func.func' Pipeline
74 ! ALL-NEXT: MemoryAllocationOpt
75
76 ! ALL-NEXT: Inliner
77 ! ALL-NEXT: SimplifyRegionLite
78 ! ALL-NEXT: CSE
79 ! ALL-NEXT: (S) 0 num-cse'd - Number of operations CSE'd
80 ! ALL-NEXT: (S) 0 num-dce'd - Number of operations DCE'd
81
82 ! ALL-NEXT: PolymorphicOpConversion
83 ! ALL-NEXT: AssumedRankOpConversion
84 ! O2-NEXT: AddAliasTags
85
86 ! ALL-NEXT: Pipeline Collection : ['fir.global', 'func.func', 'omp.declare_reduction', 'omp.private']
87 ! ALL-NEXT: 'fir.global' Pipeline
88 ! ALL-NEXT: StackReclaim
89 ! ALL-NEXT: CFGConversion
90 ! ALL-NEXT: 'func.func' Pipeline
91 ! ALL-NEXT: StackReclaim
92 ! ALL-NEXT: CFGConversion
93 ! ALL-NEXT: 'omp.declare_reduction' Pipeline
94 ! ALL-NEXT: StackReclaim
95 ! ALL-NEXT: CFGConversion
96 ! ALL-NEXT: 'omp.private' Pipeline
97 ! ALL-NEXT: StackReclaim
98 ! ALL-NEXT: CFGConversion
99
100 ! ALL-NEXT: SCFToControlFlow
101 ! ALL-NEXT: Canonicalizer
102 ! ALL-NEXT: SimplifyRegionLite
103 ! ALL-NEXT: CSE
104 ! ALL-NEXT: (S) 0 num-cse'd - Number of operations CSE'd
105 ! ALL-NEXT: (S) 0 num-dce'd - Number of operations DCE'd
106 ! ALL-NEXT: BoxedProcedurePass
107
108 ! ALL-NEXT: Pipeline Collection : ['fir.global', 'func.func', 'omp.declare_reduction', 'omp.private']
109 ! ALL-NEXT: 'fir.global' Pipeline
110 ! ALL-NEXT: AbstractResultOpt
111 ! ALL-NEXT: 'func.func' Pipeline
112 ! ALL-NEXT: AbstractResultOpt
113 ! ALL-NEXT: 'omp.declare_reduction' Pipeline
114 ! ALL-NEXT: AbstractResultOpt
115 ! ALL-NEXT: 'omp.private' Pipeline
116 ! ALL-NEXT: AbstractResultOpt
117
118 ! ALL-NEXT: CodeGenRewrite
119 ! ALL-NEXT: (S) 0 num-dce'd - Number of operations eliminated
120 ! ALL-NEXT: TargetRewrite
121 ! ALL-NEXT: ExternalNameConversion
122 ! ALL-NEXT: FIRToLLVMLowering
123 ! ALL-NOT: LLVMIRLoweringPass