llvm-project/llvm/test/CodeGen/AArch64/stp-opt-with-renaming-debug...

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

89 lines
3.4 KiB
Plaintext
Raw Normal View History

# RUN: llc -run-pass=aarch64-ldst-opt -mtriple=arm64-apple-iphoneos -aarch64-load-store-renaming=true -verify-machineinstrs -o - %s | FileCheck %s
--- |
define void @test_dbg_value1() #0 { ret void }
define void @test_dbg_value2() #0 { ret void }
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "llvm", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
!1 = !DIFile(filename: "dbg.ll", directory: "/tmp")
!2 = !{}
!5 = distinct !DISubprogram(name: "test_dbg_value", scope: !1, file: !1, line: 1, type: !6, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
!6 = !DISubroutineType(types: !2)
!7 = !DILocalVariable(name: "x", arg: 1, scope: !5, file: !1, line: 1, type: !8)
!8 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
!9 = !DILocation(line: 1, column: 1, scope: !5)
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-09 04:48:40 +08:00
!10 = !{i32 2, !"Debug Info Version", i32 3}
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!10}
---
# Check we do not crash when checking $noreg debug operands.
#
# CHECK-LABEL: name: test_dbg_value1
# CHECK: bb.0:
# CHECK-NEXT: liveins: $x0, $x1
# CHECK: $x10, renamable $x8 = LDPXi renamable $x0, 0 :: (load 8)
# CHECK-NEXT: renamable $x9 = LDRXui renamable $x0, 1 :: (load 8)
# CHECK-NEXT: STRXui renamable $x9, renamable $x0, 100 :: (store 8, align 4)
# CHECK-NEXT: DBG_VALUE $x9, $noreg
# CHECK-NEXT: renamable $x8 = ADDXrr $x8, $x8
# CHECK-NEXT: STPXi renamable $x8, killed $x10, renamable $x0, 10 :: (store 8, align 4)
# CHECK-NEXT: RET undef $lr
name: test_dbg_value1
alignment: 4
tracksRegLiveness: true
liveins:
- { reg: '$x0' }
- { reg: '$x1' }
- { reg: '$x8' }
frameInfo:
maxAlignment: 1
maxCallFrameSize: 0
machineFunctionInfo: {}
body: |
bb.0:
liveins: $x0, $x1
renamable $x9, renamable $x8 = LDPXi renamable $x0, 0 :: (load 8)
STRXui renamable killed $x9, renamable $x0, 11 :: (store 8, align 4)
renamable $x9 = LDRXui renamable $x0, 1 :: (load 8)
STRXui renamable $x9, renamable $x0, 100 :: (store 8, align 4)
DBG_VALUE $x9, $noreg, !7, !DIExpression(DW_OP_plus_uconst, 32), debug-location !9
renamable $x8 = ADDXrr $x8, $x8
STRXui renamable $x8, renamable $x0, 10 :: (store 8, align 4)
RET undef $lr
...
# CHECK-LABEL: name: test_dbg_value2
# CHECK: bb.0:
# CHECK-NEXT: liveins: $x19, $x20, $x0
# CHECK: $x8 = ORRXrs $xzr, $x0, 0
# CHECK-NEXT: renamable $x0 = nuw ADDXri $x0, 8, 0
# CHECK-NEXT: DBG_VALUE $x0, $noreg,
# CHECK-NEXT: STRXui killed renamable $x8, renamable $x19, 2 :: (store 8)
# CHECK-NEXT: $x8 = ADDXrs renamable $x0, killed renamable $x20, 0
# CHECK-NEXT: STPXi $xzr, renamable $x8, renamable $x19, 0 :: (store 8)
# CHECK-NEXT: RET undef $lr, implicit $x0
name: test_dbg_value2
alignment: 4
tracksRegLiveness: true
liveins:
- { reg: '$x0' }
- { reg: '$x1' }
frameInfo:
maxAlignment: 1
maxCallFrameSize: 0
machineFunctionInfo: {}
body: |
bb.0:
liveins: $x19, $x20, $x0
$x8 = ORRXrs $xzr, $x0, 0
renamable $x0 = nuw ADDXri $x0, 8, 0
DBG_VALUE $x0, $noreg, !7, !DIExpression(), debug-location !9
STRXui killed renamable $x8, renamable $x19, 2 :: (store 8)
$x8 = ADDXrs renamable $x0, killed renamable $x20, 0
STRXui $xzr, renamable $x19, 0 :: (store 8)
STRXui killed renamable $x8, killed renamable $x19, 1 :: (store 8)
RET undef $lr, implicit $x0
...