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