1# RUN: llc -run-pass livedebugvalues -march=x86-64 -o - %s | FileCheck %s
2
3# Generated from the following source with:
4# clang -g -mllvm -stop-before=livedebugvalues -S -O2 test.c -o test.mir
5# Then more functions added to test for extra behaviours with complex
6# expressions:
7#   'g': test for a crash from PR42773
8#   'h': complex expressions should be restored
9#   'i': spills should be restored across block boundaries
10#   'j': indirect DBG_VALUEs should be indirect after restoration
11
12# #define FORCE_SPILL() \
13#   __asm volatile("" : : : \
14#                    "rax", "rbx", "rcx", "rdx", "rsi", "rdi", "rbp", "r8", \
15#                    "r9", "r10", "r11", "r12", "r13", "r14", "r15")
16# int f(int *p) {
17#   if (p) {
18#     FORCE_SPILL();
19#   }
20#   return *(p + 1);
21# }
22
23# Pick out DILocalVariable numbers for "p", "q" and "r" etc
24# CHECK: ![[PVAR:[0-9]+]] = !DILocalVariable(name: "p",
25# CHECK: ![[QVAR:[0-9]+]] = !DILocalVariable(name: "q",
26# CHECK: ![[RVAR:[0-9]+]] = !DILocalVariable(name: "r",
27# CHECK: ![[SVAR:[0-9]+]] = !DILocalVariable(name: "s",
28# CHECK: ![[TVAR:[0-9]+]] = !DILocalVariable(name: "t",
29
30# Ascertain that the spill has been recognized and manifested in a DBG_VALUE.
31# CHECK: MOV64mr $rsp,{{.*-8.*}}killed{{.*}}$rdi :: (store 8 into %stack.0)
32# CHECK-NEXT: DBG_VALUE $rsp,{{.*}}![[PVAR]],{{.*}}!DIExpression(DW_OP_constu, 8, DW_OP_minus)
33
34# Check for the restore.
35# CHECK: $rdi = MOV64rm $rsp,{{.*-8.*}}:: (load 8 from %stack.0)
36# CHECK-NEXT: DBG_VALUE $rdi,{{.*}}![[PVAR]], !DIExpression()
37
38--- |
39  define dso_local i32 @f(i32* readonly %p) local_unnamed_addr !dbg !7 {
40  entry:
41    call void @llvm.dbg.value(metadata i32* %p, metadata !13, metadata !DIExpression()), !dbg !14
42    %tobool = icmp eq i32* %p, null, !dbg !15
43    br i1 %tobool, label %if.end, label %if.then, !dbg !17
44
45  if.then:                                          ; preds = %entry
46    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 !20
47    br label %if.end, !dbg !21
48
49  if.end:                                           ; preds = %entry, %if.then
50    %add.ptr = getelementptr inbounds i32, i32* %p, i64 1, !dbg !22
51    %0 = load i32, i32* %add.ptr, align 4, !dbg !23, !tbaa !24
52    ret i32 %0, !dbg !28
53  }
54
55  define dso_local i32 @g(i32* readonly %p) local_unnamed_addr !dbg !107 {
56  entry:
57    call void @llvm.dbg.value(metadata i32* %p, metadata !113, metadata !DIExpression()), !dbg !114
58    %tobool = icmp eq i32* %p, null, !dbg !115
59    br i1 %tobool, label %if.end, label %if.then, !dbg !117
60
61  if.then:                                          ; preds = %entry
62    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 !120
63    br label %if.end, !dbg !121
64
65  if.end:                                           ; preds = %entry, %if.then
66    %add.ptr = getelementptr inbounds i32, i32* %p, i64 1, !dbg !122
67    %0 = load i32, i32* %add.ptr, align 4, !dbg !123, !tbaa !24
68    ret i32 %0, !dbg !128
69  }
70
71  define dso_local i32 @h(i32* readonly %p) local_unnamed_addr !dbg !207 {
72  entry:
73    call void @llvm.dbg.value(metadata i32* %p, metadata !213, metadata !DIExpression()), !dbg !214
74    %tobool = icmp eq i32* %p, null, !dbg !215
75    br i1 %tobool, label %if.end, label %if.then, !dbg !217
76
77  if.then:                                          ; preds = %entry
78    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 !220
79    br label %if.end, !dbg !221
80
81  if.end:                                           ; preds = %entry, %if.then
82    %add.ptr = getelementptr inbounds i32, i32* %p, i64 1, !dbg !222
83    %0 = load i32, i32* %add.ptr, align 4, !dbg !223, !tbaa !24
84    ret i32 %0, !dbg !228
85  }
86
87  define dso_local i32 @i(i32* readonly %p) local_unnamed_addr !dbg !307 {
88  entry:
89    br label %foo
90
91  foo:
92    call void @llvm.dbg.value(metadata i32* %p, metadata !313, metadata !DIExpression()), !dbg !314
93    %tobool = icmp eq i32* %p, null, !dbg !315
94    br i1 %tobool, label %if.end, label %if.then, !dbg !317
95
96  if.then:                                          ; preds = %entry
97    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 !320
98    br label %if.end, !dbg !321
99
100  if.end:                                           ; preds = %entry, %if.then
101    %add.ptr = getelementptr inbounds i32, i32* %p, i64 1, !dbg !322
102    %0 = load i32, i32* %add.ptr, align 4, !dbg !323, !tbaa !24
103    ret i32 %0, !dbg !328
104  }
105
106  define dso_local i32 @j(i32* readonly %p) local_unnamed_addr !dbg !402 {
107  entry:
108    br label %foo
109
110  foo:
111    call void @llvm.dbg.value(metadata i32* %p, metadata !404, metadata !DIExpression()), !dbg !405
112    %tobool = icmp eq i32* %p, null, !dbg !406
113    br i1 %tobool, label %if.end, label %if.then, !dbg !408
114
115  if.then:                                          ; preds = %entry
116    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 !411
117    br label %if.end, !dbg !412
118
119  if.end:                                           ; preds = %entry, %if.then
120    %add.ptr = getelementptr inbounds i32, i32* %p, i64 1, !dbg !413
121    %0 = load i32, i32* %add.ptr, align 4, !dbg !414, !tbaa !24
122    ret i32 %0, !dbg !415
123  }
124
125  declare void @llvm.dbg.value(metadata, metadata, metadata)
126
127  !llvm.dbg.cu = !{!0}
128  !llvm.module.flags = !{!3, !4, !5}
129  !llvm.ident = !{!6}
130
131  !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)
132  !1 = !DIFile(filename: "test2.c", directory: "/home/test")
133  !2 = !{}
134  !3 = !{i32 2, !"Dwarf Version", i32 4}
135  !4 = !{i32 2, !"Debug Info Version", i32 3}
136  !5 = !{i32 1, !"wchar_size", i32 4}
137  !6 = !{!"clang version 9.0.0 (https://git.llvm.org/git/clang.git/ 57a6ce7ac318de98e3e777e09cb9ed8282b5cc03) (https://git.llvm.org/git/llvm.git/ ff54a19e4912d7f15cb02798a7f2048441bff751)"}
138  !7 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 5, type: !8, scopeLine: 5, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !12)
139  !8 = !DISubroutineType(types: !9)
140  !9 = !{!10, !11}
141  !10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
142  !11 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !10, size: 64)
143  !12 = !{!13}
144  !13 = !DILocalVariable(name: "p", arg: 1, scope: !7, file: !1, line: 5, type: !11)
145  !14 = !DILocation(line: 5, column: 12, scope: !7)
146  !15 = !DILocation(line: 6, column: 7, scope: !16)
147  !16 = distinct !DILexicalBlock(scope: !7, file: !1, line: 6, column: 7)
148  !17 = !DILocation(line: 6, column: 7, scope: !7)
149  !18 = !DILocation(line: 7, column: 5, scope: !19)
150  !19 = distinct !DILexicalBlock(scope: !16, file: !1, line: 6, column: 10)
151  !20 = !{i32 -2147471544}
152  !21 = !DILocation(line: 8, column: 3, scope: !19)
153  !22 = !DILocation(line: 9, column: 14, scope: !7)
154  !23 = !DILocation(line: 9, column: 10, scope: !7)
155  !24 = !{!25, !25, i64 0}
156  !25 = !{!"int", !26, i64 0}
157  !26 = !{!"omnipotent char", !27, i64 0}
158  !27 = !{!"Simple C/C++ TBAA"}
159  !28 = !DILocation(line: 9, column: 3, scope: !7)
160  !101 = !DIBasicType(name: "looong int", size: 64, encoding: DW_ATE_signed)
161  !107 = distinct !DISubprogram(name: "g", scope: !0, file: !1, line: 105, type: !8, scopeLine: 105, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !112)
162  !112 = !{!113}
163  !113 = !DILocalVariable(name: "q", arg: 1, scope: !107, file: !1, line: 105, type: !101)
164  !114 = !DILocation(line: 105, column: 12, scope: !107)
165  !115 = !DILocation(line: 106, column: 7, scope: !116)
166  !116 = distinct !DILexicalBlock(scope: !107, file: !1, line: 106, column: 7)
167  !117 = !DILocation(line: 106, column: 7, scope: !107)
168  !118 = !DILocation(line: 107, column: 5, scope: !119)
169  !119 = distinct !DILexicalBlock(scope: !116, file: !1, line: 106, column: 10)
170  !120 = !{i32 -2147471544}
171  !121 = !DILocation(line: 108, column: 3, scope: !119)
172  !122 = !DILocation(line: 109, column: 14, scope: !107)
173  !123 = !DILocation(line: 109, column: 10, scope: !107)
174  !128 = !DILocation(line: 109, column: 3, scope: !107)
175  !201 = !DIBasicType(name: "looong int", size: 64, encoding: DW_ATE_signed)
176  !207 = distinct !DISubprogram(name: "g", scope: !0, file: !1, line: 105, type: !8, scopeLine: 105, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !212)
177  !212 = !{!213}
178  !213 = !DILocalVariable(name: "r", arg: 1, scope: !207, file: !1, line: 105, type: !201)
179  !214 = !DILocation(line: 105, column: 12, scope: !207)
180  !215 = !DILocation(line: 106, column: 7, scope: !216)
181  !216 = distinct !DILexicalBlock(scope: !207, file: !1, line: 106, column: 7)
182  !217 = !DILocation(line: 106, column: 7, scope: !207)
183  !218 = !DILocation(line: 107, column: 5, scope: !219)
184  !219 = distinct !DILexicalBlock(scope: !216, file: !1, line: 106, column: 10)
185  !220 = !{i32 -2147471544}
186  !221 = !DILocation(line: 108, column: 3, scope: !219)
187  !222 = !DILocation(line: 109, column: 14, scope: !207)
188  !223 = !DILocation(line: 109, column: 10, scope: !207)
189  !228 = !DILocation(line: 109, column: 3, scope: !207)
190  !301 = !DIBasicType(name: "looong int", size: 64, encoding: DW_ATE_signed)
191  !307 = distinct !DISubprogram(name: "g", scope: !0, file: !1, line: 105, type: !8, scopeLine: 105, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !312)
192  !312 = !{!313}
193  !313 = !DILocalVariable(name: "s", arg: 1, scope: !307, file: !1, line: 105, type: !301)
194  !314 = !DILocation(line: 105, column: 12, scope: !307)
195  !315 = !DILocation(line: 106, column: 7, scope: !316)
196  !316 = distinct !DILexicalBlock(scope: !307, file: !1, line: 106, column: 7)
197  !317 = !DILocation(line: 106, column: 7, scope: !307)
198  !318 = !DILocation(line: 107, column: 5, scope: !319)
199  !319 = distinct !DILexicalBlock(scope: !316, file: !1, line: 106, column: 10)
200  !320 = !{i32 -2147471544}
201  !321 = !DILocation(line: 108, column: 3, scope: !319)
202  !322 = !DILocation(line: 109, column: 14, scope: !307)
203  !323 = !DILocation(line: 109, column: 10, scope: !307)
204  !328 = !DILocation(line: 109, column: 3, scope: !307)
205  !401 = !DIBasicType(name: "looong int", size: 64, encoding: DW_ATE_signed)
206  !402 = distinct !DISubprogram(name: "j", scope: !0, file: !1, line: 105, type: !8, scopeLine: 105, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !403)
207  !403 = !{!404}
208  !404 = !DILocalVariable(name: "t", arg: 1, scope: !402, file: !1, line: 105, type: !401)
209  !405 = !DILocation(line: 105, column: 12, scope: !402)
210  !406 = !DILocation(line: 106, column: 7, scope: !407)
211  !407 = distinct !DILexicalBlock(scope: !402, file: !1, line: 106, column: 7)
212  !408 = !DILocation(line: 106, column: 7, scope: !402)
213  !409 = !DILocation(line: 107, column: 5, scope: !410)
214  !410 = distinct !DILexicalBlock(scope: !407, file: !1, line: 106, column: 10)
215  !411 = !{i32 -2147471544}
216  !412 = !DILocation(line: 108, column: 3, scope: !410)
217  !413 = !DILocation(line: 109, column: 14, scope: !402)
218  !414 = !DILocation(line: 109, column: 10, scope: !402)
219  !415 = !DILocation(line: 109, column: 3, scope: !402)
220...
221---
222name:            f
223alignment:       16
224exposesReturnsTwice: false
225legalized:       false
226regBankSelected: false
227selected:        false
228failedISel:      false
229tracksRegLiveness: true
230hasWinCFI:       false
231registers:       []
232liveins:
233  - { reg: '$rdi', virtual-reg: '' }
234frameInfo:
235  isFrameAddressTaken: false
236  isReturnAddressTaken: false
237  hasStackMap:     false
238  hasPatchPoint:   false
239  stackSize:       48
240  offsetAdjustment: -48
241  maxAlignment:    8
242  adjustsStack:    false
243  hasCalls:        false
244  stackProtector:  ''
245  maxCallFrameSize: 0
246  cvBytesOfCalleeSavedRegisters: 48
247  hasOpaqueSPAdjustment: false
248  hasVAStart:      false
249  hasMustTailInVarArgFunc: false
250  localFrameSize:  0
251  savePoint:       ''
252  restorePoint:    ''
253fixedStack:
254  - { id: 0, type: spill-slot, offset: -56, size: 8, alignment: 8, stack-id: default,
255      callee-saved-register: '$rbx', callee-saved-restored: true, debug-info-variable: '',
256      debug-info-expression: '', debug-info-location: '' }
257  - { id: 1, type: spill-slot, offset: -48, size: 8, alignment: 16, stack-id: default,
258      callee-saved-register: '$r12', callee-saved-restored: true, debug-info-variable: '',
259      debug-info-expression: '', debug-info-location: '' }
260  - { id: 2, type: spill-slot, offset: -40, size: 8, alignment: 8, stack-id: default,
261      callee-saved-register: '$r13', callee-saved-restored: true, debug-info-variable: '',
262      debug-info-expression: '', debug-info-location: '' }
263  - { id: 3, type: spill-slot, offset: -32, size: 8, alignment: 16, stack-id: default,
264      callee-saved-register: '$r14', callee-saved-restored: true, debug-info-variable: '',
265      debug-info-expression: '', debug-info-location: '' }
266  - { id: 4, type: spill-slot, offset: -24, size: 8, alignment: 8, stack-id: default,
267      callee-saved-register: '$r15', callee-saved-restored: true, debug-info-variable: '',
268      debug-info-expression: '', debug-info-location: '' }
269  - { id: 5, type: spill-slot, offset: -16, size: 8, alignment: 16, stack-id: default,
270      callee-saved-register: '$rbp', callee-saved-restored: true, debug-info-variable: '',
271      debug-info-expression: '', debug-info-location: '' }
272stack:
273  - { id: 0, name: '', type: spill-slot, offset: -64, size: 8, alignment: 8,
274      stack-id: default, callee-saved-register: '', callee-saved-restored: true,
275      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
276constants:       []
277body:             |
278  bb.0.entry:
279    successors: %bb.2(0x30000000), %bb.1(0x50000000)
280    liveins: $rdi, $rbx, $r12, $r13, $r14, $r15, $rbp
281
282    DBG_VALUE $rdi, $noreg, !13, !DIExpression(), debug-location !14
283    DBG_VALUE $rdi, $noreg, !13, !DIExpression(), debug-location !14
284    TEST64rr renamable $rdi, renamable $rdi, implicit-def $eflags, debug-location !15
285    JCC_1 %bb.2, 4, implicit $eflags, debug-location !17
286
287  bb.1.if.then:
288    successors: %bb.2(0x80000000)
289    liveins: $rdi, $rbp, $r15, $r14, $r13, $r12, $rbx
290
291    frame-setup PUSH64r killed $rbp, implicit-def $rsp, implicit $rsp
292    CFI_INSTRUCTION def_cfa_offset 16
293    frame-setup PUSH64r killed $r15, implicit-def $rsp, implicit $rsp
294    CFI_INSTRUCTION def_cfa_offset 24
295    frame-setup PUSH64r killed $r14, implicit-def $rsp, implicit $rsp
296    CFI_INSTRUCTION def_cfa_offset 32
297    frame-setup PUSH64r killed $r13, implicit-def $rsp, implicit $rsp
298    CFI_INSTRUCTION def_cfa_offset 40
299    frame-setup PUSH64r killed $r12, implicit-def $rsp, implicit $rsp
300    CFI_INSTRUCTION def_cfa_offset 48
301    frame-setup PUSH64r killed $rbx, implicit-def $rsp, implicit $rsp
302    CFI_INSTRUCTION def_cfa_offset 56
303    CFI_INSTRUCTION offset $rbx, -56
304    CFI_INSTRUCTION offset $r12, -48
305    CFI_INSTRUCTION offset $r13, -40
306    CFI_INSTRUCTION offset $r14, -32
307    CFI_INSTRUCTION offset $r15, -24
308    CFI_INSTRUCTION offset $rbp, -16
309    MOV64mr $rsp, 1, $noreg, -8, $noreg, killed renamable $rdi :: (store 8 into %stack.0)
310    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 !18
311    renamable $rdi = MOV64rm $rsp, 1, $noreg, -8, $noreg :: (load 8 from %stack.0)
312    $rbx = frame-destroy POP64r implicit-def $rsp, implicit $rsp
313    CFI_INSTRUCTION def_cfa_offset 48
314    $r12 = frame-destroy POP64r implicit-def $rsp, implicit $rsp
315    CFI_INSTRUCTION def_cfa_offset 40
316    $r13 = frame-destroy POP64r implicit-def $rsp, implicit $rsp
317    CFI_INSTRUCTION def_cfa_offset 32
318    $r14 = frame-destroy POP64r implicit-def $rsp, implicit $rsp
319    CFI_INSTRUCTION def_cfa_offset 24
320    $r15 = frame-destroy POP64r implicit-def $rsp, implicit $rsp
321    CFI_INSTRUCTION def_cfa_offset 16
322    $rbp = frame-destroy POP64r implicit-def $rsp, implicit $rsp
323    CFI_INSTRUCTION def_cfa_offset 8
324
325  bb.2.if.end:
326    liveins: $rdi, $rbx, $r12, $r13, $r14, $r15, $rbp
327
328    renamable $eax = MOV32rm killed renamable $rdi, 1, $noreg, 4, $noreg, debug-location !23 :: (load 4 from %ir.add.ptr, !tbaa !24)
329    RETQ $eax, debug-location !28
330
331...
332---
333# This second function has been appended as a regression test against a
334# crash, caused by expressions being created from spill restores that did
335# not preserve fragment information. Test that no empty expressions are
336# created at all, and the last block describes both variable fragments.
337
338# CHECK-LABEL: name: g
339# CHECK-NOT: !DIExpression()
340# CHECK-LABEL: bb.2.if.end:
341# CHECK:       DBG_VALUE $rdi, $noreg, ![[QVAR]], !DIExpression(DW_OP_LLVM_fragment, 0, 32)
342# CHECK-NEXT:  DBG_VALUE $rbx, $noreg, ![[QVAR]], !DIExpression(DW_OP_LLVM_fragment, 32, 32)
343
344name:            g
345alignment:       16
346tracksRegLiveness: true
347liveins:
348  - { reg: '$rdi', virtual-reg: '' }
349frameInfo:
350  stackSize:       48
351  offsetAdjustment: -48
352  maxAlignment:    8
353  cvBytesOfCalleeSavedRegisters: 48
354  localFrameSize:  0
355fixedStack:
356  - { id: 0, type: spill-slot, offset: -56, size: 8, alignment: 8, stack-id: default,
357      callee-saved-register: '$rbx', callee-saved-restored: true, debug-info-variable: '',
358      debug-info-expression: '', debug-info-location: '' }
359  - { id: 1, type: spill-slot, offset: -48, size: 8, alignment: 16, stack-id: default,
360      callee-saved-register: '$r12', callee-saved-restored: true, debug-info-variable: '',
361      debug-info-expression: '', debug-info-location: '' }
362  - { id: 2, type: spill-slot, offset: -40, size: 8, alignment: 8, stack-id: default,
363      callee-saved-register: '$r13', callee-saved-restored: true, debug-info-variable: '',
364      debug-info-expression: '', debug-info-location: '' }
365  - { id: 3, type: spill-slot, offset: -32, size: 8, alignment: 16, stack-id: default,
366      callee-saved-register: '$r14', callee-saved-restored: true, debug-info-variable: '',
367      debug-info-expression: '', debug-info-location: '' }
368  - { id: 4, type: spill-slot, offset: -24, size: 8, alignment: 8, stack-id: default,
369      callee-saved-register: '$r15', callee-saved-restored: true, debug-info-variable: '',
370      debug-info-expression: '', debug-info-location: '' }
371  - { id: 5, type: spill-slot, offset: -16, size: 8, alignment: 16, stack-id: default,
372      callee-saved-register: '$rbp', callee-saved-restored: true, debug-info-variable: '',
373      debug-info-expression: '', debug-info-location: '' }
374stack:
375  - { id: 0, name: '', type: spill-slot, offset: -64, size: 8, alignment: 8,
376      stack-id: default, callee-saved-register: '', callee-saved-restored: true,
377      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
378constants:       []
379body:             |
380  bb.0.entry:
381    successors: %bb.1(0x50000000)
382    liveins: $rdi, $rbx, $r12, $r13, $r14, $r15, $rbp
383
384    DBG_VALUE $rdi, $noreg, !113, !DIExpression(DW_OP_LLVM_fragment, 0, 32), debug-location !114
385    TEST64rr renamable $rdi, renamable $rdi, implicit-def $eflags, debug-location !115
386    JMP_1 %bb.1, implicit $eflags, debug-location !117
387
388  bb.1.if.then:
389    successors: %bb.2(0x80000000)
390    liveins: $rdi, $rbp, $r15, $r14, $r13, $r12, $rbx
391
392    MOV64mr $rsp, 1, $noreg, -8, $noreg, killed renamable $rdi :: (store 8 into %stack.0)
393    renamable $rdi = MOV64rm $rsp, 1, $noreg, -8, $noreg :: (load 8 from %stack.0)
394
395  bb.2.if.end:
396    liveins: $rdi, $rbx, $r12, $r13, $r14, $r15, $rbp
397
398    DBG_VALUE $rbx, $noreg, !113, !DIExpression(DW_OP_LLVM_fragment, 32, 32), debug-location !114
399    MOV64mr $rsp, 1, $noreg, -8, $noreg, killed renamable $rbx :: (store 8 into %stack.0)
400    renamable $rsi = MOV64rm $rsp, 1, $noreg, -8, $noreg :: (load 8 from %stack.0)
401
402    renamable $eax = MOV32rm killed renamable $rsi, 1, $noreg, 4, $noreg, debug-location !123 :: (load 4 from %ir.add.ptr, !tbaa !24)
403    $rdi = MOV64ri 0
404    RETQ $eax, debug-location !128
405
406...
407---
408# This third function tests that complex expressions are spilt, and restored
409# correctly within a basic block.
410
411# FIXME: the spilt location below is wrong, there should be a deref between
412# the spill-offset and the DW_OP_plus_uconst.
413
414# CHECK-LABEL: name: h
415# CHECK-LABEL: bb.0.entry:
416# CHECK:       DBG_VALUE $rdi, $noreg, ![[RVAR]], !DIExpression(DW_OP_plus_uconst, 1)
417# CHECK-LABEL: bb.1.if.then:
418# CHECK:       DBG_VALUE $rdi, $noreg, ![[RVAR]], !DIExpression(DW_OP_plus_uconst, 1)
419# CHECK:       DBG_VALUE $rsp, 0, ![[RVAR]], !DIExpression(DW_OP_constu, 8, DW_OP_minus, DW_OP_plus_uconst, 1)
420# CHECK:       DBG_VALUE $rdi, $noreg, ![[RVAR]], !DIExpression(DW_OP_plus_uconst, 1)
421# CHECK-LABEL: bb.2.if.end:
422# CHECK:       DBG_VALUE $rdi, $noreg, ![[RVAR]], !DIExpression(DW_OP_plus_uconst, 1)
423
424name:            h
425alignment:       16
426tracksRegLiveness: true
427liveins:
428  - { reg: '$rdi', virtual-reg: '' }
429frameInfo:
430  stackSize:       48
431  offsetAdjustment: -48
432  maxAlignment:    8
433  cvBytesOfCalleeSavedRegisters: 48
434  localFrameSize:  0
435fixedStack:
436  - { id: 0, type: spill-slot, offset: -56, size: 8, alignment: 8, stack-id: default,
437      callee-saved-register: '$rbx', callee-saved-restored: true, debug-info-variable: '',
438      debug-info-expression: '', debug-info-location: '' }
439  - { id: 1, type: spill-slot, offset: -48, size: 8, alignment: 16, stack-id: default,
440      callee-saved-register: '$r12', callee-saved-restored: true, debug-info-variable: '',
441      debug-info-expression: '', debug-info-location: '' }
442  - { id: 2, type: spill-slot, offset: -40, size: 8, alignment: 8, stack-id: default,
443      callee-saved-register: '$r13', callee-saved-restored: true, debug-info-variable: '',
444      debug-info-expression: '', debug-info-location: '' }
445  - { id: 3, type: spill-slot, offset: -32, size: 8, alignment: 16, stack-id: default,
446      callee-saved-register: '$r14', callee-saved-restored: true, debug-info-variable: '',
447      debug-info-expression: '', debug-info-location: '' }
448  - { id: 4, type: spill-slot, offset: -24, size: 8, alignment: 8, stack-id: default,
449      callee-saved-register: '$r15', callee-saved-restored: true, debug-info-variable: '',
450      debug-info-expression: '', debug-info-location: '' }
451  - { id: 5, type: spill-slot, offset: -16, size: 8, alignment: 16, stack-id: default,
452      callee-saved-register: '$rbp', callee-saved-restored: true, debug-info-variable: '',
453      debug-info-expression: '', debug-info-location: '' }
454stack:
455  - { id: 0, name: '', type: spill-slot, offset: -64, size: 8, alignment: 8,
456      stack-id: default, callee-saved-register: '', callee-saved-restored: true,
457      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
458constants:       []
459body:             |
460  bb.0.entry:
461    successors: %bb.2(0x30000000), %bb.1(0x50000000)
462    liveins: $rdi, $rbx, $r12, $r13, $r14, $r15, $rbp
463
464    DBG_VALUE $rdi, $noreg, !213, !DIExpression(DW_OP_plus_uconst, 1), debug-location !214
465    TEST64rr renamable $rdi, renamable $rdi, implicit-def $eflags, debug-location !215
466    JCC_1 %bb.2, 4, implicit $eflags, debug-location !217
467
468  bb.1.if.then:
469    successors: %bb.2(0x80000000)
470    liveins: $rdi, $rbp, $r15, $r14, $r13, $r12, $rbx
471
472    frame-setup PUSH64r killed $rbp, implicit-def $rsp, implicit $rsp
473    CFI_INSTRUCTION def_cfa_offset 16
474    frame-setup PUSH64r killed $r15, implicit-def $rsp, implicit $rsp
475    CFI_INSTRUCTION def_cfa_offset 24
476    frame-setup PUSH64r killed $r14, implicit-def $rsp, implicit $rsp
477    CFI_INSTRUCTION def_cfa_offset 32
478    frame-setup PUSH64r killed $r13, implicit-def $rsp, implicit $rsp
479    CFI_INSTRUCTION def_cfa_offset 40
480    frame-setup PUSH64r killed $r12, implicit-def $rsp, implicit $rsp
481    CFI_INSTRUCTION def_cfa_offset 48
482    frame-setup PUSH64r killed $rbx, implicit-def $rsp, implicit $rsp
483    CFI_INSTRUCTION def_cfa_offset 56
484    CFI_INSTRUCTION offset $rbx, -56
485    CFI_INSTRUCTION offset $r12, -48
486    CFI_INSTRUCTION offset $r13, -40
487    CFI_INSTRUCTION offset $r14, -32
488    CFI_INSTRUCTION offset $r15, -24
489    CFI_INSTRUCTION offset $rbp, -16
490    MOV64mr $rsp, 1, $noreg, -8, $noreg, killed renamable $rdi :: (store 8 into %stack.0)
491    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 !218
492    renamable $rdi = MOV64rm $rsp, 1, $noreg, -8, $noreg :: (load 8 from %stack.0)
493    $rbx = frame-destroy POP64r implicit-def $rsp, implicit $rsp
494    CFI_INSTRUCTION def_cfa_offset 48
495    $r12 = frame-destroy POP64r implicit-def $rsp, implicit $rsp
496    CFI_INSTRUCTION def_cfa_offset 40
497    $r13 = frame-destroy POP64r implicit-def $rsp, implicit $rsp
498    CFI_INSTRUCTION def_cfa_offset 32
499    $r14 = frame-destroy POP64r implicit-def $rsp, implicit $rsp
500    CFI_INSTRUCTION def_cfa_offset 24
501    $r15 = frame-destroy POP64r implicit-def $rsp, implicit $rsp
502    CFI_INSTRUCTION def_cfa_offset 16
503    $rbp = frame-destroy POP64r implicit-def $rsp, implicit $rsp
504    CFI_INSTRUCTION def_cfa_offset 8
505
506  bb.2.if.end:
507    liveins: $rdi, $rbx, $r12, $r13, $r14, $r15, $rbp
508
509    renamable $eax = MOV32rm killed renamable $rdi, 1, $noreg, 4, $noreg, debug-location !223 :: (load 4 from %ir.add.ptr, !tbaa !24)
510    RETQ $eax, debug-location !228
511
512
513
514...
515---
516# Function four: test that spill restores are detected across block
517# boundaries. The spill has been moved to bb.1, children of which are
518# bb 2 and 3, neither of which modifies the stack loc. The exit block (3)
519# should still be tracking the spill, and restore it on stack load.
520
521# FIXME: this test too contains a broken spill location.
522
523# Summary: loc is in $rdi in bb0, spills to stack in bb1, remains in stack
524# in bb2, starts in stack then loaded in bb3.
525
526# CHECK-LABEL: name: i
527# CHECK-LABEL: bb.0.entry:
528# CHECK:       DBG_VALUE $rdi, $noreg, ![[SVAR]], !DIExpression(DW_OP_plus_uconst, 1)
529# CHECK-LABEL: bb.1.foo:
530# CHECK:       DBG_VALUE $rdi, $noreg, ![[SVAR]], !DIExpression(DW_OP_plus_uconst, 1)
531# CHECK:       DBG_VALUE $rsp, 0, ![[SVAR]], !DIExpression(DW_OP_constu, 8, DW_OP_minus, DW_OP_plus_uconst, 1)
532# CHECK-LABEL: bb.2.if.then:
533# CHECK:       DBG_VALUE $rsp, 0, ![[SVAR]], !DIExpression(DW_OP_constu, 8, DW_OP_minus, DW_OP_plus_uconst, 1)
534# CHECK-LABEL: bb.3.if.end
535# CHECK:       DBG_VALUE $rsp, 0, ![[SVAR]], !DIExpression(DW_OP_constu, 8, DW_OP_minus, DW_OP_plus_uconst, 1)
536# CHECK:       DBG_VALUE $rdi, $noreg, ![[SVAR]], !DIExpression(DW_OP_plus_uconst, 1)
537name:            i
538alignment:       16
539tracksRegLiveness: true
540liveins:
541  - { reg: '$rdi', virtual-reg: '' }
542frameInfo:
543  stackSize:       48
544  offsetAdjustment: -48
545  maxAlignment:    8
546  cvBytesOfCalleeSavedRegisters: 48
547  localFrameSize:  0
548fixedStack:
549  - { id: 0, type: spill-slot, offset: -56, size: 8, alignment: 8, stack-id: default,
550      callee-saved-register: '$rbx', callee-saved-restored: true, debug-info-variable: '',
551      debug-info-expression: '', debug-info-location: '' }
552  - { id: 1, type: spill-slot, offset: -48, size: 8, alignment: 16, stack-id: default,
553      callee-saved-register: '$r12', callee-saved-restored: true, debug-info-variable: '',
554      debug-info-expression: '', debug-info-location: '' }
555  - { id: 2, type: spill-slot, offset: -40, size: 8, alignment: 8, stack-id: default,
556      callee-saved-register: '$r13', callee-saved-restored: true, debug-info-variable: '',
557      debug-info-expression: '', debug-info-location: '' }
558  - { id: 3, type: spill-slot, offset: -32, size: 8, alignment: 16, stack-id: default,
559      callee-saved-register: '$r14', callee-saved-restored: true, debug-info-variable: '',
560      debug-info-expression: '', debug-info-location: '' }
561  - { id: 4, type: spill-slot, offset: -24, size: 8, alignment: 8, stack-id: default,
562      callee-saved-register: '$r15', callee-saved-restored: true, debug-info-variable: '',
563      debug-info-expression: '', debug-info-location: '' }
564  - { id: 5, type: spill-slot, offset: -16, size: 8, alignment: 16, stack-id: default,
565      callee-saved-register: '$rbp', callee-saved-restored: true, debug-info-variable: '',
566      debug-info-expression: '', debug-info-location: '' }
567stack:
568  - { id: 0, name: '', type: spill-slot, offset: -64, size: 8, alignment: 8,
569      stack-id: default, callee-saved-register: '', callee-saved-restored: true,
570      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
571constants:       []
572body:             |
573  bb.0.entry:
574    successors: %bb.1
575    liveins: $rdi, $rbx, $r12, $r13, $r14, $r15, $rbp
576
577    DBG_VALUE $rdi, $noreg, !313, !DIExpression(DW_OP_plus_uconst, 1), debug-location !314
578    JMP_1 %bb.1, debug-location !317
579
580  bb.1.foo:
581    successors: %bb.3(0x30000000), %bb.2(0x50000000)
582    liveins: $rdi, $rbx, $r12, $r13, $r14, $r15, $rbp
583
584    $rax = COPY $rdi
585    MOV64mr $rsp, 1, $noreg, -8, $noreg, killed renamable $rdi :: (store 8 into %stack.0)
586    $rdi = MOV64ri 0
587    TEST64rr $rax, renamable $rax, implicit-def $eflags, debug-location !315
588    JCC_1 %bb.3, 4, implicit $eflags, debug-location !317
589
590  bb.2.if.then:
591    successors: %bb.3(0x80000000)
592    liveins: $rbp, $r15, $r14, $r13, $r12, $rbx
593
594    frame-setup PUSH64r killed $rbp, implicit-def $rsp, implicit $rsp
595    CFI_INSTRUCTION def_cfa_offset 16
596    frame-setup PUSH64r killed $r15, implicit-def $rsp, implicit $rsp
597    CFI_INSTRUCTION def_cfa_offset 24
598    frame-setup PUSH64r killed $r14, implicit-def $rsp, implicit $rsp
599    CFI_INSTRUCTION def_cfa_offset 32
600    frame-setup PUSH64r killed $r13, implicit-def $rsp, implicit $rsp
601    CFI_INSTRUCTION def_cfa_offset 40
602    frame-setup PUSH64r killed $r12, implicit-def $rsp, implicit $rsp
603    CFI_INSTRUCTION def_cfa_offset 48
604    frame-setup PUSH64r killed $rbx, implicit-def $rsp, implicit $rsp
605    CFI_INSTRUCTION def_cfa_offset 56
606    CFI_INSTRUCTION offset $rbx, -56
607    CFI_INSTRUCTION offset $r12, -48
608    CFI_INSTRUCTION offset $r13, -40
609    CFI_INSTRUCTION offset $r14, -32
610    CFI_INSTRUCTION offset $r15, -24
611    CFI_INSTRUCTION offset $rbp, -16
612    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 !318
613    $rbx = frame-destroy POP64r implicit-def $rsp, implicit $rsp
614    CFI_INSTRUCTION def_cfa_offset 48
615    $r12 = frame-destroy POP64r implicit-def $rsp, implicit $rsp
616    CFI_INSTRUCTION def_cfa_offset 40
617    $r13 = frame-destroy POP64r implicit-def $rsp, implicit $rsp
618    CFI_INSTRUCTION def_cfa_offset 32
619    $r14 = frame-destroy POP64r implicit-def $rsp, implicit $rsp
620    CFI_INSTRUCTION def_cfa_offset 24
621    $r15 = frame-destroy POP64r implicit-def $rsp, implicit $rsp
622    CFI_INSTRUCTION def_cfa_offset 16
623    $rbp = frame-destroy POP64r implicit-def $rsp, implicit $rsp
624    CFI_INSTRUCTION def_cfa_offset 8
625
626  bb.3.if.end:
627    liveins: $rbx, $r12, $r13, $r14, $r15, $rbp
628
629    renamable $rdi = MOV64rm $rsp, 1, $noreg, -8, $noreg :: (load 8 from %stack.0)
630    renamable $eax = MOV32rm killed renamable $rdi, 1, $noreg, 4, $noreg, debug-location !323 :: (load 4 from %ir.add.ptr, !tbaa !24)
631    RETQ $eax, debug-location !328
632
633...
634---
635# Test that if an unspilt DBG_VALUE starts as an indirect DBG_VALUE, then it
636# is restored as an indirect DBG_VALUE. FIXME: Note that for the intervening
637# period of being a spilt location there is still a missing layer of
638# indirection.
639
640# CHECK-LABEL: name: j
641# CHECK-LABEL: bb.0.entry:
642# CHECK:       DBG_VALUE $rdi, 0, ![[TVAR]], !DIExpression()
643# CHECK-LABEL: bb.1.if.then:
644# CHECK:       DBG_VALUE $rsp, 0, ![[TVAR]], !DIExpression(DW_OP_constu, 8, DW_OP_minus)
645# CHECK:       INLINEASM
646# CHECK:       DBG_VALUE ${{[a-zA-Z0-9]+}}, 0, ![[TVAR]], !DIExpression()
647# CHECK-LABEL: bb.2.if.end
648
649name:            j
650tracksRegLiveness: true
651liveins:
652  - { reg: '$rdi', virtual-reg: '' }
653frameInfo:
654  stackSize:       48
655  offsetAdjustment: -48
656  maxAlignment:    8
657  cvBytesOfCalleeSavedRegisters: 48
658fixedStack:
659  - { id: 0, type: spill-slot, offset: -56, size: 8, alignment: 8, stack-id: default,
660      callee-saved-register: '$rbx', callee-saved-restored: true, debug-info-variable: '',
661      debug-info-expression: '', debug-info-location: '' }
662  - { id: 1, type: spill-slot, offset: -48, size: 8, alignment: 16, stack-id: default,
663      callee-saved-register: '$r12', callee-saved-restored: true, debug-info-variable: '',
664      debug-info-expression: '', debug-info-location: '' }
665  - { id: 2, type: spill-slot, offset: -40, size: 8, alignment: 8, stack-id: default,
666      callee-saved-register: '$r13', callee-saved-restored: true, debug-info-variable: '',
667      debug-info-expression: '', debug-info-location: '' }
668  - { id: 3, type: spill-slot, offset: -32, size: 8, alignment: 16, stack-id: default,
669      callee-saved-register: '$r14', callee-saved-restored: true, debug-info-variable: '',
670      debug-info-expression: '', debug-info-location: '' }
671  - { id: 4, type: spill-slot, offset: -24, size: 8, alignment: 8, stack-id: default,
672      callee-saved-register: '$r15', callee-saved-restored: true, debug-info-variable: '',
673      debug-info-expression: '', debug-info-location: '' }
674  - { id: 5, type: spill-slot, offset: -16, size: 8, alignment: 16, stack-id: default,
675      callee-saved-register: '$rbp', callee-saved-restored: true, debug-info-variable: '',
676      debug-info-expression: '', debug-info-location: '' }
677stack:
678  - { id: 0, name: '', type: spill-slot, offset: -64, size: 8, alignment: 8,
679      stack-id: default, callee-saved-register: '', callee-saved-restored: true,
680      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
681constants:       []
682body:             |
683  bb.0.entry:
684    successors: %bb.2, %bb.1
685    liveins: $rdi, $rbx, $r12, $r13, $r14, $r15, $rbp
686
687    DBG_VALUE $rdi, 0, !404, !DIExpression(), debug-location !405
688    DBG_VALUE $rdi, 0, !404, !DIExpression(), debug-location !405
689    TEST64rr renamable $rdi, renamable $rdi, implicit-def $eflags, debug-location !406
690    JCC_1 %bb.2, 4, implicit $eflags, debug-location !408
691
692  bb.1.if.then:
693    successors: %bb.2
694    liveins: $rdi, $rbp, $r15, $r14, $r13, $r12, $rbx
695
696    frame-setup PUSH64r killed $rbp, implicit-def $rsp, implicit $rsp
697    CFI_INSTRUCTION def_cfa_offset 16
698    frame-setup PUSH64r killed $r15, implicit-def $rsp, implicit $rsp
699    CFI_INSTRUCTION def_cfa_offset 24
700    frame-setup PUSH64r killed $r14, implicit-def $rsp, implicit $rsp
701    CFI_INSTRUCTION def_cfa_offset 32
702    frame-setup PUSH64r killed $r13, implicit-def $rsp, implicit $rsp
703    CFI_INSTRUCTION def_cfa_offset 40
704    frame-setup PUSH64r killed $r12, implicit-def $rsp, implicit $rsp
705    CFI_INSTRUCTION def_cfa_offset 48
706    frame-setup PUSH64r killed $rbx, implicit-def $rsp, implicit $rsp
707    CFI_INSTRUCTION def_cfa_offset 56
708    CFI_INSTRUCTION offset $rbx, -56
709    CFI_INSTRUCTION offset $r12, -48
710    CFI_INSTRUCTION offset $r13, -40
711    CFI_INSTRUCTION offset $r14, -32
712    CFI_INSTRUCTION offset $r15, -24
713    CFI_INSTRUCTION offset $rbp, -16
714    MOV64mr $rsp, 1, $noreg, -8, $noreg, killed renamable $rdi :: (store 8 into %stack.0)
715    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 !409
716    renamable $rdi = MOV64rm $rsp, 1, $noreg, -8, $noreg :: (load 8 from %stack.0)
717    $rbx = frame-destroy POP64r implicit-def $rsp, implicit $rsp
718    CFI_INSTRUCTION def_cfa_offset 48
719    $r12 = frame-destroy POP64r implicit-def $rsp, implicit $rsp
720    CFI_INSTRUCTION def_cfa_offset 40
721    $r13 = frame-destroy POP64r implicit-def $rsp, implicit $rsp
722    CFI_INSTRUCTION def_cfa_offset 32
723    $r14 = frame-destroy POP64r implicit-def $rsp, implicit $rsp
724    CFI_INSTRUCTION def_cfa_offset 24
725    $r15 = frame-destroy POP64r implicit-def $rsp, implicit $rsp
726    CFI_INSTRUCTION def_cfa_offset 16
727    $rbp = frame-destroy POP64r implicit-def $rsp, implicit $rsp
728    CFI_INSTRUCTION def_cfa_offset 8
729
730  bb.2.if.end:
731    liveins: $rdi, $rbx, $r12, $r13, $r14, $r15, $rbp
732
733    renamable $eax = MOV32rm killed renamable $rdi, 1, $noreg, 4, $noreg, debug-location !414 :: (load 4 from %ir.add.ptr, !tbaa !24)
734    RETQ $eax, debug-location !415
735
736...
737