1 ! Test the MLIR pass pipeline
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
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
12 ! ALL: Pass statistics report
14 ! ALL: Fortran::lower::VerifierPass
16 ! Ideally, we need an output with only the pass names, but
17 ! there is currently no way to get that, so in order to
18 ! guarantee that the passes are in the expected order
19 ! (i.e. use -NEXT) we have to check the statistics output as well.
20 ! ALL-NEXT: (S) 0 num-cse'd - Number of operations CSE'd
21 ! ALL-NEXT: (S) 0 num-dce'd - Number of operations DCE'd
23 ! ALL-NEXT: 'func.func' Pipeline
24 ! ALL-NEXT: ArrayValueCopy
25 ! ALL-NEXT: CharacterConversion
27 ! ALL-NEXT: Canonicalizer
28 ! ALL-NEXT: SimplifyRegionLite
29 ! O2-NEXT: SimplifyIntrinsics
30 ! O2-NEXT: AlgebraicSimplification
32 ! ALL-NEXT: (S) 0 num-cse'd - Number of operations CSE'd
33 ! ALL-NEXT: (S) 0 num-dce'd - Number of operations DCE'd
35 ! ALL-NEXT: 'func.func' Pipeline
36 ! ALL-NEXT: MemoryAllocationOpt
39 ! ALL-NEXT: SimplifyRegionLite
41 ! ALL-NEXT: (S) 0 num-cse'd - Number of operations CSE'd
42 ! ALL-NEXT: (S) 0 num-dce'd - Number of operations DCE'd
44 ! ALL-NEXT: 'func.func' Pipeline
45 ! ALL-NEXT: CFGConversion
47 ! ALL-NEXT: SCFToControlFlow
48 ! ALL-NEXT: Canonicalizer
49 ! ALL-NEXT: SimplifyRegionLite
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 ! ALL-NEXT: BoxedProcedurePass
55 ! ALL-NEXT: Pipeline Collection : ['fir.global', 'func.func']
56 ! ALL-NEXT: 'fir.global' Pipeline
57 ! ALL-NEXT: AbstractResultOnGlobalOpt
58 ! ALL-NEXT: 'func.func' Pipeline
59 ! ALL-NEXT: AbstractResultOnFuncOpt
61 ! ALL-NEXT: CodeGenRewrite
62 ! ALL-NEXT: (S) 0 num-dce'd - Number of operations eliminated
63 ! ALL-NEXT: TargetRewrite
64 ! ALL-NEXT: ExternalNameConversion
65 ! ALL-NEXT: FIRToLLVMLowering
66 ! ALL-NOT: LLVMIRLoweringPass