907 lines · plain
1# RUN: llc -run-pass livedebugvalues -mtriple=x86_64 -o - %s \2# RUN: -experimental-debug-variable-locations=true | FileCheck %s3 4# Generated from the following source with:5# clang -g -mllvm -stop-before=livedebugvalues -S -O2 test.c -o test.mir6# Then more functions added to test for extra behaviours with complex7# expressions:8# 'g': test for a crash from PR427739# 'h': complex expressions should be restored10# 'i': spills should be restored across block boundaries11# 'j': indirect DBG_VALUEs should be indirect after restoration12# 'k': variadic debug values should be restored13 14# #define FORCE_SPILL() \15# __asm volatile("" : : : \16# "rax", "rbx", "rcx", "rdx", "rsi", "rdi", "rbp", "r8", \17# "r9", "r10", "r11", "r12", "r13", "r14", "r15")18# int f(int *p) {19# if (p) {20# FORCE_SPILL();21# }22# return *(p + 1);23# }24 25# Pick out DILocalVariable numbers for "p", "q" and "r" etc26# CHECK: ![[PVAR:[0-9]+]] = !DILocalVariable(name: "p",27# CHECK: ![[QVAR:[0-9]+]] = !DILocalVariable(name: "q",28# CHECK: ![[RVAR:[0-9]+]] = !DILocalVariable(name: "r",29# CHECK: ![[SVAR:[0-9]+]] = !DILocalVariable(name: "s",30# CHECK: ![[TVAR:[0-9]+]] = !DILocalVariable(name: "t",31# CHECK: ![[UVAR:[0-9]+]] = !DILocalVariable(name: "u",32 33# Ascertain that the spill has been recognized and manifested in a DBG_VALUE.34# CHECK: MOV64mr $rsp,{{.*-8.*}}killed{{.*}}$rdi :: (store (s64) into %stack.0)35# CHECK-NEXT: DBG_VALUE $rsp,{{.*}}![[PVAR]],{{.*}}!DIExpression(DW_OP_constu, 8, DW_OP_minus)36 37# Check for the restore.38# CHECK: $rdi = MOV64rm $rsp,{{.*-8.*}}:: (load (s64) from %stack.0)39# CHECK-NEXT: $rax = MOV64ri 040# CHECK-NEXT: MOV64mr41# CHECK-NEXT: DBG_VALUE $rdi,{{.*}}![[PVAR]], !DIExpression()42 43--- |44 define dso_local i32 @f(ptr readonly %p) local_unnamed_addr !dbg !7 {45 entry:46 call void @llvm.dbg.value(metadata ptr %p, metadata !13, metadata !DIExpression()), !dbg !1447 %tobool = icmp eq ptr %p, null, !dbg !1548 br i1 %tobool, label %if.end, label %if.then, !dbg !1749 50 if.then: ; preds = %entry51 tail call void asm sideeffect "", "~{rax},~{rbx},~{rcx},~{rdx},~{rsi},~{rdi},~{rbp},~{r8},~{r9},~{r10},~{r11},~{r12},~{r13},~{r14},~{r15},~{dirflag},~{fpsr},~{flags}"(), !dbg !18, !srcloc !2052 br label %if.end, !dbg !2153 54 if.end: ; preds = %entry, %if.then55 %add.ptr = getelementptr inbounds i32, ptr %p, i64 1, !dbg !2256 %0 = load i32, ptr %add.ptr, align 4, !dbg !23, !tbaa !2457 ret i32 %0, !dbg !2858 }59 60 define dso_local i32 @g(ptr readonly %p) local_unnamed_addr !dbg !107 {61 entry:62 call void @llvm.dbg.value(metadata ptr %p, metadata !113, metadata !DIExpression()), !dbg !11463 %tobool = icmp eq ptr %p, null, !dbg !11564 br i1 %tobool, label %if.end, label %if.then, !dbg !11765 66 if.then: ; preds = %entry67 tail call void asm sideeffect "", "~{rax},~{rbx},~{rcx},~{rdx},~{rsi},~{rdi},~{rbp},~{r8},~{r9},~{r10},~{r11},~{r12},~{r13},~{r14},~{r15},~{dirflag},~{fpsr},~{flags}"(), !dbg !118, !srcloc !12068 br label %if.end, !dbg !12169 70 if.end: ; preds = %entry, %if.then71 %add.ptr = getelementptr inbounds i32, ptr %p, i64 1, !dbg !12272 %0 = load i32, ptr %add.ptr, align 4, !dbg !123, !tbaa !2473 ret i32 %0, !dbg !12874 }75 76 define dso_local i32 @h(ptr readonly %p) local_unnamed_addr !dbg !207 {77 entry:78 call void @llvm.dbg.value(metadata ptr %p, metadata !213, metadata !DIExpression()), !dbg !21479 %tobool = icmp eq ptr %p, null, !dbg !21580 br i1 %tobool, label %if.end, label %if.then, !dbg !21781 82 if.then: ; preds = %entry83 tail call void asm sideeffect "", "~{rax},~{rbx},~{rcx},~{rdx},~{rsi},~{rdi},~{rbp},~{r8},~{r9},~{r10},~{r11},~{r12},~{r13},~{r14},~{r15},~{dirflag},~{fpsr},~{flags}"(), !dbg !218, !srcloc !22084 br label %if.end, !dbg !22185 86 if.end: ; preds = %entry, %if.then87 %add.ptr = getelementptr inbounds i32, ptr %p, i64 1, !dbg !22288 %0 = load i32, ptr %add.ptr, align 4, !dbg !223, !tbaa !2489 ret i32 %0, !dbg !22890 }91 92 define dso_local i32 @i(ptr readonly %p) local_unnamed_addr !dbg !307 {93 entry:94 br label %foo95 96 foo:97 call void @llvm.dbg.value(metadata ptr %p, metadata !313, metadata !DIExpression()), !dbg !31498 %tobool = icmp eq ptr %p, null, !dbg !31599 br i1 %tobool, label %if.end, label %if.then, !dbg !317100 101 if.then: ; preds = %entry102 tail call void asm sideeffect "", "~{rax},~{rbx},~{rcx},~{rdx},~{rsi},~{rdi},~{rbp},~{r8},~{r9},~{r10},~{r11},~{r12},~{r13},~{r14},~{r15},~{dirflag},~{fpsr},~{flags}"(), !dbg !318, !srcloc !320103 br label %if.end, !dbg !321104 105 if.end: ; preds = %entry, %if.then106 %add.ptr = getelementptr inbounds i32, ptr %p, i64 1, !dbg !322107 %0 = load i32, ptr %add.ptr, align 4, !dbg !323, !tbaa !24108 ret i32 %0, !dbg !328109 }110 111 define dso_local i32 @j(ptr readonly %p) local_unnamed_addr !dbg !402 {112 entry:113 br label %foo114 115 foo:116 call void @llvm.dbg.value(metadata ptr %p, metadata !404, metadata !DIExpression()), !dbg !405117 %tobool = icmp eq ptr %p, null, !dbg !406118 br i1 %tobool, label %if.end, label %if.then, !dbg !408119 120 if.then: ; preds = %entry121 tail call void asm sideeffect "", "~{rax},~{rbx},~{rcx},~{rdx},~{rsi},~{rdi},~{rbp},~{r8},~{r9},~{r10},~{r11},~{r12},~{r13},~{r14},~{r15},~{dirflag},~{fpsr},~{flags}"(), !dbg !409, !srcloc !411122 br label %if.end, !dbg !412123 124 if.end: ; preds = %entry, %if.then125 %add.ptr = getelementptr inbounds i32, ptr %p, i64 1, !dbg !413126 %0 = load i32, ptr %add.ptr, align 4, !dbg !414, !tbaa !24127 ret i32 %0, !dbg !415128 }129 130 define dso_local i32 @k(ptr readonly %p) local_unnamed_addr !dbg !507 {131 entry:132 call void @llvm.dbg.value(metadata ptr %p, metadata !513, metadata !DIExpression()), !dbg !514133 %tobool = icmp eq ptr %p, null, !dbg !515134 br i1 %tobool, label %if.end, label %if.then, !dbg !517135 136 if.then: ; preds = %entry137 tail call void asm sideeffect "", "~{rax},~{rbx},~{rcx},~{rdx},~{rsi},~{rdi},~{rbp},~{r8},~{r9},~{r10},~{r11},~{r12},~{r13},~{r14},~{r15},~{dirflag},~{fpsr},~{flags}"(), !dbg !518, !srcloc !520138 br label %if.end, !dbg !521139 140 if.end: ; preds = %entry, %if.then141 %add.ptr = getelementptr inbounds i32, ptr %p, i64 1, !dbg !522142 %0 = load i32, ptr %add.ptr, align 4, !dbg !523, !tbaa !24143 ret i32 %0, !dbg !528144 }145 146 declare void @llvm.dbg.value(metadata, metadata, metadata)147 148 !llvm.dbg.cu = !{!0}149 !llvm.module.flags = !{!3, !4, !5}150 !llvm.ident = !{!6}151 152 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 9.0.0 (https://git.llvm.org/git/clang.git/ 57a6ce7ac318de98e3e777e09cb9ed8282b5cc03) (https://git.llvm.org/git/llvm.git/ ff54a19e4912d7f15cb02798a7f2048441bff751)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None)153 !1 = !DIFile(filename: "test2.c", directory: "/home/test")154 !2 = !{}155 !3 = !{i32 2, !"Dwarf Version", i32 4}156 !4 = !{i32 2, !"Debug Info Version", i32 3}157 !5 = !{i32 1, !"wchar_size", i32 4}158 !6 = !{!"clang version 9.0.0 (https://git.llvm.org/git/clang.git/ 57a6ce7ac318de98e3e777e09cb9ed8282b5cc03) (https://git.llvm.org/git/llvm.git/ ff54a19e4912d7f15cb02798a7f2048441bff751)"}159 !7 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 5, type: !8, scopeLine: 5, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !12)160 !8 = !DISubroutineType(types: !9)161 !9 = !{!10, !11}162 !10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)163 !11 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !10, size: 64)164 !12 = !{!13}165 !13 = !DILocalVariable(name: "p", arg: 1, scope: !7, file: !1, line: 5, type: !11)166 !14 = !DILocation(line: 5, column: 12, scope: !7)167 !15 = !DILocation(line: 6, column: 7, scope: !16)168 !16 = distinct !DILexicalBlock(scope: !7, file: !1, line: 6, column: 7)169 !17 = !DILocation(line: 6, column: 7, scope: !7)170 !18 = !DILocation(line: 7, column: 5, scope: !19)171 !19 = distinct !DILexicalBlock(scope: !16, file: !1, line: 6, column: 10)172 !20 = !{i32 -2147471544}173 !21 = !DILocation(line: 8, column: 3, scope: !19)174 !22 = !DILocation(line: 9, column: 14, scope: !7)175 !23 = !DILocation(line: 9, column: 10, scope: !7)176 !24 = !{!25, !25, i64 0}177 !25 = !{!"int", !26, i64 0}178 !26 = !{!"omnipotent char", !27, i64 0}179 !27 = !{!"Simple C/C++ TBAA"}180 !28 = !DILocation(line: 9, column: 3, scope: !7)181 !29 = !DILocalVariable(name: "p0", scope: !7, file: !1, line: 5, type: !11)182 !101 = !DIBasicType(name: "looong int", size: 64, encoding: DW_ATE_signed)183 !107 = distinct !DISubprogram(name: "g", scope: !0, file: !1, line: 105, type: !8, scopeLine: 105, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !112)184 !112 = !{!113}185 !113 = !DILocalVariable(name: "q", arg: 1, scope: !107, file: !1, line: 105, type: !101)186 !114 = !DILocation(line: 105, column: 12, scope: !107)187 !115 = !DILocation(line: 106, column: 7, scope: !116)188 !116 = distinct !DILexicalBlock(scope: !107, file: !1, line: 106, column: 7)189 !117 = !DILocation(line: 106, column: 7, scope: !107)190 !118 = !DILocation(line: 107, column: 5, scope: !119)191 !119 = distinct !DILexicalBlock(scope: !116, file: !1, line: 106, column: 10)192 !120 = !{i32 -2147471544}193 !121 = !DILocation(line: 108, column: 3, scope: !119)194 !122 = !DILocation(line: 109, column: 14, scope: !107)195 !123 = !DILocation(line: 109, column: 10, scope: !107)196 !128 = !DILocation(line: 109, column: 3, scope: !107)197 !201 = !DIBasicType(name: "looong int", size: 64, encoding: DW_ATE_signed)198 !207 = distinct !DISubprogram(name: "g", scope: !0, file: !1, line: 105, type: !8, scopeLine: 105, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !212)199 !212 = !{!213}200 !213 = !DILocalVariable(name: "r", arg: 1, scope: !207, file: !1, line: 105, type: !201)201 !214 = !DILocation(line: 105, column: 12, scope: !207)202 !215 = !DILocation(line: 106, column: 7, scope: !216)203 !216 = distinct !DILexicalBlock(scope: !207, file: !1, line: 106, column: 7)204 !217 = !DILocation(line: 106, column: 7, scope: !207)205 !218 = !DILocation(line: 107, column: 5, scope: !219)206 !219 = distinct !DILexicalBlock(scope: !216, file: !1, line: 106, column: 10)207 !220 = !{i32 -2147471544}208 !221 = !DILocation(line: 108, column: 3, scope: !219)209 !222 = !DILocation(line: 109, column: 14, scope: !207)210 !223 = !DILocation(line: 109, column: 10, scope: !207)211 !228 = !DILocation(line: 109, column: 3, scope: !207)212 !301 = !DIBasicType(name: "looong int", size: 64, encoding: DW_ATE_signed)213 !307 = distinct !DISubprogram(name: "g", scope: !0, file: !1, line: 105, type: !8, scopeLine: 105, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !312)214 !312 = !{!313}215 !313 = !DILocalVariable(name: "s", arg: 1, scope: !307, file: !1, line: 105, type: !301)216 !314 = !DILocation(line: 105, column: 12, scope: !307)217 !315 = !DILocation(line: 106, column: 7, scope: !316)218 !316 = distinct !DILexicalBlock(scope: !307, file: !1, line: 106, column: 7)219 !317 = !DILocation(line: 106, column: 7, scope: !307)220 !318 = !DILocation(line: 107, column: 5, scope: !319)221 !319 = distinct !DILexicalBlock(scope: !316, file: !1, line: 106, column: 10)222 !320 = !{i32 -2147471544}223 !321 = !DILocation(line: 108, column: 3, scope: !319)224 !322 = !DILocation(line: 109, column: 14, scope: !307)225 !323 = !DILocation(line: 109, column: 10, scope: !307)226 !328 = !DILocation(line: 109, column: 3, scope: !307)227 !401 = !DIBasicType(name: "looong int", size: 64, encoding: DW_ATE_signed)228 !402 = distinct !DISubprogram(name: "j", scope: !0, file: !1, line: 105, type: !8, scopeLine: 105, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !403)229 !403 = !{!404}230 !404 = !DILocalVariable(name: "t", arg: 1, scope: !402, file: !1, line: 105, type: !401)231 !405 = !DILocation(line: 105, column: 12, scope: !402)232 !406 = !DILocation(line: 106, column: 7, scope: !407)233 !407 = distinct !DILexicalBlock(scope: !402, file: !1, line: 106, column: 7)234 !408 = !DILocation(line: 106, column: 7, scope: !402)235 !409 = !DILocation(line: 107, column: 5, scope: !410)236 !410 = distinct !DILexicalBlock(scope: !407, file: !1, line: 106, column: 10)237 !411 = !{i32 -2147471544}238 !412 = !DILocation(line: 108, column: 3, scope: !410)239 !413 = !DILocation(line: 109, column: 14, scope: !402)240 !414 = !DILocation(line: 109, column: 10, scope: !402)241 !415 = !DILocation(line: 109, column: 3, scope: !402)242 !501 = !DIBasicType(name: "looong int", size: 64, encoding: DW_ATE_signed)243 !507 = distinct !DISubprogram(name: "k", scope: !0, file: !1, line: 105, type: !8, scopeLine: 105, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !512)244 !512 = !{!513}245 !513 = !DILocalVariable(name: "u", arg: 1, scope: !507, file: !1, line: 105, type: !501)246 !514 = !DILocation(line: 105, column: 12, scope: !507)247 !515 = !DILocation(line: 106, column: 7, scope: !516)248 !516 = distinct !DILexicalBlock(scope: !507, file: !1, line: 106, column: 7)249 !517 = !DILocation(line: 106, column: 7, scope: !507)250 !518 = !DILocation(line: 107, column: 5, scope: !519)251 !519 = distinct !DILexicalBlock(scope: !516, file: !1, line: 106, column: 10)252 !520 = !{i32 -2147471544}253 !521 = !DILocation(line: 108, column: 3, scope: !519)254 !522 = !DILocation(line: 109, column: 14, scope: !507)255 !523 = !DILocation(line: 109, column: 10, scope: !507)256 !528 = !DILocation(line: 109, column: 3, scope: !507)257 258...259---260name: f261alignment: 16262exposesReturnsTwice: false263legalized: false264regBankSelected: false265selected: false266failedISel: false267tracksRegLiveness: true268debugInstrRef: true269hasWinCFI: false270registers: []271liveins: 272 - { reg: '$rdi', virtual-reg: '' }273frameInfo: 274 isFrameAddressTaken: false275 isReturnAddressTaken: false276 hasStackMap: false277 hasPatchPoint: false278 stackSize: 48279 offsetAdjustment: -48280 maxAlignment: 8281 adjustsStack: false282 hasCalls: false283 stackProtector: ''284 maxCallFrameSize: 0285 cvBytesOfCalleeSavedRegisters: 48286 hasOpaqueSPAdjustment: false287 hasVAStart: false288 hasMustTailInVarArgFunc: false289 localFrameSize: 0290 savePoint: []291 restorePoint: []292fixedStack: 293 - { id: 0, type: spill-slot, offset: -56, size: 8, alignment: 8, stack-id: default,294 callee-saved-register: '$rbx', callee-saved-restored: true, debug-info-variable: '', 295 debug-info-expression: '', debug-info-location: '' }296 - { id: 1, type: spill-slot, offset: -48, size: 8, alignment: 16, stack-id: default,297 callee-saved-register: '$r12', callee-saved-restored: true, debug-info-variable: '', 298 debug-info-expression: '', debug-info-location: '' }299 - { id: 2, type: spill-slot, offset: -40, size: 8, alignment: 8, stack-id: default,300 callee-saved-register: '$r13', callee-saved-restored: true, debug-info-variable: '', 301 debug-info-expression: '', debug-info-location: '' }302 - { id: 3, type: spill-slot, offset: -32, size: 8, alignment: 16, stack-id: default,303 callee-saved-register: '$r14', callee-saved-restored: true, debug-info-variable: '', 304 debug-info-expression: '', debug-info-location: '' }305 - { id: 4, type: spill-slot, offset: -24, size: 8, alignment: 8, stack-id: default,306 callee-saved-register: '$r15', callee-saved-restored: true, debug-info-variable: '', 307 debug-info-expression: '', debug-info-location: '' }308 - { id: 5, type: spill-slot, offset: -16, size: 8, alignment: 16, stack-id: default,309 callee-saved-register: '$rbp', callee-saved-restored: true, debug-info-variable: '', 310 debug-info-expression: '', debug-info-location: '' }311stack: 312 - { id: 0, name: '', type: spill-slot, offset: -64, size: 8, alignment: 8, 313 stack-id: default, callee-saved-register: '', callee-saved-restored: true,314 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }315constants: []316body: |317 bb.0.entry:318 successors: %bb.2(0x30000000), %bb.1(0x50000000)319 liveins: $rdi, $rbx, $r12, $r13, $r14, $r15, $rbp320 321 DBG_VALUE $rdi, $noreg, !13, !DIExpression(), debug-location !14322 DBG_VALUE $rdi, $noreg, !13, !DIExpression(), debug-location !14323 TEST64rr renamable $rdi, renamable $rdi, implicit-def $eflags, debug-location !15324 JCC_1 %bb.2, 4, implicit $eflags, debug-location !17325 326 bb.1.if.then:327 successors: %bb.2(0x80000000)328 liveins: $rdi, $rbp, $r15, $r14, $r13, $r12, $rbx329 330 frame-setup PUSH64r killed $rbp, implicit-def $rsp, implicit $rsp331 CFI_INSTRUCTION def_cfa_offset 16332 frame-setup PUSH64r killed $r15, implicit-def $rsp, implicit $rsp333 CFI_INSTRUCTION def_cfa_offset 24334 frame-setup PUSH64r killed $r14, implicit-def $rsp, implicit $rsp335 CFI_INSTRUCTION def_cfa_offset 32336 frame-setup PUSH64r killed $r13, implicit-def $rsp, implicit $rsp337 CFI_INSTRUCTION def_cfa_offset 40338 frame-setup PUSH64r killed $r12, implicit-def $rsp, implicit $rsp339 CFI_INSTRUCTION def_cfa_offset 48340 frame-setup PUSH64r killed $rbx, implicit-def $rsp, implicit $rsp341 CFI_INSTRUCTION def_cfa_offset 56342 CFI_INSTRUCTION offset $rbx, -56343 CFI_INSTRUCTION offset $r12, -48344 CFI_INSTRUCTION offset $r13, -40345 CFI_INSTRUCTION offset $r14, -32346 CFI_INSTRUCTION offset $r15, -24347 CFI_INSTRUCTION offset $rbp, -16348 MOV64mr $rsp, 1, $noreg, -8, $noreg, killed renamable $rdi :: (store (s64) into %stack.0)349 INLINEASM &"", 1, 12, implicit-def dead early-clobber $rax, 12, implicit-def dead early-clobber $rbx, 12, implicit-def dead early-clobber $rcx, 12, implicit-def dead early-clobber $rdx, 12, implicit-def dead early-clobber $rsi, 12, implicit-def dead early-clobber $rdi, 12, implicit-def dead early-clobber $rbp, 12, implicit-def dead early-clobber $r8, 12, implicit-def dead early-clobber $r9, 12, implicit-def dead early-clobber $r10, 12, implicit-def dead early-clobber $r11, 12, implicit-def dead early-clobber $r12, 12, implicit-def dead early-clobber $r13, 12, implicit-def dead early-clobber $r14, 12, implicit-def dead early-clobber $r15, 12, implicit-def dead early-clobber $eflags, !20, debug-location !18350 renamable $rdi = MOV64rm $rsp, 1, $noreg, -8, $noreg :: (load (s64) from %stack.0)351 ; Clobber stack location to force variable location to move to $rdi.352 $rax = MOV64ri 0353 MOV64mr $rsp, 1, _, -8, _, killed renamable $rax :: (store (s64) into %stack.0)354 $rbx = frame-destroy POP64r implicit-def $rsp, implicit $rsp355 CFI_INSTRUCTION def_cfa_offset 48356 $r12 = frame-destroy POP64r implicit-def $rsp, implicit $rsp357 CFI_INSTRUCTION def_cfa_offset 40358 $r13 = frame-destroy POP64r implicit-def $rsp, implicit $rsp359 CFI_INSTRUCTION def_cfa_offset 32360 $r14 = frame-destroy POP64r implicit-def $rsp, implicit $rsp361 CFI_INSTRUCTION def_cfa_offset 24362 $r15 = frame-destroy POP64r implicit-def $rsp, implicit $rsp363 CFI_INSTRUCTION def_cfa_offset 16364 $rbp = frame-destroy POP64r implicit-def $rsp, implicit $rsp365 CFI_INSTRUCTION def_cfa_offset 8366 367 bb.2.if.end:368 liveins: $rdi, $rbx, $r12, $r13, $r14, $r15, $rbp369 370 renamable $eax = MOV32rm killed renamable $rdi, 1, $noreg, 4, $noreg, debug-location !23 :: (load (s32) from %ir.add.ptr, !tbaa !24)371 RET64 $eax, debug-location !28372 373...374---375# This second function has been appended as a regression test against a376# crash, caused by expressions being created from spill restores that did377# not preserve fragment information. Test that no empty expressions are378# created at all, and the last block describes both variable fragments.379 380# CHECK-LABEL: name: g381# CHECK-NOT: !DIExpression()382# CHECK-LABEL: bb.2.if.end:383# CHECK: DBG_VALUE $rbx, $noreg, ![[QVAR]], !DIExpression(DW_OP_LLVM_fragment, 32, 32)384# CHECK: DBG_VALUE $rdi, $noreg, ![[QVAR]], !DIExpression(DW_OP_LLVM_fragment, 0, 32)385 386name: g387alignment: 16388tracksRegLiveness: true389debugInstrRef: true390liveins: 391 - { reg: '$rdi', virtual-reg: '' }392frameInfo: 393 stackSize: 48394 offsetAdjustment: -48395 maxAlignment: 8396 cvBytesOfCalleeSavedRegisters: 48397 localFrameSize: 0398fixedStack: 399 - { id: 0, type: spill-slot, offset: -56, size: 8, alignment: 8, stack-id: default,400 callee-saved-register: '$rbx', callee-saved-restored: true, debug-info-variable: '', 401 debug-info-expression: '', debug-info-location: '' }402 - { id: 1, type: spill-slot, offset: -48, size: 8, alignment: 16, stack-id: default,403 callee-saved-register: '$r12', callee-saved-restored: true, debug-info-variable: '', 404 debug-info-expression: '', debug-info-location: '' }405 - { id: 2, type: spill-slot, offset: -40, size: 8, alignment: 8, stack-id: default,406 callee-saved-register: '$r13', callee-saved-restored: true, debug-info-variable: '', 407 debug-info-expression: '', debug-info-location: '' }408 - { id: 3, type: spill-slot, offset: -32, size: 8, alignment: 16, stack-id: default,409 callee-saved-register: '$r14', callee-saved-restored: true, debug-info-variable: '', 410 debug-info-expression: '', debug-info-location: '' }411 - { id: 4, type: spill-slot, offset: -24, size: 8, alignment: 8, stack-id: default,412 callee-saved-register: '$r15', callee-saved-restored: true, debug-info-variable: '', 413 debug-info-expression: '', debug-info-location: '' }414 - { id: 5, type: spill-slot, offset: -16, size: 8, alignment: 16, stack-id: default,415 callee-saved-register: '$rbp', callee-saved-restored: true, debug-info-variable: '', 416 debug-info-expression: '', debug-info-location: '' }417stack: 418 - { id: 0, name: '', type: spill-slot, offset: -64, size: 8, alignment: 8, 419 stack-id: default, callee-saved-register: '', callee-saved-restored: true,420 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }421constants: []422body: |423 bb.0.entry:424 successors: %bb.1(0x50000000)425 liveins: $rdi, $rbx, $r12, $r13, $r14, $r15, $rbp426 427 DBG_VALUE $rdi, $noreg, !113, !DIExpression(DW_OP_LLVM_fragment, 0, 32), debug-location !114428 TEST64rr renamable $rdi, renamable $rdi, implicit-def $eflags, debug-location !115429 JMP_1 %bb.1, implicit $eflags, debug-location !117430 431 bb.1.if.then:432 successors: %bb.2(0x80000000)433 liveins: $rdi, $rbp, $r15, $r14, $r13, $r12, $rbx434 435 MOV64mr $rsp, 1, $noreg, -8, $noreg, killed renamable $rdi :: (store (s64) into %stack.0)436 renamable $rdi = MOV64rm $rsp, 1, $noreg, -8, $noreg :: (load (s64) from %stack.0)437 438 bb.2.if.end:439 liveins: $rdi, $rbx, $r12, $r13, $r14, $r15, $rbp440 441 DBG_VALUE $rbx, $noreg, !113, !DIExpression(DW_OP_LLVM_fragment, 32, 32), debug-location !114442 MOV64mr $rsp, 1, $noreg, -8, $noreg, killed renamable $rbx :: (store (s64) into %stack.0)443 renamable $rsi = MOV64rm $rsp, 1, $noreg, -8, $noreg :: (load (s64) from %stack.0)444 445 renamable $eax = MOV32rm killed renamable $rsi, 1, $noreg, 4, $noreg, debug-location !123 :: (load (s32) from %ir.add.ptr, !tbaa !24)446 $rdi = MOV64ri 0447 RET64 $eax, debug-location !128448 449...450---451# This third function tests that complex expressions are spilt, and restored452# correctly within a basic block.453 454# CHECK-LABEL: name: h455# CHECK-LABEL: bb.0.entry:456# CHECK: DBG_VALUE $rdi, $noreg, ![[RVAR]], !DIExpression(DW_OP_plus_uconst, 1)457# CHECK-LABEL: bb.1.if.then:458# CHECK: DBG_VALUE $rdi, $noreg, ![[RVAR]], !DIExpression(DW_OP_plus_uconst, 1)459# CHECK: DBG_VALUE $rsp, $noreg, ![[RVAR]], !DIExpression(DW_OP_constu, 8, DW_OP_minus, DW_OP_deref, DW_OP_plus_uconst, 1)460# CHECK: DBG_VALUE $rdi, $noreg, ![[RVAR]], !DIExpression(DW_OP_plus_uconst, 1)461# CHECK-LABEL: bb.2.if.end:462# CHECK: DBG_VALUE $rdi, $noreg, ![[RVAR]], !DIExpression(DW_OP_plus_uconst, 1)463 464name: h465alignment: 16466tracksRegLiveness: true467debugInstrRef: true468liveins: 469 - { reg: '$rdi', virtual-reg: '' }470frameInfo: 471 stackSize: 48472 offsetAdjustment: -48473 maxAlignment: 8474 cvBytesOfCalleeSavedRegisters: 48475 localFrameSize: 0476fixedStack: 477 - { id: 0, type: spill-slot, offset: -56, size: 8, alignment: 8, stack-id: default,478 callee-saved-register: '$rbx', callee-saved-restored: true, debug-info-variable: '', 479 debug-info-expression: '', debug-info-location: '' }480 - { id: 1, type: spill-slot, offset: -48, size: 8, alignment: 16, stack-id: default,481 callee-saved-register: '$r12', callee-saved-restored: true, debug-info-variable: '', 482 debug-info-expression: '', debug-info-location: '' }483 - { id: 2, type: spill-slot, offset: -40, size: 8, alignment: 8, stack-id: default,484 callee-saved-register: '$r13', callee-saved-restored: true, debug-info-variable: '', 485 debug-info-expression: '', debug-info-location: '' }486 - { id: 3, type: spill-slot, offset: -32, size: 8, alignment: 16, stack-id: default,487 callee-saved-register: '$r14', callee-saved-restored: true, debug-info-variable: '', 488 debug-info-expression: '', debug-info-location: '' }489 - { id: 4, type: spill-slot, offset: -24, size: 8, alignment: 8, stack-id: default,490 callee-saved-register: '$r15', callee-saved-restored: true, debug-info-variable: '', 491 debug-info-expression: '', debug-info-location: '' }492 - { id: 5, type: spill-slot, offset: -16, size: 8, alignment: 16, stack-id: default,493 callee-saved-register: '$rbp', callee-saved-restored: true, debug-info-variable: '', 494 debug-info-expression: '', debug-info-location: '' }495stack: 496 - { id: 0, name: '', type: spill-slot, offset: -64, size: 8, alignment: 8, 497 stack-id: default, callee-saved-register: '', callee-saved-restored: true,498 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }499constants: []500body: |501 bb.0.entry:502 successors: %bb.2(0x30000000), %bb.1(0x50000000)503 liveins: $rdi, $rbx, $r12, $r13, $r14, $r15, $rbp504 505 DBG_VALUE $rdi, $noreg, !213, !DIExpression(DW_OP_plus_uconst, 1), debug-location !214506 TEST64rr renamable $rdi, renamable $rdi, implicit-def $eflags, debug-location !215507 JCC_1 %bb.2, 4, implicit $eflags, debug-location !217508 509 bb.1.if.then:510 successors: %bb.2(0x80000000)511 liveins: $rdi, $rbp, $r15, $r14, $r13, $r12, $rbx512 513 frame-setup PUSH64r killed $rbp, implicit-def $rsp, implicit $rsp514 CFI_INSTRUCTION def_cfa_offset 16515 frame-setup PUSH64r killed $r15, implicit-def $rsp, implicit $rsp516 CFI_INSTRUCTION def_cfa_offset 24517 frame-setup PUSH64r killed $r14, implicit-def $rsp, implicit $rsp518 CFI_INSTRUCTION def_cfa_offset 32519 frame-setup PUSH64r killed $r13, implicit-def $rsp, implicit $rsp520 CFI_INSTRUCTION def_cfa_offset 40521 frame-setup PUSH64r killed $r12, implicit-def $rsp, implicit $rsp522 CFI_INSTRUCTION def_cfa_offset 48523 frame-setup PUSH64r killed $rbx, implicit-def $rsp, implicit $rsp524 CFI_INSTRUCTION def_cfa_offset 56525 CFI_INSTRUCTION offset $rbx, -56526 CFI_INSTRUCTION offset $r12, -48527 CFI_INSTRUCTION offset $r13, -40528 CFI_INSTRUCTION offset $r14, -32529 CFI_INSTRUCTION offset $r15, -24530 CFI_INSTRUCTION offset $rbp, -16531 MOV64mr $rsp, 1, $noreg, -8, $noreg, killed renamable $rdi :: (store (s64) into %stack.0)532 INLINEASM &"", 1, 12, implicit-def dead early-clobber $rax, 12, implicit-def dead early-clobber $rbx, 12, implicit-def dead early-clobber $rcx, 12, implicit-def dead early-clobber $rdx, 12, implicit-def dead early-clobber $rsi, 12, implicit-def dead early-clobber $rdi, 12, implicit-def dead early-clobber $rbp, 12, implicit-def dead early-clobber $r8, 12, implicit-def dead early-clobber $r9, 12, implicit-def dead early-clobber $r10, 12, implicit-def dead early-clobber $r11, 12, implicit-def dead early-clobber $r12, 12, implicit-def dead early-clobber $r13, 12, implicit-def dead early-clobber $r14, 12, implicit-def dead early-clobber $r15, 12, implicit-def dead early-clobber $eflags, !220, debug-location !218533 renamable $rdi = MOV64rm $rsp, 1, $noreg, -8, $noreg :: (load (s64) from %stack.0)534 ; Clobber stack location to force variable location to move to $rdi.535 $rax = MOV64ri 0536 MOV64mr $rsp, 1, _, -8, _, killed renamable $rax :: (store (s64) into %stack.0)537 $rbx = frame-destroy POP64r implicit-def $rsp, implicit $rsp538 CFI_INSTRUCTION def_cfa_offset 48539 $r12 = frame-destroy POP64r implicit-def $rsp, implicit $rsp540 CFI_INSTRUCTION def_cfa_offset 40541 $r13 = frame-destroy POP64r implicit-def $rsp, implicit $rsp542 CFI_INSTRUCTION def_cfa_offset 32543 $r14 = frame-destroy POP64r implicit-def $rsp, implicit $rsp544 CFI_INSTRUCTION def_cfa_offset 24545 $r15 = frame-destroy POP64r implicit-def $rsp, implicit $rsp546 CFI_INSTRUCTION def_cfa_offset 16547 $rbp = frame-destroy POP64r implicit-def $rsp, implicit $rsp548 CFI_INSTRUCTION def_cfa_offset 8549 550 bb.2.if.end:551 liveins: $rdi, $rbx, $r12, $r13, $r14, $r15, $rbp552 553 renamable $eax = MOV32rm killed renamable $rdi, 1, $noreg, 4, $noreg, debug-location !223 :: (load (s32) from %ir.add.ptr, !tbaa !24)554 RET64 $eax, debug-location !228555 556 557 558...559---560# Function four: test that spill restores are detected across block561# boundaries. The spill has been moved to bb.1, children of which are562# bb 2 and 3, neither of which modifies the stack loc. The exit block (3)563# should still be tracking the spill, and restore it on stack load.564 565# Summary: loc is in $rdi in bb0, spills to stack in bb1, remains in stack566# in bb2, starts in stack then loaded in bb3.567 568# CHECK-LABEL: name: i569# CHECK-LABEL: bb.0.entry:570# CHECK: DBG_VALUE $rdi, $noreg, ![[SVAR]], !DIExpression(DW_OP_plus_uconst, 1)571# CHECK-LABEL: bb.1.foo:572# CHECK: DBG_VALUE $rdi, $noreg, ![[SVAR]], !DIExpression(DW_OP_plus_uconst, 1)573# CHECK: DBG_VALUE $rsp, $noreg, ![[SVAR]], !DIExpression(DW_OP_constu, 8, DW_OP_minus, DW_OP_deref, DW_OP_plus_uconst, 1)574# CHECK-LABEL: bb.2.if.then:575# CHECK: DBG_VALUE $rsp, $noreg, ![[SVAR]], !DIExpression(DW_OP_constu, 8, DW_OP_minus, DW_OP_deref, DW_OP_plus_uconst, 1)576# CHECK-LABEL: bb.3.if.end577# CHECK: DBG_VALUE $rsp, $noreg, ![[SVAR]], !DIExpression(DW_OP_constu, 8, DW_OP_minus, DW_OP_deref, DW_OP_plus_uconst, 1)578# CHECK: DBG_VALUE $rdi, $noreg, ![[SVAR]], !DIExpression(DW_OP_plus_uconst, 1)579name: i580alignment: 16581tracksRegLiveness: true582debugInstrRef: true583liveins: 584 - { reg: '$rdi', virtual-reg: '' }585frameInfo: 586 stackSize: 48587 offsetAdjustment: -48588 maxAlignment: 8589 cvBytesOfCalleeSavedRegisters: 48590 localFrameSize: 0591fixedStack: 592 - { id: 0, type: spill-slot, offset: -56, size: 8, alignment: 8, stack-id: default,593 callee-saved-register: '$rbx', callee-saved-restored: true, debug-info-variable: '', 594 debug-info-expression: '', debug-info-location: '' }595 - { id: 1, type: spill-slot, offset: -48, size: 8, alignment: 16, stack-id: default,596 callee-saved-register: '$r12', callee-saved-restored: true, debug-info-variable: '', 597 debug-info-expression: '', debug-info-location: '' }598 - { id: 2, type: spill-slot, offset: -40, size: 8, alignment: 8, stack-id: default,599 callee-saved-register: '$r13', callee-saved-restored: true, debug-info-variable: '', 600 debug-info-expression: '', debug-info-location: '' }601 - { id: 3, type: spill-slot, offset: -32, size: 8, alignment: 16, stack-id: default,602 callee-saved-register: '$r14', callee-saved-restored: true, debug-info-variable: '', 603 debug-info-expression: '', debug-info-location: '' }604 - { id: 4, type: spill-slot, offset: -24, size: 8, alignment: 8, stack-id: default,605 callee-saved-register: '$r15', callee-saved-restored: true, debug-info-variable: '', 606 debug-info-expression: '', debug-info-location: '' }607 - { id: 5, type: spill-slot, offset: -16, size: 8, alignment: 16, stack-id: default,608 callee-saved-register: '$rbp', callee-saved-restored: true, debug-info-variable: '', 609 debug-info-expression: '', debug-info-location: '' }610stack: 611 - { id: 0, name: '', type: spill-slot, offset: -64, size: 8, alignment: 8, 612 stack-id: default, callee-saved-register: '', callee-saved-restored: true,613 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }614constants: []615body: |616 bb.0.entry:617 successors: %bb.1618 liveins: $rdi, $rbx, $r12, $r13, $r14, $r15, $rbp619 620 DBG_VALUE $rdi, $noreg, !313, !DIExpression(DW_OP_plus_uconst, 1), debug-location !314621 JMP_1 %bb.1, debug-location !317622 623 bb.1.foo:624 successors: %bb.3(0x30000000), %bb.2(0x50000000)625 liveins: $rdi, $rbx, $r12, $r13, $r14, $r15, $rbp626 627 $rax = COPY $rdi628 MOV64mr $rsp, 1, $noreg, -8, $noreg, killed renamable $rdi :: (store (s64) into %stack.0)629 $rdi = MOV64ri 0630 TEST64rr $rax, renamable $rax, implicit-def $eflags, debug-location !315631 JCC_1 %bb.3, 4, implicit $eflags, debug-location !317632 633 bb.2.if.then:634 successors: %bb.3(0x80000000)635 liveins: $rbp, $r15, $r14, $r13, $r12, $rbx636 637 frame-setup PUSH64r killed $rbp, implicit-def $rsp, implicit $rsp638 CFI_INSTRUCTION def_cfa_offset 16639 frame-setup PUSH64r killed $r15, implicit-def $rsp, implicit $rsp640 CFI_INSTRUCTION def_cfa_offset 24641 frame-setup PUSH64r killed $r14, implicit-def $rsp, implicit $rsp642 CFI_INSTRUCTION def_cfa_offset 32643 frame-setup PUSH64r killed $r13, implicit-def $rsp, implicit $rsp644 CFI_INSTRUCTION def_cfa_offset 40645 frame-setup PUSH64r killed $r12, implicit-def $rsp, implicit $rsp646 CFI_INSTRUCTION def_cfa_offset 48647 frame-setup PUSH64r killed $rbx, implicit-def $rsp, implicit $rsp648 CFI_INSTRUCTION def_cfa_offset 56649 CFI_INSTRUCTION offset $rbx, -56650 CFI_INSTRUCTION offset $r12, -48651 CFI_INSTRUCTION offset $r13, -40652 CFI_INSTRUCTION offset $r14, -32653 CFI_INSTRUCTION offset $r15, -24654 CFI_INSTRUCTION offset $rbp, -16655 INLINEASM &"", 1, 12, implicit-def dead early-clobber $rax, 12, implicit-def dead early-clobber $rbx, 12, implicit-def dead early-clobber $rcx, 12, implicit-def dead early-clobber $rdx, 12, implicit-def dead early-clobber $rsi, 12, implicit-def dead early-clobber $rdi, 12, implicit-def dead early-clobber $rbp, 12, implicit-def dead early-clobber $r8, 12, implicit-def dead early-clobber $r9, 12, implicit-def dead early-clobber $r10, 12, implicit-def dead early-clobber $r11, 12, implicit-def dead early-clobber $r12, 12, implicit-def dead early-clobber $r13, 12, implicit-def dead early-clobber $r14, 12, implicit-def dead early-clobber $r15, 12, implicit-def dead early-clobber $eflags, !320, debug-location !318656 $rbx = frame-destroy POP64r implicit-def $rsp, implicit $rsp657 CFI_INSTRUCTION def_cfa_offset 48658 $r12 = frame-destroy POP64r implicit-def $rsp, implicit $rsp659 CFI_INSTRUCTION def_cfa_offset 40660 $r13 = frame-destroy POP64r implicit-def $rsp, implicit $rsp661 CFI_INSTRUCTION def_cfa_offset 32662 $r14 = frame-destroy POP64r implicit-def $rsp, implicit $rsp663 CFI_INSTRUCTION def_cfa_offset 24664 $r15 = frame-destroy POP64r implicit-def $rsp, implicit $rsp665 CFI_INSTRUCTION def_cfa_offset 16666 $rbp = frame-destroy POP64r implicit-def $rsp, implicit $rsp667 CFI_INSTRUCTION def_cfa_offset 8668 669 bb.3.if.end:670 liveins: $rbx, $r12, $r13, $r14, $r15, $rbp671 672 renamable $rdi = MOV64rm $rsp, 1, $noreg, -8, $noreg :: (load (s64) from %stack.0)673 ; Clobber stack location to force variable location to move to $rdi.674 $rax = MOV64ri 0675 MOV64mr $rsp, 1, _, -8, _, killed renamable $rax :: (store (s64) into %stack.0)676 renamable $eax = MOV32rm killed renamable $rdi, 1, $noreg, 4, $noreg, debug-location !323 :: (load (s32) from %ir.add.ptr, !tbaa !24)677 RET64 $eax, debug-location !328678 679...680---681# Test that if an unspilt DBG_VALUE starts as an indirect DBG_VALUE, then it682# is restored as an indirect DBG_VALUE. FIXME: Note that for the intervening683# period of being a spilt location there is still a missing layer of684# indirection.685 686# CHECK-LABEL: name: j687# CHECK-LABEL: bb.0.entry:688# CHECK: DBG_VALUE $rdi, 0, ![[TVAR]], !DIExpression()689# CHECK-LABEL: bb.1.if.then:690# CHECK: DBG_VALUE $rsp, 0, ![[TVAR]], !DIExpression(DW_OP_constu, 8, DW_OP_minus, DW_OP_deref)691# CHECK: INLINEASM692# CHECK: DBG_VALUE ${{[a-zA-Z0-9]+}}, 0, ![[TVAR]], !DIExpression()693# CHECK-LABEL: bb.2.if.end694 695name: j696tracksRegLiveness: true697debugInstrRef: true698liveins: 699 - { reg: '$rdi', virtual-reg: '' }700frameInfo: 701 stackSize: 48702 offsetAdjustment: -48703 maxAlignment: 8704 cvBytesOfCalleeSavedRegisters: 48705fixedStack: 706 - { id: 0, type: spill-slot, offset: -56, size: 8, alignment: 8, stack-id: default,707 callee-saved-register: '$rbx', callee-saved-restored: true, debug-info-variable: '', 708 debug-info-expression: '', debug-info-location: '' }709 - { id: 1, type: spill-slot, offset: -48, size: 8, alignment: 16, stack-id: default,710 callee-saved-register: '$r12', callee-saved-restored: true, debug-info-variable: '', 711 debug-info-expression: '', debug-info-location: '' }712 - { id: 2, type: spill-slot, offset: -40, size: 8, alignment: 8, stack-id: default,713 callee-saved-register: '$r13', callee-saved-restored: true, debug-info-variable: '', 714 debug-info-expression: '', debug-info-location: '' }715 - { id: 3, type: spill-slot, offset: -32, size: 8, alignment: 16, stack-id: default,716 callee-saved-register: '$r14', callee-saved-restored: true, debug-info-variable: '', 717 debug-info-expression: '', debug-info-location: '' }718 - { id: 4, type: spill-slot, offset: -24, size: 8, alignment: 8, stack-id: default,719 callee-saved-register: '$r15', callee-saved-restored: true, debug-info-variable: '', 720 debug-info-expression: '', debug-info-location: '' }721 - { id: 5, type: spill-slot, offset: -16, size: 8, alignment: 16, stack-id: default,722 callee-saved-register: '$rbp', callee-saved-restored: true, debug-info-variable: '', 723 debug-info-expression: '', debug-info-location: '' }724stack: 725 - { id: 0, name: '', type: spill-slot, offset: -64, size: 8, alignment: 8, 726 stack-id: default, callee-saved-register: '', callee-saved-restored: true,727 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }728constants: []729body: |730 bb.0.entry:731 successors: %bb.2, %bb.1732 liveins: $rdi, $rbx, $r12, $r13, $r14, $r15, $rbp733 734 DBG_VALUE $rdi, 0, !404, !DIExpression(), debug-location !405735 DBG_VALUE $rdi, 0, !404, !DIExpression(), debug-location !405736 TEST64rr renamable $rdi, renamable $rdi, implicit-def $eflags, debug-location !406737 JCC_1 %bb.2, 4, implicit $eflags, debug-location !408738 739 bb.1.if.then:740 successors: %bb.2741 liveins: $rdi, $rbp, $r15, $r14, $r13, $r12, $rbx742 743 frame-setup PUSH64r killed $rbp, implicit-def $rsp, implicit $rsp744 CFI_INSTRUCTION def_cfa_offset 16745 frame-setup PUSH64r killed $r15, implicit-def $rsp, implicit $rsp746 CFI_INSTRUCTION def_cfa_offset 24747 frame-setup PUSH64r killed $r14, implicit-def $rsp, implicit $rsp748 CFI_INSTRUCTION def_cfa_offset 32749 frame-setup PUSH64r killed $r13, implicit-def $rsp, implicit $rsp750 CFI_INSTRUCTION def_cfa_offset 40751 frame-setup PUSH64r killed $r12, implicit-def $rsp, implicit $rsp752 CFI_INSTRUCTION def_cfa_offset 48753 frame-setup PUSH64r killed $rbx, implicit-def $rsp, implicit $rsp754 CFI_INSTRUCTION def_cfa_offset 56755 CFI_INSTRUCTION offset $rbx, -56756 CFI_INSTRUCTION offset $r12, -48757 CFI_INSTRUCTION offset $r13, -40758 CFI_INSTRUCTION offset $r14, -32759 CFI_INSTRUCTION offset $r15, -24760 CFI_INSTRUCTION offset $rbp, -16761 MOV64mr $rsp, 1, $noreg, -8, $noreg, killed renamable $rdi :: (store (s64) into %stack.0)762 INLINEASM &"", 1, 12, implicit-def dead early-clobber $rax, 12, implicit-def dead early-clobber $rbx, 12, implicit-def dead early-clobber $rcx, 12, implicit-def dead early-clobber $rdx, 12, implicit-def dead early-clobber $rsi, 12, implicit-def dead early-clobber $rdi, 12, implicit-def dead early-clobber $rbp, 12, implicit-def dead early-clobber $r8, 12, implicit-def dead early-clobber $r9, 12, implicit-def dead early-clobber $r10, 12, implicit-def dead early-clobber $r11, 12, implicit-def dead early-clobber $r12, 12, implicit-def dead early-clobber $r13, 12, implicit-def dead early-clobber $r14, 12, implicit-def dead early-clobber $r15, 12, implicit-def dead early-clobber $eflags, !20, debug-location !409763 renamable $rdi = MOV64rm $rsp, 1, $noreg, -8, $noreg :: (load (s64) from %stack.0)764 ; Clobber stack location to force variable location to move to $rdi.765 $rax = MOV64ri 0766 MOV64mr $rsp, 1, _, -8, _, killed renamable $rax :: (store (s64) into %stack.0)767 $rbx = frame-destroy POP64r implicit-def $rsp, implicit $rsp768 CFI_INSTRUCTION def_cfa_offset 48769 $r12 = frame-destroy POP64r implicit-def $rsp, implicit $rsp770 CFI_INSTRUCTION def_cfa_offset 40771 $r13 = frame-destroy POP64r implicit-def $rsp, implicit $rsp772 CFI_INSTRUCTION def_cfa_offset 32773 $r14 = frame-destroy POP64r implicit-def $rsp, implicit $rsp774 CFI_INSTRUCTION def_cfa_offset 24775 $r15 = frame-destroy POP64r implicit-def $rsp, implicit $rsp776 CFI_INSTRUCTION def_cfa_offset 16777 $rbp = frame-destroy POP64r implicit-def $rsp, implicit $rsp778 CFI_INSTRUCTION def_cfa_offset 8779 780 bb.2.if.end:781 liveins: $rdi, $rbx, $r12, $r13, $r14, $r15, $rbp782 783 renamable $eax = MOV32rm killed renamable $rdi, 1, $noreg, 4, $noreg, debug-location !414 :: (load (s32) from %ir.add.ptr, !tbaa !24)784 RET64 $eax, debug-location !415785 786...787---788# Test that if the values used by a variable with a variadic debug value are789# spilt and restored, we correctly track each value individually.790# This third function tests that complex expressions are spilt, and restored791# correctly within a basic block.792 793# CHECK-LABEL: name: k794# CHECK-LABEL: bb.0.entry:795# CHECK: DBG_VALUE_LIST ![[UVAR]], !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_plus_uconst, 1, DW_OP_LLVM_arg, 1, DW_OP_plus), $rdi, $r10796# CHECK-LABEL: bb.1.if.then:797# CHECK: DBG_VALUE_LIST ![[UVAR]], !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_plus_uconst, 1, DW_OP_LLVM_arg, 1, DW_OP_plus), $rdi, $r10798# CHECK: DBG_VALUE_LIST ![[UVAR]], !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_constu, 8, DW_OP_minus, DW_OP_deref, DW_OP_plus_uconst, 1, DW_OP_LLVM_arg, 1, DW_OP_plus), $rsp, $r10799# CHECK: DBG_VALUE_LIST ![[UVAR]], !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_constu, 8, DW_OP_minus, DW_OP_deref, DW_OP_plus_uconst, 1, DW_OP_LLVM_arg, 1, DW_OP_constu, 16, DW_OP_minus, DW_OP_deref, DW_OP_plus), $rsp, $rsp800# CHECK: DBG_VALUE_LIST ![[UVAR]], !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_plus_uconst, 1, DW_OP_LLVM_arg, 1, DW_OP_constu, 16, DW_OP_minus, DW_OP_deref, DW_OP_plus), $rdi, $rsp801# CHECK: DBG_VALUE_LIST ![[UVAR]], !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_plus_uconst, 1, DW_OP_LLVM_arg, 1, DW_OP_plus), $rdi, $r10802# CHECK-LABEL: bb.2.if.end:803# CHECK: DBG_VALUE_LIST ![[UVAR]], !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_plus_uconst, 1, DW_OP_LLVM_arg, 1, DW_OP_plus), $rdi, $r10804 805name: k806alignment: 16807tracksRegLiveness: true808debugInstrRef: true809liveins: 810 - { reg: '$rdi', virtual-reg: '' }811 - { reg: '$r10', virtual-reg: '' }812frameInfo: 813 stackSize: 48814 offsetAdjustment: -48815 maxAlignment: 8816 cvBytesOfCalleeSavedRegisters: 48817 localFrameSize: 0818fixedStack: 819 - { id: 0, type: spill-slot, offset: -56, size: 8, alignment: 8, stack-id: default,820 callee-saved-register: '$rbx', callee-saved-restored: true, debug-info-variable: '', 821 debug-info-expression: '', debug-info-location: '' }822 - { id: 1, type: spill-slot, offset: -48, size: 8, alignment: 16, stack-id: default,823 callee-saved-register: '$r12', callee-saved-restored: true, debug-info-variable: '', 824 debug-info-expression: '', debug-info-location: '' }825 - { id: 2, type: spill-slot, offset: -40, size: 8, alignment: 8, stack-id: default,826 callee-saved-register: '$r13', callee-saved-restored: true, debug-info-variable: '', 827 debug-info-expression: '', debug-info-location: '' }828 - { id: 3, type: spill-slot, offset: -32, size: 8, alignment: 16, stack-id: default,829 callee-saved-register: '$r14', callee-saved-restored: true, debug-info-variable: '', 830 debug-info-expression: '', debug-info-location: '' }831 - { id: 4, type: spill-slot, offset: -24, size: 8, alignment: 8, stack-id: default,832 callee-saved-register: '$r15', callee-saved-restored: true, debug-info-variable: '', 833 debug-info-expression: '', debug-info-location: '' }834 - { id: 5, type: spill-slot, offset: -16, size: 8, alignment: 16, stack-id: default,835 callee-saved-register: '$rbp', callee-saved-restored: true, debug-info-variable: '', 836 debug-info-expression: '', debug-info-location: '' }837stack: 838 - { id: 0, name: '', type: spill-slot, offset: -64, size: 8, alignment: 8, 839 stack-id: default, callee-saved-register: '', callee-saved-restored: true,840 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }841 - { id: 1, name: '', type: spill-slot, offset: -72, size: 8, alignment: 8, 842 stack-id: default, callee-saved-register: '', callee-saved-restored: true,843 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }844constants: []845body: |846 bb.0.entry:847 successors: %bb.2(0x30000000), %bb.1(0x50000000)848 liveins: $rdi, $r10, $rbx, $r12, $r13, $r14, $r15, $rbp849 850 DBG_VALUE_LIST !513, !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_plus_uconst, 1, DW_OP_LLVM_arg, 1, DW_OP_plus), $rdi, $r10, debug-location !514851 TEST64rr renamable $rdi, renamable $rdi, implicit-def $eflags, debug-location !515852 JCC_1 %bb.2, 4, implicit $eflags, debug-location !517853 854 bb.1.if.then:855 successors: %bb.2(0x80000000)856 liveins: $rdi, $r10, $rbp, $r15, $r14, $r13, $r12, $rbx857 858 frame-setup PUSH64r killed $rbp, implicit-def $rsp, implicit $rsp859 CFI_INSTRUCTION def_cfa_offset 16860 frame-setup PUSH64r killed $r15, implicit-def $rsp, implicit $rsp861 CFI_INSTRUCTION def_cfa_offset 24862 frame-setup PUSH64r killed $r14, implicit-def $rsp, implicit $rsp863 CFI_INSTRUCTION def_cfa_offset 32864 frame-setup PUSH64r killed $r13, implicit-def $rsp, implicit $rsp865 CFI_INSTRUCTION def_cfa_offset 40866 frame-setup PUSH64r killed $r12, implicit-def $rsp, implicit $rsp867 CFI_INSTRUCTION def_cfa_offset 48868 frame-setup PUSH64r killed $rbx, implicit-def $rsp, implicit $rsp869 CFI_INSTRUCTION def_cfa_offset 56870 CFI_INSTRUCTION offset $rbx, -56871 CFI_INSTRUCTION offset $r12, -48872 CFI_INSTRUCTION offset $r13, -40873 CFI_INSTRUCTION offset $r14, -32874 CFI_INSTRUCTION offset $r15, -24875 CFI_INSTRUCTION offset $rbp, -16876 MOV64mr $rsp, 1, $noreg, -8, $noreg, killed renamable $rdi :: (store (s64) into %stack.0)877 MOV64mr $rsp, 1, $noreg, -16, $noreg, killed renamable $r10 :: (store (s64) into %stack.1)878 INLINEASM &"", 1, 12, implicit-def dead early-clobber $rax, 12, implicit-def dead early-clobber $rbx, 12, implicit-def dead early-clobber $rcx, 12, implicit-def dead early-clobber $rdx, 12, implicit-def dead early-clobber $rsi, 12, implicit-def dead early-clobber $rdi, 12, implicit-def dead early-clobber $rbp, 12, implicit-def dead early-clobber $r8, 12, implicit-def dead early-clobber $r9, 12, implicit-def dead early-clobber $r10, 12, implicit-def dead early-clobber $r11, 12, implicit-def dead early-clobber $r12, 12, implicit-def dead early-clobber $r13, 12, implicit-def dead early-clobber $r14, 12, implicit-def dead early-clobber $r15, 12, implicit-def dead early-clobber $eflags, !520, debug-location !518879 renamable $rdi = MOV64rm $rsp, 1, $noreg, -8, $noreg :: (load (s64) from %stack.0)880 renamable $r10 = MOV64rm $rsp, 1, $noreg, -16, $noreg :: (load (s64) from %stack.1)881 ; Clobber stack location to force variable location to move to $rdi.882 $rax = MOV64ri 0883 MOV64mr $rsp, 1, _, -8, _, renamable $rax :: (store (s64) into %stack.0)884 MOV64mr $rsp, 1, _, -16, _, killed renamable $rax :: (store (s64) into %stack.1)885 $rbx = frame-destroy POP64r implicit-def $rsp, implicit $rsp886 CFI_INSTRUCTION def_cfa_offset 48887 $r12 = frame-destroy POP64r implicit-def $rsp, implicit $rsp888 CFI_INSTRUCTION def_cfa_offset 40889 $r13 = frame-destroy POP64r implicit-def $rsp, implicit $rsp890 CFI_INSTRUCTION def_cfa_offset 32891 $r14 = frame-destroy POP64r implicit-def $rsp, implicit $rsp892 CFI_INSTRUCTION def_cfa_offset 24893 $r15 = frame-destroy POP64r implicit-def $rsp, implicit $rsp894 CFI_INSTRUCTION def_cfa_offset 16895 $rbp = frame-destroy POP64r implicit-def $rsp, implicit $rsp896 CFI_INSTRUCTION def_cfa_offset 8897 898 bb.2.if.end:899 liveins: $rdi, $rbx, $r12, $r13, $r14, $r15, $rbp900 901 renamable $eax = MOV32rm killed renamable $rdi, 1, $noreg, 4, $noreg, debug-location !523 :: (load (s32) from %ir.add.ptr, !tbaa !24)902 RET64 $eax, debug-location !528903 904 905 906...907