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