1fdddd8e7SMatthias Braun# RUN: llc -o - %s -O0 -regalloc=fast -run-pass=livedebugvalues | \ 2fdddd8e7SMatthias Braun# RUN: FileCheck %s -implicit-check-not=DBG_VALUE 3fdddd8e7SMatthias Braun--- | 4fdddd8e7SMatthias Braun target triple = "arm64-apple-ios12.1.0" 5fdddd8e7SMatthias Braun 6fdddd8e7SMatthias Braun declare void @use(i32) 7fdddd8e7SMatthias Braun 8fdddd8e7SMatthias Braun define void @f1(i32 %x) !dbg !6 { 9fdddd8e7SMatthias Braun entry: 10fdddd8e7SMatthias Braun %var = add i32 %x, 1, !dbg !12 11fdddd8e7SMatthias Braun call void @llvm.dbg.value(metadata i32 %var, metadata !9, metadata !DIExpression()), !dbg !12 12fdddd8e7SMatthias Braun br label %artificial-bb-1, !dbg !13 13fdddd8e7SMatthias Braun 14fdddd8e7SMatthias Braun artificial-bb-1: 15fdddd8e7SMatthias Braun br label %artificial-bb-2 16fdddd8e7SMatthias Braun 17fdddd8e7SMatthias Braun artificial-bb-2: 18fdddd8e7SMatthias Braun %invisible = add i32 %var, 1 19fdddd8e7SMatthias Braun br label %return, !dbg !14 20fdddd8e7SMatthias Braun 21fdddd8e7SMatthias Braun return: 22fdddd8e7SMatthias Braun call void @use(i32 %var) 23fdddd8e7SMatthias Braun ret void, !dbg !15 24fdddd8e7SMatthias Braun } 25fdddd8e7SMatthias Braun 26fdddd8e7SMatthias Braun declare void @llvm.dbg.value(metadata, metadata, metadata) #0 27*3a05e01dSFangrui Song declare void @llvm.stackprotector(ptr, ptr) #1 28fdddd8e7SMatthias Braun 29fdddd8e7SMatthias Braun attributes #0 = { nounwind readnone speculatable } 30fdddd8e7SMatthias Braun attributes #1 = { nounwind } 31fdddd8e7SMatthias Braun 32fdddd8e7SMatthias Braun !llvm.dbg.cu = !{!0} 33fdddd8e7SMatthias Braun !llvm.debugify = !{!3, !4} 34fdddd8e7SMatthias Braun !llvm.module.flags = !{!5} 35fdddd8e7SMatthias Braun 36fdddd8e7SMatthias Braun !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2) 37fdddd8e7SMatthias Braun !1 = !DIFile(filename: "compiler-gen-bbs-livedebugvalues.ll", directory: "/") 38fdddd8e7SMatthias Braun !2 = !{} 39fdddd8e7SMatthias Braun !3 = !{i32 6} 40fdddd8e7SMatthias Braun !4 = !{i32 2} 41fdddd8e7SMatthias Braun !5 = !{i32 2, !"Debug Info Version", i32 3} 42fdddd8e7SMatthias Braun !6 = distinct !DISubprogram(name: "f1", linkageName: "f1", scope: null, file: !1, line: 1, type: !7, isLocal: false, isDefinition: true, scopeLine: 1, isOptimized: true, unit: !0, retainedNodes: !8) 43fdddd8e7SMatthias Braun !7 = !DISubroutineType(types: !2) 44fdddd8e7SMatthias Braun !8 = !{!9, !11} 45fdddd8e7SMatthias Braun !9 = !DILocalVariable(name: "1", scope: !6, file: !1, line: 1, type: !10) 46fdddd8e7SMatthias Braun !10 = !DIBasicType(name: "ty32", size: 32, encoding: DW_ATE_unsigned) 47fdddd8e7SMatthias Braun !11 = !DILocalVariable(name: "2", scope: !6, file: !1, line: 4, type: !10) 48fdddd8e7SMatthias Braun !12 = !DILocation(line: 1, column: 1, scope: !6) 49fdddd8e7SMatthias Braun !13 = !DILocation(line: 2, column: 1, scope: !6) 50fdddd8e7SMatthias Braun !14 = !DILocation(line: 0, column: 1, scope: !6) 51fdddd8e7SMatthias Braun !15 = !DILocation(line: 4, column: 1, scope: !6) 52fdddd8e7SMatthias Braun 53fdddd8e7SMatthias Braun... 54fdddd8e7SMatthias Braun--- 55fdddd8e7SMatthias Braun# CHECK-LABEL: name: f1 56fdddd8e7SMatthias Braunname: f1 5748904e94SGuillaume Chateletalignment: 4 58fdddd8e7SMatthias Braunlegalized: true 59fdddd8e7SMatthias BraunregBankSelected: true 60fdddd8e7SMatthias Braunselected: true 61fdddd8e7SMatthias BrauntracksRegLiveness: true 62fdddd8e7SMatthias BraunframeInfo: 63fdddd8e7SMatthias Braun stackSize: 32 64fdddd8e7SMatthias Braun maxAlignment: 8 65fdddd8e7SMatthias Braun adjustsStack: true 66fdddd8e7SMatthias Braun hasCalls: true 67fdddd8e7SMatthias Braun maxCallFrameSize: 0 68fdddd8e7SMatthias Braunstack: 695d6ee76cSSander de Smalen - { id: 0, type: spill-slot, offset: -20, size: 4, alignment: 4, stack-id: default } 705d6ee76cSSander de Smalen - { id: 1, type: spill-slot, offset: -8, size: 8, alignment: 8, stack-id: default, 71fdddd8e7SMatthias Braun callee-saved-register: '$lr' } 725d6ee76cSSander de Smalen - { id: 2, type: spill-slot, offset: -16, size: 8, alignment: 8, stack-id: default, 73fdddd8e7SMatthias Braun callee-saved-register: '$fp' } 74fdddd8e7SMatthias Braunbody: | 75fdddd8e7SMatthias Braun ; CHECK-LABEL: bb.0.entry: 76fdddd8e7SMatthias Braun bb.0.entry: 77fdddd8e7SMatthias Braun liveins: $w0, $lr 78fdddd8e7SMatthias Braun 79fdddd8e7SMatthias Braun $sp = frame-setup SUBXri $sp, 32, 0 80fae05692SMatt Arsenault frame-setup STPXi killed $fp, killed $lr, $sp, 2 :: (store (s64) into %stack.2), (store (s64) into %stack.1) 81fdddd8e7SMatthias Braun frame-setup CFI_INSTRUCTION def_cfa_offset 32 82fdddd8e7SMatthias Braun frame-setup CFI_INSTRUCTION offset $w30, -8, debug-location !12 83fdddd8e7SMatthias Braun frame-setup CFI_INSTRUCTION offset $w29, -16, debug-location !12 84fdddd8e7SMatthias Braun renamable $w0 = ADDWri killed renamable $w0, 1, 0, debug-location !12 85fdddd8e7SMatthias Braun DBG_VALUE renamable $w0, $noreg, !9, !DIExpression(), debug-location !12 86fae05692SMatt Arsenault STRWui killed $w0, $sp, 3 :: (store (s32) into %stack.0) 87fdddd8e7SMatthias Braun DBG_VALUE $sp, 0, !9, !DIExpression(DW_OP_plus_uconst, 12), debug-location !12 88fdddd8e7SMatthias Braun 89fdddd8e7SMatthias Braun ; CHECK: DBG_VALUE renamable $w0, $noreg, !9, !DIExpression(), debug-location !12 90fae05692SMatt Arsenault ; CHECK-NEXT: STRWui killed $w0, $sp, 3 :: (store (s32) into %stack.0) 91fdddd8e7SMatthias Braun ; CHECK-NEXT: DBG_VALUE $sp, 0, !9, !DIExpression(DW_OP_plus_uconst, 12) 92313d2ce9SJeremy Morse ; CHECK-NEXT: DBG_VALUE $sp, 0, !9, !DIExpression(DW_OP_plus_uconst, 12) 93fdddd8e7SMatthias Braun 94fdddd8e7SMatthias Braun bb.1.artificial-bb-1: 95fdddd8e7SMatthias Braun ; CHECK-LABEL: bb.1.artificial-bb-1: 96fdddd8e7SMatthias Braun ; CHECK: DBG_VALUE $sp, 0, !9, !DIExpression(DW_OP_plus_uconst, 12) 97fdddd8e7SMatthias Braun 98fdddd8e7SMatthias Braun bb.2.artificial-bb-2: 99fdddd8e7SMatthias Braun ; CHECK-LABEL: bb.2.artificial-bb-2: 100fdddd8e7SMatthias Braun ; CHECK: DBG_VALUE $sp, 0, !9, !DIExpression(DW_OP_plus_uconst, 12) 101fdddd8e7SMatthias Braun 102fdddd8e7SMatthias Braun bb.3.return: 103fdddd8e7SMatthias Braun ; CHECK-LABEL: bb.3.return: 104fdddd8e7SMatthias Braun ; CHECK: DBG_VALUE $sp, 0, !9, !DIExpression(DW_OP_plus_uconst, 12) 105fdddd8e7SMatthias Braun 106fae05692SMatt Arsenault $w0 = LDRWui $sp, 3 :: (load (s32) from %stack.0) 107fdddd8e7SMatthias Braun BL @use, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit killed $w0 108fae05692SMatt Arsenault $fp, $lr = frame-destroy LDPXi $sp, 2, debug-location !15 :: (load (s64) from %stack.2), (load (s64) from %stack.1) 109fdddd8e7SMatthias Braun $sp = frame-destroy ADDXri $sp, 32, 0, debug-location !15 110fdddd8e7SMatthias Braun RET undef $lr, debug-location !15 111fdddd8e7SMatthias Braun... 112