131 lines · plain
1! Test the debug pass pipeline2 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 %s4 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 %s6! 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 %s7! 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 %s8! 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 %s9! 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 %s10! 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 %s11! 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 %s12 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 %s14 15! REQUIRES: asserts16 17end program18 19! DEBUG-CONSTRUCT: warning: Unsupported debug option: constructor20! DEBUG-DIRECTIVES: warning: Unsupported debug option: line-directives-only21!22! DEBUG-ERR: error: invalid value 'invalid' in '-debug-info-kind=invalid'23! DEBUG-ERR-NOT: Pass statistics report24 25! ALL: Pass statistics report26! ALL: Fortran::lower::VerifierPass27 28! ALL: Pass statistics report29 30! ALL: Fortran::lower::VerifierPass31! ALL-NEXT: Pipeline Collection : ['fir.global', 'func.func', 'omp.declare_reduction', 'omp.private']32! ALL-NEXT: 'fir.global' Pipeline33! ALL-NEXT: InlineElementals34! ALL-NEXT: 'func.func' Pipeline35! ALL-NEXT: InlineElementals36! ALL-NEXT: 'omp.declare_reduction' Pipeline37! ALL-NEXT: InlineElementals38! ALL-NEXT: 'omp.private' Pipeline39! ALL-NEXT: InlineElementals40! ALL-NEXT: LowerHLFIROrderedAssignments41! ALL-NEXT: LowerHLFIRIntrinsics42! ALL-NEXT: BufferizeHLFIR43! ALL-NEXT: ConvertHLFIRtoFIR44! ALL-NEXT: CSE45! Ideally, we need an output with only the pass names, but46! there is currently no way to get that, so in order to47! guarantee that the passes are in the expected order48! (i.e. use -NEXT) we have to check the statistics output as well.49! ALL-NEXT: (S) 0 num-cse'd - Number of operations CSE'd50! ALL-NEXT: (S) 0 num-dce'd - Number of operations DCE'd51 52! ALL-NEXT: Pipeline Collection : ['fir.global', 'func.func', 'omp.declare_reduction', 'omp.private']53! ALL-NEXT: 'fir.global' Pipeline54! ALL-NEXT: CharacterConversion55! ALL-NEXT: 'func.func' Pipeline56! ALL-NEXT: ArrayValueCopy57! ALL-NEXT: CharacterConversion58! ALL-NEXT: 'omp.declare_reduction' Pipeline59! ALL-NEXT: CharacterConversion60! ALL-NEXT: 'omp.private' Pipeline61! ALL-NEXT: CharacterConversion62 63! ALL-NEXT: Canonicalizer64! ALL-NEXT: SimplifyRegionLite65! ALL-NEXT: CSE66! ALL-NEXT: (S) 0 num-cse'd - Number of operations CSE'd67! ALL-NEXT: (S) 0 num-dce'd - Number of operations DCE'd68 69! ALL-NEXT: 'func.func' Pipeline70! ALL-NEXT: MemoryAllocationOpt71 72! ALL-NEXT: Inliner73! ALL-NEXT: SimplifyRegionLite74! ALL-NEXT: CSE75! ALL-NEXT: (S) 0 num-cse'd - Number of operations CSE'd76! ALL-NEXT: (S) 0 num-dce'd - Number of operations DCE'd77 78! ALL-NEXT: PolymorphicOpConversion79! ALL-NEXT: AssumedRankOpConversion80! ALL-NEXT: LowerRepackArraysPass81! ALL-NEXT: SimplifyFIROperations82 83! ALL-NEXT: Pipeline Collection : ['fir.global', 'func.func', 'omp.declare_reduction', 'omp.private']84! ALL-NEXT: 'fir.global' Pipeline85! ALL-NEXT: StackReclaim86! ALL-NEXT: CFGConversion87! ALL-NEXT: 'func.func' Pipeline88! ALL-NEXT: StackReclaim89! ALL-NEXT: CFGConversion90! ALL-NEXT: 'omp.declare_reduction' Pipeline91! ALL-NEXT: StackReclaim92! ALL-NEXT: CFGConversion93! ALL-NEXT: 'omp.private' Pipeline94! ALL-NEXT: StackReclaim95! ALL-NEXT: CFGConversion96! ALL-NEXT: SCFToControlFlow97! ALL-NEXT: Canonicalizer98! ALL-NEXT: SimplifyRegionLite99! ALL-NEXT: ConvertComplexPow100! ALL-NEXT: CSE101! ALL-NEXT: (S) 0 num-cse'd - Number of operations CSE'd102! ALL-NEXT: (S) 0 num-dce'd - Number of operations DCE'd103! ALL-NEXT: MIFOpConversion104! ALL-NEXT: BoxedProcedurePass105 106! ALL-NEXT: Pipeline Collection : ['fir.global', 'func.func', 'gpu.module', 'omp.declare_reduction', 'omp.private']107! ALL-NEXT: 'fir.global' Pipeline108! ALL-NEXT: AbstractResultOpt109! ALL-NEXT: 'func.func' Pipeline110! ALL-NEXT: AbstractResultOpt111! ALL-NEXT: 'gpu.module' Pipeline112! ALL-NEXT: Pipeline Collection : ['func.func', 'gpu.func']113! ALL-NEXT: 'func.func' Pipeline114! ALL-NEXT: AbstractResultOpt115! ALL-NEXT: 'gpu.func' Pipeline116! ALL-NEXT: AbstractResultOpt117! ALL-NEXT: 'omp.declare_reduction' Pipeline118! ALL-NEXT: AbstractResultOpt119! ALL-NEXT: 'omp.private' Pipeline120! ALL-NEXT: AbstractResultOpt121 122! ALL-NEXT: CodeGenRewrite123! ALL-NEXT: (S) 0 num-dce'd - Number of operations eliminated124! ALL-NEXT: ExternalNameConversion125! DEBUG-NEXT: AddDebugInfo126! NO-DEBUG-NOT: AddDebugInfo127! ALL-NEXT: TargetRewrite128! ALL-NEXT: CompilerGeneratedNamesConversion129! ALL: FIRToLLVMLowering130! ALL-NOT: LLVMIRLoweringPass131