1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-apple-macosx -regalloc=greedy | FileCheck %s
4 ; This testing case is reduced from 254.gap SyFgets function.
5 ; We make sure a spill is hoisted to a cold BB inside the hotter outer loop.
7 %struct.TMP.1 = type { ptr, ptr, [1024 x i8] }
8 %struct.TMP.2 = type { ptr, i32, i32, i16, i16, %struct.TMP.3, i32, ptr, ptr, ptr, ptr, ptr, %struct.TMP.3, ptr, i32, [3 x i8], [1 x i8], %struct.TMP.3, i32, i64 }
9 %struct.TMP.4 = type opaque
10 %struct.TMP.3 = type { ptr, i32 }
12 @syBuf = external global [16 x %struct.TMP.1], align 16
13 @syHistory = external global [8192 x i8], align 16
14 @SyFgets.yank = external global [512 x i8], align 16
15 @syCTRO = external global i32, align 4
17 define ptr @SyFgets(ptr %line, i64 %length, i64 %fid) {
18 ; CHECK-LABEL: SyFgets:
19 ; CHECK: ## %bb.0: ## %entry
20 ; CHECK-NEXT: pushq %rbp
21 ; CHECK-NEXT: .cfi_def_cfa_offset 16
22 ; CHECK-NEXT: pushq %r15
23 ; CHECK-NEXT: .cfi_def_cfa_offset 24
24 ; CHECK-NEXT: pushq %r14
25 ; CHECK-NEXT: .cfi_def_cfa_offset 32
26 ; CHECK-NEXT: pushq %r13
27 ; CHECK-NEXT: .cfi_def_cfa_offset 40
28 ; CHECK-NEXT: pushq %r12
29 ; CHECK-NEXT: .cfi_def_cfa_offset 48
30 ; CHECK-NEXT: pushq %rbx
31 ; CHECK-NEXT: .cfi_def_cfa_offset 56
32 ; CHECK-NEXT: subq $552, %rsp ## imm = 0x228
33 ; CHECK-NEXT: .cfi_def_cfa_offset 608
34 ; CHECK-NEXT: .cfi_offset %rbx, -56
35 ; CHECK-NEXT: .cfi_offset %r12, -48
36 ; CHECK-NEXT: .cfi_offset %r13, -40
37 ; CHECK-NEXT: .cfi_offset %r14, -32
38 ; CHECK-NEXT: .cfi_offset %r15, -24
39 ; CHECK-NEXT: .cfi_offset %rbp, -16
40 ; CHECK-NEXT: testq $-3, %rdx
41 ; CHECK-NEXT: jne LBB0_4
42 ; CHECK-NEXT: ## %bb.1: ## %if.end
43 ; CHECK-NEXT: xorl %eax, %eax
44 ; CHECK-NEXT: testb %al, %al
45 ; CHECK-NEXT: jne LBB0_5
46 ; CHECK-NEXT: ## %bb.2: ## %if.then4
47 ; CHECK-NEXT: xorl %eax, %eax
48 ; CHECK-NEXT: testb %al, %al
49 ; CHECK-NEXT: je LBB0_54
50 ; CHECK-NEXT: ## %bb.3: ## %SyTime.exit
51 ; CHECK-NEXT: xorl %eax, %eax
52 ; CHECK-NEXT: testb %al, %al
53 ; CHECK-NEXT: je LBB0_54
54 ; CHECK-NEXT: LBB0_4: ## %cleanup
55 ; CHECK-NEXT: addq $552, %rsp ## imm = 0x228
56 ; CHECK-NEXT: popq %rbx
57 ; CHECK-NEXT: popq %r12
58 ; CHECK-NEXT: popq %r13
59 ; CHECK-NEXT: popq %r14
60 ; CHECK-NEXT: popq %r15
61 ; CHECK-NEXT: popq %rbp
63 ; CHECK-NEXT: LBB0_5: ## %if.end25
64 ; CHECK-NEXT: xorl %eax, %eax
65 ; CHECK-NEXT: testb %al, %al
66 ; CHECK-NEXT: je LBB0_54
67 ; CHECK-NEXT: ## %bb.6: ## %SyTime.exit2720
68 ; CHECK-NEXT: leaq {{[0-9]+}}(%rsp), %rax
69 ; CHECK-NEXT: leaq {{[0-9]+}}(%rsp), %rcx
70 ; CHECK-NEXT: cmpq %rax, %rcx
71 ; CHECK-NEXT: jae LBB0_8
72 ; CHECK-NEXT: ## %bb.7: ## %for.body.lr.ph
73 ; CHECK-NEXT: movq %rdx, %rbx
74 ; CHECK-NEXT: movl $512, %edx ## imm = 0x200
75 ; CHECK-NEXT: movl $32, %esi
76 ; CHECK-NEXT: movq %rdi, %r14
77 ; CHECK-NEXT: callq _memset
78 ; CHECK-NEXT: movq %r14, %rdi
79 ; CHECK-NEXT: movq %rbx, %rdx
80 ; CHECK-NEXT: LBB0_8: ## %while.body.preheader
81 ; CHECK-NEXT: imulq $1040, %rdx, %rax ## imm = 0x410
82 ; CHECK-NEXT: movq _syBuf@GOTPCREL(%rip), %rcx
83 ; CHECK-NEXT: leaq 8(%rcx,%rax), %rdx
84 ; CHECK-NEXT: movq _syCTRO@GOTPCREL(%rip), %rax
85 ; CHECK-NEXT: movl $1, %r13d
86 ; CHECK-NEXT: movb $1, %cl
87 ; CHECK-NEXT: .p2align 4, 0x90
88 ; CHECK-NEXT: LBB0_9: ## %do.body
89 ; CHECK-NEXT: ## =>This Inner Loop Header: Depth=1
90 ; CHECK-NEXT: movl $0, (%rax)
91 ; CHECK-NEXT: testb %cl, %cl
92 ; CHECK-NEXT: jne LBB0_9
93 ; CHECK-NEXT: ## %bb.10: ## %do.end
94 ; CHECK-NEXT: movq %rdx, {{[-0-9]+}}(%r{{[sb]}}p) ## 8-byte Spill
95 ; CHECK-NEXT: movq %rdi, {{[-0-9]+}}(%r{{[sb]}}p) ## 8-byte Spill
96 ; CHECK-NEXT: xorl %ebp, %ebp
97 ; CHECK-NEXT: testb %bpl, %bpl
98 ; CHECK-NEXT: jne LBB0_11
99 ; CHECK-NEXT: ## %bb.12: ## %while.body200.preheader
100 ; CHECK-NEXT: xorl %r12d, %r12d
101 ; CHECK-NEXT: leaq LJTI0_0(%rip), %rdx
102 ; CHECK-NEXT: leaq LJTI0_1(%rip), %r14
103 ; CHECK-NEXT: movb $1, %sil
104 ; CHECK-NEXT: movl $0, {{[-0-9]+}}(%r{{[sb]}}p) ## 4-byte Folded Spill
105 ; CHECK-NEXT: xorl %r15d, %r15d
106 ; CHECK-NEXT: jmp LBB0_13
107 ; CHECK-NEXT: LBB0_43: ## %while.cond1037.preheader
108 ; CHECK-NEXT: ## in Loop: Header=BB0_13 Depth=1
109 ; CHECK-NEXT: testb %r12b, %r12b
110 ; CHECK-NEXT: je LBB0_54
111 ; CHECK-NEXT: .p2align 4, 0x90
112 ; CHECK-NEXT: LBB0_20: ## %while.cond197.backedge
113 ; CHECK-NEXT: ## in Loop: Header=BB0_13 Depth=1
114 ; CHECK-NEXT: decl %r13d
115 ; CHECK-NEXT: testl %r13d, %r13d
116 ; CHECK-NEXT: movl %ebp, %r15d
117 ; CHECK-NEXT: jle LBB0_21
118 ; CHECK-NEXT: LBB0_13: ## %while.body200
119 ; CHECK-NEXT: ## =>This Loop Header: Depth=1
120 ; CHECK-NEXT: ## Child Loop BB0_28 Depth 2
121 ; CHECK-NEXT: ## Child Loop BB0_37 Depth 2
122 ; CHECK-NEXT: leal -268(%rbp), %eax
123 ; CHECK-NEXT: cmpl $105, %eax
124 ; CHECK-NEXT: ja LBB0_14
125 ; CHECK-NEXT: ## %bb.55: ## %while.body200
126 ; CHECK-NEXT: ## in Loop: Header=BB0_13 Depth=1
127 ; CHECK-NEXT: movslq (%r14,%rax,4), %rax
128 ; CHECK-NEXT: addq %r14, %rax
129 ; CHECK-NEXT: jmpq *%rax
130 ; CHECK-NEXT: LBB0_25: ## %sw.bb474
131 ; CHECK-NEXT: ## in Loop: Header=BB0_13 Depth=1
132 ; CHECK-NEXT: testb %r12b, %r12b
133 ; CHECK-NEXT: ## implicit-def: $rbx
134 ; CHECK-NEXT: jne LBB0_33
135 ; CHECK-NEXT: ## %bb.26: ## %do.body479.preheader
136 ; CHECK-NEXT: ## in Loop: Header=BB0_13 Depth=1
137 ; CHECK-NEXT: testb %r12b, %r12b
138 ; CHECK-NEXT: ## implicit-def: $rbx
139 ; CHECK-NEXT: jne LBB0_33
140 ; CHECK-NEXT: ## %bb.27: ## %land.rhs485.preheader
141 ; CHECK-NEXT: ## in Loop: Header=BB0_13 Depth=1
142 ; CHECK-NEXT: ## implicit-def: $rax
143 ; CHECK-NEXT: jmp LBB0_28
144 ; CHECK-NEXT: .p2align 4, 0x90
145 ; CHECK-NEXT: LBB0_31: ## %do.body479.backedge
146 ; CHECK-NEXT: ## in Loop: Header=BB0_28 Depth=2
147 ; CHECK-NEXT: leaq 1(%rbx), %rax
148 ; CHECK-NEXT: testb %r12b, %r12b
149 ; CHECK-NEXT: je LBB0_32
150 ; CHECK-NEXT: LBB0_28: ## %land.rhs485
151 ; CHECK-NEXT: ## Parent Loop BB0_13 Depth=1
152 ; CHECK-NEXT: ## => This Inner Loop Header: Depth=2
153 ; CHECK-NEXT: testb %sil, %sil
154 ; CHECK-NEXT: jne LBB0_54
155 ; CHECK-NEXT: ## %bb.29: ## %cond.true.i.i2780
156 ; CHECK-NEXT: ## in Loop: Header=BB0_28 Depth=2
157 ; CHECK-NEXT: movq %rax, %rbx
158 ; CHECK-NEXT: testb %r12b, %r12b
159 ; CHECK-NEXT: jne LBB0_31
160 ; CHECK-NEXT: ## %bb.30: ## %lor.rhs500
161 ; CHECK-NEXT: ## in Loop: Header=BB0_28 Depth=2
162 ; CHECK-NEXT: movl $256, %esi ## imm = 0x100
163 ; CHECK-NEXT: callq ___maskrune
164 ; CHECK-NEXT: movb $1, %sil
165 ; CHECK-NEXT: testb %r12b, %r12b
166 ; CHECK-NEXT: jne LBB0_31
167 ; CHECK-NEXT: jmp LBB0_33
168 ; CHECK-NEXT: .p2align 4, 0x90
169 ; CHECK-NEXT: LBB0_14: ## %while.body200
170 ; CHECK-NEXT: ## in Loop: Header=BB0_13 Depth=1
171 ; CHECK-NEXT: leal 1(%rbp), %eax
172 ; CHECK-NEXT: cmpl $21, %eax
173 ; CHECK-NEXT: ja LBB0_20
174 ; CHECK-NEXT: ## %bb.15: ## %while.body200
175 ; CHECK-NEXT: ## in Loop: Header=BB0_13 Depth=1
176 ; CHECK-NEXT: movslq (%rdx,%rax,4), %rax
177 ; CHECK-NEXT: addq %rdx, %rax
178 ; CHECK-NEXT: jmpq *%rax
179 ; CHECK-NEXT: LBB0_18: ## %while.cond201.preheader
180 ; CHECK-NEXT: ## in Loop: Header=BB0_13 Depth=1
181 ; CHECK-NEXT: movl $1, %ebp
182 ; CHECK-NEXT: jmp LBB0_20
183 ; CHECK-NEXT: LBB0_44: ## %sw.bb1134
184 ; CHECK-NEXT: ## in Loop: Header=BB0_13 Depth=1
185 ; CHECK-NEXT: leaq {{[0-9]+}}(%rsp), %rax
186 ; CHECK-NEXT: leaq {{[0-9]+}}(%rsp), %rcx
187 ; CHECK-NEXT: cmpq %rax, %rcx
188 ; CHECK-NEXT: jb LBB0_54
189 ; CHECK-NEXT: ## %bb.45: ## in Loop: Header=BB0_13 Depth=1
190 ; CHECK-NEXT: movl $0, {{[-0-9]+}}(%r{{[sb]}}p) ## 4-byte Folded Spill
191 ; CHECK-NEXT: movl $268, %ebp ## imm = 0x10C
192 ; CHECK-NEXT: jmp LBB0_20
193 ; CHECK-NEXT: LBB0_39: ## %sw.bb566
194 ; CHECK-NEXT: ## in Loop: Header=BB0_13 Depth=1
195 ; CHECK-NEXT: movl $20, %ebp
196 ; CHECK-NEXT: jmp LBB0_20
197 ; CHECK-NEXT: LBB0_19: ## %sw.bb243
198 ; CHECK-NEXT: ## in Loop: Header=BB0_13 Depth=1
199 ; CHECK-NEXT: movl $2, %ebp
200 ; CHECK-NEXT: jmp LBB0_20
201 ; CHECK-NEXT: LBB0_32: ## %if.end517.loopexitsplit
202 ; CHECK-NEXT: ## in Loop: Header=BB0_13 Depth=1
203 ; CHECK-NEXT: incq %rbx
204 ; CHECK-NEXT: LBB0_33: ## %if.end517
205 ; CHECK-NEXT: ## in Loop: Header=BB0_13 Depth=1
206 ; CHECK-NEXT: leal -324(%r15), %eax
207 ; CHECK-NEXT: cmpl $59, %eax
208 ; CHECK-NEXT: ja LBB0_34
209 ; CHECK-NEXT: ## %bb.56: ## %if.end517
210 ; CHECK-NEXT: ## in Loop: Header=BB0_13 Depth=1
211 ; CHECK-NEXT: movabsq $576460756598390785, %rcx ## imm = 0x800000100000001
212 ; CHECK-NEXT: btq %rax, %rcx
213 ; CHECK-NEXT: jb LBB0_37
214 ; CHECK-NEXT: LBB0_34: ## %if.end517
215 ; CHECK-NEXT: ## in Loop: Header=BB0_13 Depth=1
216 ; CHECK-NEXT: cmpl $11, %r15d
217 ; CHECK-NEXT: je LBB0_37
218 ; CHECK-NEXT: ## %bb.35: ## %if.end517
219 ; CHECK-NEXT: ## in Loop: Header=BB0_13 Depth=1
220 ; CHECK-NEXT: cmpl $24, %r15d
221 ; CHECK-NEXT: je LBB0_37
222 ; CHECK-NEXT: ## %bb.36: ## %if.then532
223 ; CHECK-NEXT: ## in Loop: Header=BB0_13 Depth=1
224 ; CHECK-NEXT: movq _SyFgets.yank@GOTPCREL(%rip), %rax
225 ; CHECK-NEXT: movb $0, (%rax)
226 ; CHECK-NEXT: .p2align 4, 0x90
227 ; CHECK-NEXT: LBB0_37: ## %for.cond534
228 ; CHECK-NEXT: ## Parent Loop BB0_13 Depth=1
229 ; CHECK-NEXT: ## => This Inner Loop Header: Depth=2
230 ; CHECK-NEXT: testb %r12b, %r12b
231 ; CHECK-NEXT: jne LBB0_37
232 ; CHECK-NEXT: ## %bb.38: ## %for.cond542.preheader
233 ; CHECK-NEXT: ## in Loop: Header=BB0_13 Depth=1
234 ; CHECK-NEXT: testb %r12b, %r12b
235 ; CHECK-NEXT: movb $0, (%rbx)
236 ; CHECK-NEXT: leaq LJTI0_0(%rip), %rdx
237 ; CHECK-NEXT: jmp LBB0_20
238 ; CHECK-NEXT: .p2align 4, 0x90
239 ; CHECK-NEXT: LBB0_41: ## %while.cond864
240 ; CHECK-NEXT: ## =>This Inner Loop Header: Depth=1
241 ; CHECK-NEXT: jmp LBB0_41
242 ; CHECK-NEXT: .p2align 4, 0x90
243 ; CHECK-NEXT: LBB0_42: ## %while.cond962
244 ; CHECK-NEXT: ## =>This Inner Loop Header: Depth=1
245 ; CHECK-NEXT: jmp LBB0_42
246 ; CHECK-NEXT: .p2align 4, 0x90
247 ; CHECK-NEXT: LBB0_24: ## %for.cond357
248 ; CHECK-NEXT: ## =>This Inner Loop Header: Depth=1
249 ; CHECK-NEXT: jmp LBB0_24
250 ; CHECK-NEXT: LBB0_11:
251 ; CHECK-NEXT: movl $0, {{[-0-9]+}}(%r{{[sb]}}p) ## 4-byte Folded Spill
252 ; CHECK-NEXT: LBB0_21: ## %while.end1465
253 ; CHECK-NEXT: incl %ebp
254 ; CHECK-NEXT: cmpl $16, %ebp
255 ; CHECK-NEXT: ja LBB0_49
256 ; CHECK-NEXT: ## %bb.22: ## %while.end1465
257 ; CHECK-NEXT: movl $83969, %eax ## imm = 0x14801
258 ; CHECK-NEXT: btl %ebp, %eax
259 ; CHECK-NEXT: jae LBB0_49
260 ; CHECK-NEXT: ## %bb.23:
261 ; CHECK-NEXT: xorl %ebx, %ebx
262 ; CHECK-NEXT: movq {{[-0-9]+}}(%r{{[sb]}}p), %r14 ## 8-byte Reload
263 ; CHECK-NEXT: LBB0_47: ## %if.then1477
264 ; CHECK-NEXT: movl $1, %edx
265 ; CHECK-NEXT: callq _write
266 ; CHECK-NEXT: subq %rbx, %r14
267 ; CHECK-NEXT: movq _syHistory@GOTPCREL(%rip), %rax
268 ; CHECK-NEXT: leaq 8189(%r14,%rax), %rax
269 ; CHECK-NEXT: .p2align 4, 0x90
270 ; CHECK-NEXT: LBB0_48: ## %for.body1723
271 ; CHECK-NEXT: ## =>This Inner Loop Header: Depth=1
272 ; CHECK-NEXT: decq %rax
273 ; CHECK-NEXT: jmp LBB0_48
274 ; CHECK-NEXT: LBB0_46: ## %if.then1477.loopexit
275 ; CHECK-NEXT: movq {{[-0-9]+}}(%r{{[sb]}}p), %r14 ## 8-byte Reload
276 ; CHECK-NEXT: movq %r14, %rbx
277 ; CHECK-NEXT: jmp LBB0_47
278 ; CHECK-NEXT: LBB0_16: ## %while.cond635.preheader
279 ; CHECK-NEXT: xorl %eax, %eax
280 ; CHECK-NEXT: testb %al, %al
281 ; CHECK-NEXT: je LBB0_40
282 ; CHECK-NEXT: .p2align 4, 0x90
283 ; CHECK-NEXT: LBB0_17: ## %for.body643.us
284 ; CHECK-NEXT: ## =>This Inner Loop Header: Depth=1
285 ; CHECK-NEXT: jmp LBB0_17
286 ; CHECK-NEXT: .p2align 4, 0x90
287 ; CHECK-NEXT: LBB0_40: ## %while.cond661
288 ; CHECK-NEXT: ## =>This Inner Loop Header: Depth=1
289 ; CHECK-NEXT: jmp LBB0_40
290 ; CHECK-NEXT: LBB0_49: ## %for.cond1480.preheader
291 ; CHECK-NEXT: xorl %eax, %eax
292 ; CHECK-NEXT: testb %al, %al
293 ; CHECK-NEXT: je LBB0_54
294 ; CHECK-NEXT: ## %bb.50: ## %for.body1664.lr.ph
295 ; CHECK-NEXT: xorl %eax, %eax
296 ; CHECK-NEXT: testb %al, %al
297 ; CHECK-NEXT: movq {{[-0-9]+}}(%r{{[sb]}}p), %r14 ## 8-byte Reload
298 ; CHECK-NEXT: movl {{[-0-9]+}}(%r{{[sb]}}p), %ebp ## 4-byte Reload
299 ; CHECK-NEXT: jne LBB0_53
300 ; CHECK-NEXT: ## %bb.51: ## %while.body1679.preheader
301 ; CHECK-NEXT: incl %ebp
302 ; CHECK-NEXT: xorl %ebx, %ebx
303 ; CHECK-NEXT: .p2align 4, 0x90
304 ; CHECK-NEXT: LBB0_52: ## %while.body1679
305 ; CHECK-NEXT: ## =>This Inner Loop Header: Depth=1
306 ; CHECK-NEXT: movq (%r14), %rdi
307 ; CHECK-NEXT: callq _fileno
308 ; CHECK-NEXT: incl %ebp
309 ; CHECK-NEXT: testb %bl, %bl
310 ; CHECK-NEXT: jne LBB0_52
311 ; CHECK-NEXT: LBB0_53: ## %while.cond1683.preheader
312 ; CHECK-NEXT: xorl %eax, %eax
313 ; CHECK-NEXT: testb %al, %al
314 ; CHECK-NEXT: LBB0_54: ## %if.then.i
317 %sub.ptr.rhs.cast646 = ptrtoint ptr %line to i64
318 %old = alloca [512 x i8], align 16
319 switch i64 %fid, label %if.then [
328 switch i64 undef, label %if.end25 [
329 i64 0, label %if.then4
330 i64 1, label %if.end25
334 br i1 undef, label %SyTime.exit, label %if.then.i
340 br i1 undef, label %SyTime.exit2681, label %if.then.i2673
352 br i1 undef, label %SyTime.exit2720, label %if.then.i2712
358 %add.ptr = getelementptr [512 x i8], ptr %old, i64 0, i64 512
359 %cmp293427 = icmp ult ptr %old, %add.ptr
360 br i1 %cmp293427, label %for.body.lr.ph, label %while.body.preheader
363 call void @llvm.memset.p0.i64(ptr align 16 undef, i8 32, i64 512, i1 false)
364 br label %while.body.preheader
366 while.body.preheader:
367 %add.ptr1603 = getelementptr [512 x i8], ptr null, i64 0, i64 512
368 %echo.i3101 = getelementptr [16 x %struct.TMP.1], ptr @syBuf, i64 0, i64 %fid, i32 1
369 %0 = xor i64 %sub.ptr.rhs.cast646, -1
373 %ch2.0 = phi i32 [ 0, %while.body.preheader ], [ %ch.12.ch2.12, %do.body ]
374 %rep.0 = phi i32 [ 1, %while.body.preheader ], [ %rep.6, %do.body ]
375 store i32 0, ptr @syCTRO, align 4, !tbaa !1
376 %ch.0.ch2.0 = select i1 undef, i32 14, i32 %ch2.0
377 %ch2.2 = select i1 undef, i32 0, i32 %ch.0.ch2.0
378 %ch.2.ch2.2 = select i1 undef, i32 0, i32 %ch2.2
379 %ch2.4 = select i1 undef, i32 278, i32 %ch.2.ch2.2
380 %ch2.5 = select i1 undef, i32 0, i32 %ch2.4
381 %rep.2 = select i1 undef, i32 undef, i32 %rep.0
382 %ch.5.ch2.5 = select i1 undef, i32 undef, i32 %ch2.5
383 %ch2.7 = select i1 undef, i32 0, i32 %ch.5.ch2.5
384 %rep.3 = select i1 undef, i32 undef, i32 %rep.2
385 %ch.7.ch2.7 = select i1 false, i32 0, i32 %ch2.7
386 %mul98.rep.3 = select i1 false, i32 0, i32 %rep.3
387 %ch2.9 = select i1 undef, i32 undef, i32 %ch.7.ch2.7
388 %rep.5 = select i1 undef, i32 undef, i32 %mul98.rep.3
389 %ch2.10 = select i1 false, i32 undef, i32 %ch2.9
390 %rep.6 = select i1 false, i32 undef, i32 %rep.5
391 %isdigittmp = add i32 %ch2.10, -48
392 %isdigit = icmp ult i32 %isdigittmp, 10
393 %cmp119 = icmp eq i32 undef, 22
394 %or.cond1875 = and i1 %isdigit, %cmp119
395 %ch.10.ch2.10 = select i1 %or.cond1875, i32 undef, i32 %ch2.10
396 %.ch.10 = select i1 %or.cond1875, i32 0, i32 undef
397 %ch2.12 = select i1 undef, i32 %.ch.10, i32 %ch.10.ch2.10
398 %ch.12 = select i1 undef, i32 0, i32 %.ch.10
399 %ch.12.ch2.12 = select i1 false, i32 %ch.12, i32 %ch2.12
400 %.ch.12 = select i1 false, i32 0, i32 %ch.12
401 %cmp147 = icmp eq i32 %.ch.12, 0
402 br i1 %cmp147, label %do.body, label %do.end
405 %cmp164 = icmp eq i32 %ch.12.ch2.12, 21
406 %mul167 = shl i32 %rep.6, 2
407 %rep.8 = select i1 %cmp164, i32 %mul167, i32 %rep.6
408 %..ch.19 = select i1 false, i32 2, i32 0
409 br i1 undef, label %while.body200, label %while.end1465
412 %dec3386.in = phi i32 [ %dec3386, %while.cond197.backedge ], [ %rep.8, %do.end ]
413 %oldc.13384 = phi i32 [ %oldc.1.be, %while.cond197.backedge ], [ 0, %do.end ]
414 %ch.213379 = phi i32 [ %last.1.be, %while.cond197.backedge ], [ %..ch.19, %do.end ]
415 %last.13371 = phi i32 [ %last.1.be, %while.cond197.backedge ], [ 0, %do.end ]
416 %dec3386 = add i32 %dec3386.in, -1
417 switch i32 %ch.213379, label %sw.default [
418 i32 1, label %while.cond201.preheader
419 i32 322, label %sw.bb206
420 i32 354, label %sw.bb206
421 i32 2, label %sw.bb243
422 i32 364, label %sw.bb1077
423 i32 326, label %sw.bb256
424 i32 358, label %sw.bb256
425 i32 341, label %sw.bb979
426 i32 323, label %while.cond1037.preheader
427 i32 373, label %sw.bb979
428 i32 4, label %if.then1477
429 i32 332, label %sw.bb1077
430 i32 11, label %for.cond357
431 i32 355, label %while.cond1037.preheader
432 i32 324, label %sw.bb474
433 i32 356, label %sw.bb474
434 i32 20, label %sw.bb566
435 i32 -1, label %while.cond197.backedge
436 i32 268, label %sw.bb1134
437 i32 16, label %while.cond635.preheader
438 i32 18, label %sw.bb956
439 i32 316, label %while.cond864
442 while.cond1037.preheader:
443 %cmp10393273 = icmp eq i8 undef, 0
444 br i1 %cmp10393273, label %if.end1070, label %land.rhs1041
446 while.cond635.preheader:
447 br i1 undef, label %for.body643.us, label %while.cond661
450 br label %for.body643.us
452 while.cond201.preheader:
453 %umax = select i1 false, i64 undef, i64 %0
454 %1 = xor i64 %umax, -1
455 %2 = inttoptr i64 %1 to ptr
456 br label %while.cond197.backedge
459 br label %while.cond197.backedge
462 br label %while.cond197.backedge
465 br label %while.cond197.backedge
467 while.cond197.backedge:
468 %last.1.be = phi i32 [ %ch.213379, %sw.default ], [ -1, %while.body200 ], [ %ch.213379, %sw.bb1077 ], [ %ch.213379, %sw.bb979 ], [ 18, %sw.bb956 ], [ 20, %sw.bb566 ], [ %ch.213379, %for.end552 ], [ %ch.213379, %sw.bb256 ], [ 2, %sw.bb243 ], [ 1, %while.cond201.preheader ], [ 268, %for.cond1145.preheader ], [ %ch.213379, %sw.bb206 ]
469 %oldc.1.be = phi i32 [ %oldc.13384, %sw.default ], [ %oldc.13384, %while.body200 ], [ %oldc.13384, %sw.bb1077 ], [ %oldc.13384, %sw.bb979 ], [ %oldc.13384, %sw.bb956 ], [ %oldc.13384, %sw.bb566 ], [ %oldc.13384, %for.end552 ], [ %oldc.13384, %sw.bb256 ], [ %oldc.13384, %sw.bb243 ], [ %oldc.13384, %while.cond201.preheader ], [ 0, %for.cond1145.preheader ], [ %oldc.13384, %sw.bb206 ]
470 %cmp198 = icmp sgt i32 %dec3386, 0
471 br i1 %cmp198, label %while.body200, label %while.end1465
474 br label %for.cond357
477 ; spill is hoisted here. Although loop depth1 is even hotter than loop depth2, sw.bb474 is still cold.
478 %cmp476 = icmp eq i8 undef, 0
479 br i1 %cmp476, label %if.end517, label %do.body479.preheader
481 do.body479.preheader:
482 %cmp4833314 = icmp eq i8 undef, 0
483 br i1 %cmp4833314, label %if.end517, label %land.rhs485
486 %incdec.ptr4803316 = phi ptr [ %incdec.ptr480, %do.body479.backedge.land.rhs485_crit_edge ], [ undef, %do.body479.preheader ]
487 %isascii.i.i27763151 = icmp sgt i8 undef, -1
488 br i1 %isascii.i.i27763151, label %cond.true.i.i2780, label %cond.false.i.i2782
491 br i1 undef, label %land.lhs.true490, label %lor.rhs500
497 br i1 false, label %lor.rhs500, label %do.body479.backedge
500 ; Make sure spill is hoisted to a cold preheader in outside loop.
501 %call3.i.i2792 = call i32 @__maskrune(i32 undef, i64 256)
502 br i1 undef, label %land.lhs.true504, label %do.body479.backedge
505 br i1 undef, label %do.body479.backedge, label %if.end517
508 %incdec.ptr480 = getelementptr i8, ptr %incdec.ptr4803316, i64 1
509 %cmp483 = icmp eq i8 undef, 0
510 br i1 %cmp483, label %if.end517, label %do.body479.backedge.land.rhs485_crit_edge
512 do.body479.backedge.land.rhs485_crit_edge:
513 br label %land.rhs485
516 %q.4 = phi ptr [ undef, %sw.bb474 ], [ undef, %do.body479.preheader ], [ %incdec.ptr480, %do.body479.backedge ], [ %incdec.ptr4803316, %land.lhs.true504 ]
517 switch i32 %last.13371, label %if.then532 [
518 i32 383, label %for.cond534
519 i32 356, label %for.cond534
520 i32 324, label %for.cond534
521 i32 24, label %for.cond534
522 i32 11, label %for.cond534
526 store i8 0, ptr @SyFgets.yank, align 16, !tbaa !5
527 br label %for.cond534
530 %cmp536 = icmp eq i8 undef, 0
531 br i1 %cmp536, label %for.cond542.preheader, label %for.cond534
533 for.cond542.preheader:
534 br i1 undef, label %for.body545, label %for.end552
537 br i1 undef, label %for.end552, label %for.body545
540 %s.2.lcssa = phi ptr [ undef, %for.cond542.preheader ], [ %q.4, %for.body545 ]
541 %sub.ptr.lhs.cast553 = ptrtoint ptr %s.2.lcssa to i64
542 %sub.ptr.sub555 = sub i64 %sub.ptr.lhs.cast553, 0
543 %arrayidx556 = getelementptr i8, ptr null, i64 %sub.ptr.sub555
544 store i8 0, ptr %arrayidx556, align 1, !tbaa !5
545 br label %while.cond197.backedge
548 br label %while.cond197.backedge
551 br label %while.cond661
554 br label %while.cond864
557 br i1 undef, label %if.then959, label %while.cond197.backedge
560 br label %while.cond962
563 br label %while.cond962
566 br label %while.cond197.backedge
575 br label %while.cond197.backedge
578 br i1 false, label %for.body1139, label %for.cond1145.preheader
580 for.cond1145.preheader:
581 br i1 %cmp293427, label %for.body1150.lr.ph, label %while.cond197.backedge
590 br label %while.cond197.backedge
593 %oldc.1.lcssa = phi i32 [ 0, %do.end ], [ %oldc.1.be, %while.cond197.backedge ]
594 %ch.21.lcssa = phi i32 [ %..ch.19, %do.end ], [ %last.1.be, %while.cond197.backedge ]
595 switch i32 %ch.21.lcssa, label %for.cond1480.preheader [
596 i32 -1, label %if.then1477
597 i32 15, label %if.then1477
598 i32 13, label %if.then1477
599 i32 10, label %if.then1477
602 for.cond1480.preheader:
603 br i1 undef, label %for.body1606.lr.ph, label %for.end1609
606 %p.1.lcssa3539 = phi ptr [ null, %while.end1465 ], [ null, %while.end1465 ], [ null, %while.end1465 ], [ null, %while.end1465 ], [ %line, %while.body200 ]
607 %call1.i3057 = call i64 @"\01_write"(i32 undef, ptr undef, i64 1)
608 %sub.ptr.lhs.cast1717 = ptrtoint ptr %p.1.lcssa3539 to i64
609 %sub.ptr.sub1719 = sub i64 %sub.ptr.lhs.cast1717, %sub.ptr.rhs.cast646
610 %idx.neg1727 = sub i64 0, %sub.ptr.sub1719
611 br label %for.body1723
614 br label %for.end1609
617 br i1 undef, label %for.cond1659.preheader, label %land.lhs.true1614
620 br label %for.cond1659.preheader
622 for.cond1659.preheader:
623 %cmp16623414 = icmp ult ptr undef, %add.ptr1603
624 br i1 %cmp16623414, label %for.body1664.lr.ph, label %while.body1703.lr.ph
627 %cmp16773405 = icmp slt i64 undef, undef
628 br i1 %cmp16773405, label %while.body1679, label %while.cond1683.preheader
630 while.body1703.lr.ph:
633 while.cond1683.preheader:
634 br i1 undef, label %while.body1691, label %while.end1693
637 %oldc.43406 = phi i32 [ %inc, %syEchoch.exit3070 ], [ %oldc.1.lcssa, %for.body1664.lr.ph ]
638 %3 = load ptr, ptr %echo.i3101, align 8, !tbaa !6
639 %call.i3062 = call i32 @fileno(ptr %3)
640 br i1 undef, label %if.then.i3069, label %syEchoch.exit3070
643 br label %syEchoch.exit3070
646 %inc = add i32 %oldc.43406, 1
647 %conv1672 = sext i32 %inc to i64
648 %cmp1677 = icmp slt i64 %conv1672, undef
649 br i1 %cmp1677, label %while.body1679, label %while.cond1683.preheader
658 %q.303203 = phi ptr [ getelementptr inbounds ([8192 x i8], ptr @syHistory, i64 0, i64 8189), %if.then1477 ], [ %incdec.ptr1730, %for.body1723 ]
659 %add.ptr1728 = getelementptr i8, ptr %q.303203, i64 %idx.neg1727
660 %4 = load i8, ptr %add.ptr1728, align 1, !tbaa !5
661 %incdec.ptr1730 = getelementptr i8, ptr %q.303203, i64 -1
662 br label %for.body1723
668 declare i32 @fileno(ptr nocapture)
669 declare i64 @"\01_write"(i32, ptr, i64)
670 declare i32 @__maskrune(i32, i64)
671 declare void @llvm.memset.p0.i64(ptr nocapture, i8, i64, i1)
675 !0 = !{!"clang version 3.5.0 (trunk 204257)"}
676 !1 = !{!2, !2, i64 0}
677 !2 = !{!"int", !3, i64 0}
678 !3 = !{!"omnipotent char", !4, i64 0}
679 !4 = !{!"Simple C/C++ TBAA"}
680 !5 = !{!3, !3, i64 0}
681 !6 = !{!7, !8, i64 8}
682 !7 = !{!"", !8, i64 0, !8, i64 8, !3, i64 16}
683 !8 = !{!"any pointer", !3, i64 0}