1 # RUN: llc -run-pass=block-placement %s -o - | FileCheck %s
4 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
5 target triple = "x86_64-unknown-linux-gnu"
7 define void @_Z3fn1v() !dbg !6 {
9 %d = alloca i8, align 1
10 br i1 1, label %for.cond.cleanup, label %for.body
16 br i1 1, label %for.cond.cleanup, label %for.body.1
19 br i1 1, label %for.cond.cleanup, label %for.body.2
22 br i1 1, label %for.cond.cleanup, label %for.body.3
25 br i1 1, label %for.cond.cleanup, label %for.body.4
28 br i1 1, label %for.cond.cleanup, label %for.body.5
31 br i1 1, label %for.cond.cleanup, label %for.body.6
34 br i1 1, label %for.cond.cleanup, label %for.body.7
37 br i1 1, label %for.cond.cleanup, label %for.body.8
40 br i1 1, label %for.cond.cleanup, label %for.body.9
43 br i1 1, label %for.cond.cleanup, label %for.body.10
46 br i1 1, label %for.cond.cleanup, label %for.body.11
49 %d.0.d.0..12 = load volatile i8, ptr %d, align 1
50 call void @llvm.dbg.value(metadata i8 %d.0.d.0..12, metadata !16, metadata !DIExpression()), !dbg !19
51 br label %for.cond.cleanup
54 declare void @llvm.dbg.value(metadata, metadata, metadata)
57 !llvm.module.flags = !{!3, !4, !5}
59 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 7.0.0 (trunk 326606)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, globals: !2)
60 !1 = !DIFile(filename: "repro.cpp", directory: "/home/mdavis/bugs/bz-189869")
62 !3 = !{i32 2, !"Dwarf Version", i32 4}
63 !4 = !{i32 2, !"Debug Info Version", i32 3}
64 !5 = !{i32 1, !"wchar_size", i32 4}
65 !6 = distinct !DISubprogram(name: "fn1", linkageName: "_Z3fn1v", scope: !7, file: !7, line: 4, type: !8, isLocal: false, isDefinition: true, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: true, unit: !0, retainedNodes: !15)
66 !7 = !DIFile(filename: "./repro.cpp", directory: "/home/mdavis/bugs/bz-189869")
67 !8 = !DISubroutineType(types: !9)
70 !16 = !DILocalVariable(name: "d", scope: !6, file: !7, line: 6, type: !17)
71 !17 = !DIDerivedType(tag: DW_TAG_volatile_type, baseType: !18)
72 !18 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)
73 !19 = !DILocation(line: 6, column: 17, scope: !6)
77 # CHECK: name: _Z3fn1v
78 # CHECK: bb.10.for.body.9
79 # CHECK: renamable $al
80 # CHECK-NEXT: TEST8rr killed renamable $al
82 # CHECK-NOT: $al = IMPLICIT_DEF
83 # CHECK: bb.12.for.body.10
87 tracksRegLiveness: true
91 successors: %bb.1, %bb.4
92 liveins: $rdi, $rbp, $r15, $r14, $r13, $r12, $rbx
94 renamable $al = MOV8ri 1
95 TEST8rr renamable $al, renamable $al, implicit-def $eflags
96 JCC_1 %bb.4, 5, implicit killed $eflags
98 bb.1.for.cond.cleanup:
99 successors: %bb.3, %bb.2
102 renamable $eax = MOV32rm $rsp, 1, $noreg, -16, $noreg
103 CMP32rm killed renamable $eax, $rip, 1, $noreg, $noreg, $noreg, implicit-def $eflags
104 JCC_1 %bb.3, 6, implicit $eflags
108 liveins: $ebp, $ebx, $edx, $esi, $rdi, $r8d, $r9d, $r10d, $r11d, $r12d, $r13d, $r14d, $r15d
110 bb.3.for.cond.cleanup:
111 liveins: $rdi, $xmm3, $xmm4, $xmm5, $xmm6, $xmm7, $xmm9, $xmm13, $xmm14
115 successors: %bb.1, %bb.5
118 renamable $ecx = XOR32rr undef $ecx, undef $ecx, implicit-def dead $eflags
119 TEST8rr killed renamable $al, renamable $al, implicit-def $eflags
120 JCC_1 %bb.1, 5, implicit $eflags
123 successors: %bb.1, %bb.6
126 renamable $al = MOV8ri 1
127 TEST8rr killed renamable $al, renamable $al, implicit-def $eflags
128 JCC_1 %bb.1, 5, implicit $eflags
131 successors: %bb.1, %bb.7
132 liveins: $ecx, $eflags, $rdi
134 JCC_1 %bb.1, 5, implicit $eflags
137 successors: %bb.1, %bb.8
140 renamable $al = MOV8ri 1
141 TEST8rr killed renamable $al, renamable $al, implicit-def $eflags
142 JCC_1 %bb.1, 5, implicit $eflags
145 successors: %bb.1, %bb.9
146 liveins: $ecx, $eflags, $rdi
148 JCC_1 %bb.1, 5, implicit $eflags
151 successors: %bb.1, %bb.10
154 renamable $al = MOV8ri 1
155 TEST8rr killed renamable $al, renamable $al, implicit-def $eflags
156 JCC_1 %bb.1, 5, implicit $eflags
159 successors: %bb.1, %bb.11
160 liveins: $ecx, $eflags, $rdi
162 JCC_1 %bb.1, 5, implicit $eflags
165 successors: %bb.1, %bb.12
168 renamable $al = MOV8ri 1
169 TEST8rr killed renamable $al, renamable $al, implicit-def $eflags
170 JCC_1 %bb.1, 5, implicit $eflags
173 successors: %bb.1, %bb.13
174 liveins: $ecx, $eflags, $rdi
176 JCC_1 %bb.1, 5, implicit $eflags
179 successors: %bb.14, %bb.15
182 renamable $al = MOV8ri 1
183 TEST8rr killed renamable $al, renamable $al, implicit-def $eflags
184 JCC_1 %bb.15, 4, implicit $eflags
190 renamable $ecx = XOR32rr undef $ecx, undef $ecx, implicit-def dead $eflags
194 successors: %bb.16, %bb.17
195 liveins: $eflags, $rdi
197 JCC_1 %bb.17, 4, implicit killed $eflags
209 dead renamable $al = MOV8rm $rsp, 1, $noreg, -121, $noreg
210 DBG_VALUE $al, $noreg, !16, !DIExpression(), debug-location !19
211 renamable $ecx = XOR32rr undef $ecx, undef $ecx, implicit-def dead $eflags