1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00
llvm-mirror/test/CodeGen/AArch64/arm64-opt-remarks-lazy-bfi.ll
Daniel Sanders bb3b320019 Add -debugify-and-strip-all to add debug info before a pass and remove it after
Summary:
This allows us to test each backend pass under the presence
of debug info using pre-existing tests. The tests should not
fail as a result of this so long as it's true that debug info
does not affect CodeGen.

In practice, a few tests are sensitive to this:
* Tests that check the pass structure (e.g. O0-pipeline.ll)
* Tests that check --debug output. Specifically instruction
  dumps containing MMO's (e.g. prelegalizercombiner-extends.ll)
* Tests that contain debugify metadata as mir-strip-debug will
  remove it (e.g. fastisel-debugvalue-undef.ll)
* Tests with partial debug info (e.g.
  patchable-function-entry-empty.mir had debug info but no
  !llvm.dbg.cu)
* Tests that check optimization remarks overly strictly (e.g.
  prologue-epilogue-remarks.mir)
* Tests that would inject the pass in an unsafe region (e.g.
  seqpairspill.mir would inject between register alloc and
  virt reg rewriter)
In all cases, the checks can either be updated or
--debugify-and-strip-all-safe=0 can be used to avoid being
affected by something like llvm-lit -Dllc='llc --debugify-and-strip-all-safe'

I tested this without the lost debug locations verifier to
confirm that AArch64 behaviour is unaffected (with the fixes
in this patch) and with it to confirm it finds the problems
without the additional RUN lines we had before.

Depends on D77886, D77887, D77747

Reviewers: aprantl, vsk, bogner

Subscribers: qcolombet, kristof.beyls, hiraditya, danielkiss, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D77888
2020-04-10 16:36:07 -07:00

72 lines
3.1 KiB
LLVM

; RUN: llc < %s -mtriple=arm64-apple-ios7.0 -pass-remarks-analysis=asm-printer \
; RUN: --debugify-and-strip-all-safe=0 \
; RUN: -verify-machineinstrs \
; RUN: -pass-remarks-with-hotness=1 -asm-verbose=0 \
; RUN: -debug-only=lazy-machine-block-freq,block-freq \
; RUN: -debug-pass=Executions 2>&1 | FileCheck %s -check-prefix=HOTNESS
; RUN: llc < %s -mtriple=arm64-apple-ios7.0 -pass-remarks-analysis=asm-printer \
; RUN: --debugify-and-strip-all-safe=0 \
; RUN: -verify-machineinstrs \
; RUN: -pass-remarks-with-hotness=0 -asm-verbose=0 \
; RUN: -debug-only=lazy-machine-block-freq,block-freq \
; RUN: -debug-pass=Executions 2>&1 | FileCheck %s -check-prefix=NO_HOTNESS
; REQUIRES: asserts
; Verify that we don't new populate MachineBFI for passes that already use
; MBFI, e.g. GreedyRegAlloc. (This hard-codes the previous pass to the
; GreedyRegAlloc, please adjust accordingly.)
; HOTNESS: Executing Pass 'Spill Code Placement Analysis'
; HOTNESS-NEXT: Executing Pass 'Lazy Machine Block Frequency Analysis'
; HOTNESS-NEXT: Executing Pass 'Machine Optimization Remark Emitter'
; HOTNESS-NEXT: MachineBlockFrequencyInfo is available
; HOTNESS-NEXT: Executing Pass 'Greedy Register Allocator'
; Verify that we only populate MachineBFI on behalf of ORE when hotness is
; requested. (This hard-codes the previous pass to the Assembly Printer,
; please adjust accordingly.)
; HOTNESS: Freeing Pass 'Machine Outliner'
; HOTNESS-NEXT: Executing Pass 'Function Pass Manager'
; HOTNESS-NEXT: Executing Pass 'Verify generated machine code'
; HOTNESS-NEXT: Freeing Pass 'Verify generated machine code'
; HOTNESS-NEXT: Executing Pass 'Lazy Machine Block Frequency Analysis'
; HOTNESS-NEXT: Executing Pass 'Machine Optimization Remark Emitter'
; HOTNESS-NEXT: Building MachineBlockFrequencyInfo on the fly
; HOTNESS-NEXT: Building LoopInfo on the fly
; HOTNESS-NEXT: Building DominatorTree on the fly
; HOTNESS-NOT: Executing Pass
; HOTNESS: block-frequency: empty_func
; HOTNESS-NOT: Executing Pass
; HOTNESS: Executing Pass 'AArch64 Assembly Printer'
; HOTNESS: arm64-summary-remarks.ll:5:0: 1 instructions in function (hotness: 33)
; NO_HOTNESS: Freeing Pass 'Machine Outliner'
; NO_HOTNESS-NEXT: Executing Pass 'Function Pass Manager'
; NO_HOTNESS-NEXT: Executing Pass 'Verify generated machine code'
; NO_HOTNESS-NEXT: Freeing Pass 'Verify generated machine code'
; NO_HOTNESS-NEXT: Executing Pass 'Lazy Machine Block Frequency Analysis'
; NO_HOTNESS-NEXT: Executing Pass 'Machine Optimization Remark Emitter'
; NO_HOTNESS-NEXT: Executing Pass 'AArch64 Assembly Printer'
; NO_HOTNESS: arm64-summary-remarks.ll:5:0: 1 instructions in function{{$}}
define void @empty_func() nounwind ssp !dbg !3 !prof !4 {
ret void
}
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!2}
!0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1)
!1 = !DIFile(filename: "arm64-summary-remarks.ll", directory: "")
!2 = !{i32 2, !"Debug Info Version", i32 3}
!3 = distinct !DISubprogram(name: "empty_func", scope: !1, file: !1, line: 5, scopeLine: 5, unit: !0)
!4 = !{!"function_entry_count", i64 33}