xref: /aosp_15_r20/external/llvm/test/CodeGen/X86/ragreedy-hoist-spill.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=x86_64-apple-macosx -regalloc=greedy | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Worker; This testing case is reduced from 254.gap SyFgets function.
4*9880d681SAndroid Build Coastguard Worker; We make sure a spill is hoisted to a cold BB inside the hotter outer loop.
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Worker%struct.TMP.1 = type { %struct.TMP.2*, %struct.TMP.2*, [1024 x i8] }
7*9880d681SAndroid Build Coastguard Worker%struct.TMP.2 = type { i8*, i32, i32, i16, i16, %struct.TMP.3, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.TMP.3, %struct.TMP.4*, i32, [3 x i8], [1 x i8], %struct.TMP.3, i32, i64 }
8*9880d681SAndroid Build Coastguard Worker%struct.TMP.4 = type opaque
9*9880d681SAndroid Build Coastguard Worker%struct.TMP.3 = type { i8*, i32 }
10*9880d681SAndroid Build Coastguard Worker
11*9880d681SAndroid Build Coastguard Worker@syBuf = external global [16 x %struct.TMP.1], align 16
12*9880d681SAndroid Build Coastguard Worker@syHistory = external global [8192 x i8], align 16
13*9880d681SAndroid Build Coastguard Worker@SyFgets.yank = external global [512 x i8], align 16
14*9880d681SAndroid Build Coastguard Worker@syCTRO = external global i32, align 4
15*9880d681SAndroid Build Coastguard Worker
16*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: SyFgets
17*9880d681SAndroid Build Coastguard Workerdefine i8* @SyFgets(i8* %line, i64 %length, i64 %fid) {
18*9880d681SAndroid Build Coastguard Workerentry:
19*9880d681SAndroid Build Coastguard Worker  %sub.ptr.rhs.cast646 = ptrtoint i8* %line to i64
20*9880d681SAndroid Build Coastguard Worker  %old = alloca [512 x i8], align 16
21*9880d681SAndroid Build Coastguard Worker  %0 = getelementptr inbounds [512 x i8], [512 x i8]* %old, i64 0, i64 0
22*9880d681SAndroid Build Coastguard Worker  switch i64 %fid, label %if.then [
23*9880d681SAndroid Build Coastguard Worker    i64 2, label %if.end
24*9880d681SAndroid Build Coastguard Worker    i64 0, label %if.end
25*9880d681SAndroid Build Coastguard Worker  ]
26*9880d681SAndroid Build Coastguard Worker
27*9880d681SAndroid Build Coastguard Workerif.then:
28*9880d681SAndroid Build Coastguard Worker  br label %cleanup
29*9880d681SAndroid Build Coastguard Worker
30*9880d681SAndroid Build Coastguard Workerif.end:
31*9880d681SAndroid Build Coastguard Worker  switch i64 undef, label %if.end25 [
32*9880d681SAndroid Build Coastguard Worker    i64 0, label %if.then4
33*9880d681SAndroid Build Coastguard Worker    i64 1, label %if.end25
34*9880d681SAndroid Build Coastguard Worker  ]
35*9880d681SAndroid Build Coastguard Worker
36*9880d681SAndroid Build Coastguard Workerif.then4:
37*9880d681SAndroid Build Coastguard Worker  br i1 undef, label %SyTime.exit, label %if.then.i
38*9880d681SAndroid Build Coastguard Worker
39*9880d681SAndroid Build Coastguard Workerif.then.i:
40*9880d681SAndroid Build Coastguard Worker  unreachable
41*9880d681SAndroid Build Coastguard Worker
42*9880d681SAndroid Build Coastguard WorkerSyTime.exit:
43*9880d681SAndroid Build Coastguard Worker  br i1 undef, label %SyTime.exit2681, label %if.then.i2673
44*9880d681SAndroid Build Coastguard Worker
45*9880d681SAndroid Build Coastguard Workerif.then.i2673:
46*9880d681SAndroid Build Coastguard Worker  unreachable
47*9880d681SAndroid Build Coastguard Worker
48*9880d681SAndroid Build Coastguard WorkerSyTime.exit2681:
49*9880d681SAndroid Build Coastguard Worker  br label %cleanup
50*9880d681SAndroid Build Coastguard Worker
51*9880d681SAndroid Build Coastguard Workerland.lhs.true14:
52*9880d681SAndroid Build Coastguard Worker  unreachable
53*9880d681SAndroid Build Coastguard Worker
54*9880d681SAndroid Build Coastguard Workerif.end25:
55*9880d681SAndroid Build Coastguard Worker  br i1 undef, label %SyTime.exit2720, label %if.then.i2712
56*9880d681SAndroid Build Coastguard Worker
57*9880d681SAndroid Build Coastguard Workerif.then.i2712:
58*9880d681SAndroid Build Coastguard Worker  unreachable
59*9880d681SAndroid Build Coastguard Worker
60*9880d681SAndroid Build Coastguard WorkerSyTime.exit2720:
61*9880d681SAndroid Build Coastguard Worker  %add.ptr = getelementptr [512 x i8], [512 x i8]* %old, i64 0, i64 512
62*9880d681SAndroid Build Coastguard Worker  %cmp293427 = icmp ult i8* %0, %add.ptr
63*9880d681SAndroid Build Coastguard Worker  br i1 %cmp293427, label %for.body.lr.ph, label %while.body.preheader
64*9880d681SAndroid Build Coastguard Worker
65*9880d681SAndroid Build Coastguard Workerfor.body.lr.ph:
66*9880d681SAndroid Build Coastguard Worker  call void @llvm.memset.p0i8.i64(i8* undef, i8 32, i64 512, i32 16, i1 false)
67*9880d681SAndroid Build Coastguard Worker  br label %while.body.preheader
68*9880d681SAndroid Build Coastguard Worker
69*9880d681SAndroid Build Coastguard Workerwhile.body.preheader:
70*9880d681SAndroid Build Coastguard Worker  %add.ptr1603 = getelementptr [512 x i8], [512 x i8]* null, i64 0, i64 512
71*9880d681SAndroid Build Coastguard Worker  %echo.i3101 = getelementptr [16 x %struct.TMP.1], [16 x %struct.TMP.1]* @syBuf, i64 0, i64 %fid, i32 1
72*9880d681SAndroid Build Coastguard Worker  %1 = xor i64 %sub.ptr.rhs.cast646, -1
73*9880d681SAndroid Build Coastguard Worker  br label %do.body
74*9880d681SAndroid Build Coastguard Worker
75*9880d681SAndroid Build Coastguard Workerdo.body:
76*9880d681SAndroid Build Coastguard Worker  %ch2.0 = phi i32 [ 0, %while.body.preheader ], [ %ch.12.ch2.12, %do.body ]
77*9880d681SAndroid Build Coastguard Worker  %rep.0 = phi i32 [ 1, %while.body.preheader ], [ %rep.6, %do.body ]
78*9880d681SAndroid Build Coastguard Worker  store i32 0, i32* @syCTRO, align 4, !tbaa !1
79*9880d681SAndroid Build Coastguard Worker  %ch.0.ch2.0 = select i1 undef, i32 14, i32 %ch2.0
80*9880d681SAndroid Build Coastguard Worker  %ch2.2 = select i1 undef, i32 0, i32 %ch.0.ch2.0
81*9880d681SAndroid Build Coastguard Worker  %ch.2.ch2.2 = select i1 undef, i32 0, i32 %ch2.2
82*9880d681SAndroid Build Coastguard Worker  %ch2.4 = select i1 undef, i32 278, i32 %ch.2.ch2.2
83*9880d681SAndroid Build Coastguard Worker  %ch2.5 = select i1 undef, i32 0, i32 %ch2.4
84*9880d681SAndroid Build Coastguard Worker  %rep.2 = select i1 undef, i32 undef, i32 %rep.0
85*9880d681SAndroid Build Coastguard Worker  %ch.5.ch2.5 = select i1 undef, i32 undef, i32 %ch2.5
86*9880d681SAndroid Build Coastguard Worker  %ch2.7 = select i1 undef, i32 0, i32 %ch.5.ch2.5
87*9880d681SAndroid Build Coastguard Worker  %rep.3 = select i1 undef, i32 undef, i32 %rep.2
88*9880d681SAndroid Build Coastguard Worker  %ch.7.ch2.7 = select i1 false, i32 0, i32 %ch2.7
89*9880d681SAndroid Build Coastguard Worker  %mul98.rep.3 = select i1 false, i32 0, i32 %rep.3
90*9880d681SAndroid Build Coastguard Worker  %ch2.9 = select i1 undef, i32 undef, i32 %ch.7.ch2.7
91*9880d681SAndroid Build Coastguard Worker  %rep.5 = select i1 undef, i32 undef, i32 %mul98.rep.3
92*9880d681SAndroid Build Coastguard Worker  %ch2.10 = select i1 false, i32 undef, i32 %ch2.9
93*9880d681SAndroid Build Coastguard Worker  %rep.6 = select i1 false, i32 undef, i32 %rep.5
94*9880d681SAndroid Build Coastguard Worker  %isdigittmp = add i32 %ch2.10, -48
95*9880d681SAndroid Build Coastguard Worker  %isdigit = icmp ult i32 %isdigittmp, 10
96*9880d681SAndroid Build Coastguard Worker  %cmp119 = icmp eq i32 undef, 22
97*9880d681SAndroid Build Coastguard Worker  %or.cond1875 = and i1 %isdigit, %cmp119
98*9880d681SAndroid Build Coastguard Worker  %ch.10.ch2.10 = select i1 %or.cond1875, i32 undef, i32 %ch2.10
99*9880d681SAndroid Build Coastguard Worker  %.ch.10 = select i1 %or.cond1875, i32 0, i32 undef
100*9880d681SAndroid Build Coastguard Worker  %ch2.12 = select i1 undef, i32 %.ch.10, i32 %ch.10.ch2.10
101*9880d681SAndroid Build Coastguard Worker  %ch.12 = select i1 undef, i32 0, i32 %.ch.10
102*9880d681SAndroid Build Coastguard Worker  %ch.12.ch2.12 = select i1 false, i32 %ch.12, i32 %ch2.12
103*9880d681SAndroid Build Coastguard Worker  %.ch.12 = select i1 false, i32 0, i32 %ch.12
104*9880d681SAndroid Build Coastguard Worker  %cmp147 = icmp eq i32 %.ch.12, 0
105*9880d681SAndroid Build Coastguard Worker  br i1 %cmp147, label %do.body, label %do.end
106*9880d681SAndroid Build Coastguard Worker
107*9880d681SAndroid Build Coastguard Workerdo.end:
108*9880d681SAndroid Build Coastguard Worker  %cmp164 = icmp eq i32 %ch.12.ch2.12, 21
109*9880d681SAndroid Build Coastguard Worker  %mul167 = shl i32 %rep.6, 2
110*9880d681SAndroid Build Coastguard Worker  %rep.8 = select i1 %cmp164, i32 %mul167, i32 %rep.6
111*9880d681SAndroid Build Coastguard Worker  %..ch.19 = select i1 false, i32 2, i32 0
112*9880d681SAndroid Build Coastguard Worker  br i1 undef, label %while.body200, label %while.end1465
113*9880d681SAndroid Build Coastguard Worker
114*9880d681SAndroid Build Coastguard Workerwhile.body200:
115*9880d681SAndroid Build Coastguard Worker  %dec3386.in = phi i32 [ %dec3386, %while.cond197.backedge ], [ %rep.8, %do.end ]
116*9880d681SAndroid Build Coastguard Worker  %oldc.13384 = phi i32 [ %oldc.1.be, %while.cond197.backedge ], [ 0, %do.end ]
117*9880d681SAndroid Build Coastguard Worker  %ch.213379 = phi i32 [ %last.1.be, %while.cond197.backedge ], [ %..ch.19, %do.end ]
118*9880d681SAndroid Build Coastguard Worker  %last.13371 = phi i32 [ %last.1.be, %while.cond197.backedge ], [ 0, %do.end ]
119*9880d681SAndroid Build Coastguard Worker  %dec3386 = add i32 %dec3386.in, -1
120*9880d681SAndroid Build Coastguard Worker  switch i32 %ch.213379, label %sw.default [
121*9880d681SAndroid Build Coastguard Worker    i32 1, label %while.cond201.preheader
122*9880d681SAndroid Build Coastguard Worker    i32 322, label %sw.bb206
123*9880d681SAndroid Build Coastguard Worker    i32 354, label %sw.bb206
124*9880d681SAndroid Build Coastguard Worker    i32 2, label %sw.bb243
125*9880d681SAndroid Build Coastguard Worker    i32 364, label %sw.bb1077
126*9880d681SAndroid Build Coastguard Worker    i32 326, label %sw.bb256
127*9880d681SAndroid Build Coastguard Worker    i32 358, label %sw.bb256
128*9880d681SAndroid Build Coastguard Worker    i32 341, label %sw.bb979
129*9880d681SAndroid Build Coastguard Worker    i32 323, label %while.cond1037.preheader
130*9880d681SAndroid Build Coastguard Worker    i32 373, label %sw.bb979
131*9880d681SAndroid Build Coastguard Worker    i32 4, label %if.then1477
132*9880d681SAndroid Build Coastguard Worker    i32 332, label %sw.bb1077
133*9880d681SAndroid Build Coastguard Worker    i32 11, label %for.cond357
134*9880d681SAndroid Build Coastguard Worker    i32 355, label %while.cond1037.preheader
135*9880d681SAndroid Build Coastguard Worker    i32 324, label %sw.bb474
136*9880d681SAndroid Build Coastguard Worker    i32 356, label %sw.bb474
137*9880d681SAndroid Build Coastguard Worker    i32 20, label %sw.bb566
138*9880d681SAndroid Build Coastguard Worker    i32 -1, label %while.cond197.backedge
139*9880d681SAndroid Build Coastguard Worker    i32 268, label %sw.bb1134
140*9880d681SAndroid Build Coastguard Worker    i32 16, label %while.cond635.preheader
141*9880d681SAndroid Build Coastguard Worker    i32 18, label %sw.bb956
142*9880d681SAndroid Build Coastguard Worker    i32 316, label %while.cond864
143*9880d681SAndroid Build Coastguard Worker  ]
144*9880d681SAndroid Build Coastguard Worker
145*9880d681SAndroid Build Coastguard Workerwhile.cond1037.preheader:
146*9880d681SAndroid Build Coastguard Worker  %cmp10393273 = icmp eq i8 undef, 0
147*9880d681SAndroid Build Coastguard Worker  br i1 %cmp10393273, label %if.end1070, label %land.rhs1041
148*9880d681SAndroid Build Coastguard Worker
149*9880d681SAndroid Build Coastguard Workerwhile.cond635.preheader:
150*9880d681SAndroid Build Coastguard Worker  br i1 undef, label %for.body643.us, label %while.cond661
151*9880d681SAndroid Build Coastguard Worker
152*9880d681SAndroid Build Coastguard Workerfor.body643.us:
153*9880d681SAndroid Build Coastguard Worker  br label %for.body643.us
154*9880d681SAndroid Build Coastguard Worker
155*9880d681SAndroid Build Coastguard Workerwhile.cond201.preheader:
156*9880d681SAndroid Build Coastguard Worker  %umax = select i1 false, i64 undef, i64 %1
157*9880d681SAndroid Build Coastguard Worker  %2 = xor i64 %umax, -1
158*9880d681SAndroid Build Coastguard Worker  %3 = inttoptr i64 %2 to i8*
159*9880d681SAndroid Build Coastguard Worker  br label %while.cond197.backedge
160*9880d681SAndroid Build Coastguard Worker
161*9880d681SAndroid Build Coastguard Workersw.bb206:
162*9880d681SAndroid Build Coastguard Worker  br label %while.cond197.backedge
163*9880d681SAndroid Build Coastguard Worker
164*9880d681SAndroid Build Coastguard Workersw.bb243:
165*9880d681SAndroid Build Coastguard Worker  br label %while.cond197.backedge
166*9880d681SAndroid Build Coastguard Worker
167*9880d681SAndroid Build Coastguard Workersw.bb256:
168*9880d681SAndroid Build Coastguard Worker  br label %while.cond197.backedge
169*9880d681SAndroid Build Coastguard Worker
170*9880d681SAndroid Build Coastguard Workerwhile.cond197.backedge:
171*9880d681SAndroid Build Coastguard Worker  %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 ]
172*9880d681SAndroid Build Coastguard Worker  %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 ]
173*9880d681SAndroid Build Coastguard Worker  %cmp198 = icmp sgt i32 %dec3386, 0
174*9880d681SAndroid Build Coastguard Worker  br i1 %cmp198, label %while.body200, label %while.end1465
175*9880d681SAndroid Build Coastguard Worker
176*9880d681SAndroid Build Coastguard Workerfor.cond357:
177*9880d681SAndroid Build Coastguard Worker  br label %for.cond357
178*9880d681SAndroid Build Coastguard Worker
179*9880d681SAndroid Build Coastguard Workersw.bb474:
180*9880d681SAndroid Build Coastguard Worker  %cmp476 = icmp eq i8 undef, 0
181*9880d681SAndroid Build Coastguard Worker  br i1 %cmp476, label %if.end517, label %do.body479.preheader
182*9880d681SAndroid Build Coastguard Worker
183*9880d681SAndroid Build Coastguard Workerdo.body479.preheader:
184*9880d681SAndroid Build Coastguard Worker  ; CHECK: do.body479.preheader
185*9880d681SAndroid Build Coastguard Worker  ; spill is hoisted here. Although loop depth1 is even hotter than loop depth2, do.body479.preheader is cold.
186*9880d681SAndroid Build Coastguard Worker  ; CHECK: movq %r{{.*}}, {{[0-9]+}}(%rsp)
187*9880d681SAndroid Build Coastguard Worker  ; CHECK: land.rhs485
188*9880d681SAndroid Build Coastguard Worker  %cmp4833314 = icmp eq i8 undef, 0
189*9880d681SAndroid Build Coastguard Worker  br i1 %cmp4833314, label %if.end517, label %land.rhs485
190*9880d681SAndroid Build Coastguard Worker
191*9880d681SAndroid Build Coastguard Workerland.rhs485:
192*9880d681SAndroid Build Coastguard Worker  %incdec.ptr4803316 = phi i8* [ %incdec.ptr480, %do.body479.backedge.land.rhs485_crit_edge ], [ undef, %do.body479.preheader ]
193*9880d681SAndroid Build Coastguard Worker  %isascii.i.i27763151 = icmp sgt i8 undef, -1
194*9880d681SAndroid Build Coastguard Worker  br i1 %isascii.i.i27763151, label %cond.true.i.i2780, label %cond.false.i.i2782
195*9880d681SAndroid Build Coastguard Worker
196*9880d681SAndroid Build Coastguard Workercond.true.i.i2780:
197*9880d681SAndroid Build Coastguard Worker  br i1 undef, label %land.lhs.true490, label %lor.rhs500
198*9880d681SAndroid Build Coastguard Worker
199*9880d681SAndroid Build Coastguard Workercond.false.i.i2782:
200*9880d681SAndroid Build Coastguard Worker  unreachable
201*9880d681SAndroid Build Coastguard Worker
202*9880d681SAndroid Build Coastguard Workerland.lhs.true490:
203*9880d681SAndroid Build Coastguard Worker  br i1 false, label %lor.rhs500, label %do.body479.backedge
204*9880d681SAndroid Build Coastguard Worker
205*9880d681SAndroid Build Coastguard Workerlor.rhs500:
206*9880d681SAndroid Build Coastguard Worker  ; CHECK: lor.rhs500
207*9880d681SAndroid Build Coastguard Worker  ; Make sure spill is hoisted to a cold preheader in outside loop.
208*9880d681SAndroid Build Coastguard Worker  ; CHECK-NOT: movq %r{{.*}}, {{[0-9]+}}(%rsp)
209*9880d681SAndroid Build Coastguard Worker  ; CHECK: callq {{.*}}maskrune
210*9880d681SAndroid Build Coastguard Worker  %call3.i.i2792 = call i32 @__maskrune(i32 undef, i64 256)
211*9880d681SAndroid Build Coastguard Worker  br i1 undef, label %land.lhs.true504, label %do.body479.backedge
212*9880d681SAndroid Build Coastguard Worker
213*9880d681SAndroid Build Coastguard Workerland.lhs.true504:
214*9880d681SAndroid Build Coastguard Worker  br i1 undef, label %do.body479.backedge, label %if.end517
215*9880d681SAndroid Build Coastguard Worker
216*9880d681SAndroid Build Coastguard Workerdo.body479.backedge:
217*9880d681SAndroid Build Coastguard Worker  %incdec.ptr480 = getelementptr i8, i8* %incdec.ptr4803316, i64 1
218*9880d681SAndroid Build Coastguard Worker  %cmp483 = icmp eq i8 undef, 0
219*9880d681SAndroid Build Coastguard Worker  br i1 %cmp483, label %if.end517, label %do.body479.backedge.land.rhs485_crit_edge
220*9880d681SAndroid Build Coastguard Worker
221*9880d681SAndroid Build Coastguard Workerdo.body479.backedge.land.rhs485_crit_edge:
222*9880d681SAndroid Build Coastguard Worker  br label %land.rhs485
223*9880d681SAndroid Build Coastguard Worker
224*9880d681SAndroid Build Coastguard Workerif.end517:
225*9880d681SAndroid Build Coastguard Worker  %q.4 = phi i8* [ undef, %sw.bb474 ], [ undef, %do.body479.preheader ], [ %incdec.ptr480, %do.body479.backedge ], [ %incdec.ptr4803316, %land.lhs.true504 ]
226*9880d681SAndroid Build Coastguard Worker  switch i32 %last.13371, label %if.then532 [
227*9880d681SAndroid Build Coastguard Worker    i32 383, label %for.cond534
228*9880d681SAndroid Build Coastguard Worker    i32 356, label %for.cond534
229*9880d681SAndroid Build Coastguard Worker    i32 324, label %for.cond534
230*9880d681SAndroid Build Coastguard Worker    i32 24, label %for.cond534
231*9880d681SAndroid Build Coastguard Worker    i32 11, label %for.cond534
232*9880d681SAndroid Build Coastguard Worker  ]
233*9880d681SAndroid Build Coastguard Worker
234*9880d681SAndroid Build Coastguard Workerif.then532:
235*9880d681SAndroid Build Coastguard Worker  store i8 0, i8* getelementptr inbounds ([512 x i8], [512 x i8]* @SyFgets.yank, i64 0, i64 0), align 16, !tbaa !5
236*9880d681SAndroid Build Coastguard Worker  br label %for.cond534
237*9880d681SAndroid Build Coastguard Worker
238*9880d681SAndroid Build Coastguard Workerfor.cond534:
239*9880d681SAndroid Build Coastguard Worker  %cmp536 = icmp eq i8 undef, 0
240*9880d681SAndroid Build Coastguard Worker  br i1 %cmp536, label %for.cond542.preheader, label %for.cond534
241*9880d681SAndroid Build Coastguard Worker
242*9880d681SAndroid Build Coastguard Workerfor.cond542.preheader:
243*9880d681SAndroid Build Coastguard Worker  br i1 undef, label %for.body545, label %for.end552
244*9880d681SAndroid Build Coastguard Worker
245*9880d681SAndroid Build Coastguard Workerfor.body545:
246*9880d681SAndroid Build Coastguard Worker  br i1 undef, label %for.end552, label %for.body545
247*9880d681SAndroid Build Coastguard Worker
248*9880d681SAndroid Build Coastguard Workerfor.end552:
249*9880d681SAndroid Build Coastguard Worker  %s.2.lcssa = phi i8* [ undef, %for.cond542.preheader ], [ %q.4, %for.body545 ]
250*9880d681SAndroid Build Coastguard Worker  %sub.ptr.lhs.cast553 = ptrtoint i8* %s.2.lcssa to i64
251*9880d681SAndroid Build Coastguard Worker  %sub.ptr.sub555 = sub i64 %sub.ptr.lhs.cast553, 0
252*9880d681SAndroid Build Coastguard Worker  %arrayidx556 = getelementptr i8, i8* null, i64 %sub.ptr.sub555
253*9880d681SAndroid Build Coastguard Worker  store i8 0, i8* %arrayidx556, align 1, !tbaa !5
254*9880d681SAndroid Build Coastguard Worker  br label %while.cond197.backedge
255*9880d681SAndroid Build Coastguard Worker
256*9880d681SAndroid Build Coastguard Workersw.bb566:
257*9880d681SAndroid Build Coastguard Worker  br label %while.cond197.backedge
258*9880d681SAndroid Build Coastguard Worker
259*9880d681SAndroid Build Coastguard Workerwhile.cond661:
260*9880d681SAndroid Build Coastguard Worker  br label %while.cond661
261*9880d681SAndroid Build Coastguard Worker
262*9880d681SAndroid Build Coastguard Workerwhile.cond864:
263*9880d681SAndroid Build Coastguard Worker  br label %while.cond864
264*9880d681SAndroid Build Coastguard Worker
265*9880d681SAndroid Build Coastguard Workersw.bb956:
266*9880d681SAndroid Build Coastguard Worker  br i1 undef, label %if.then959, label %while.cond197.backedge
267*9880d681SAndroid Build Coastguard Worker
268*9880d681SAndroid Build Coastguard Workerif.then959:
269*9880d681SAndroid Build Coastguard Worker  br label %while.cond962
270*9880d681SAndroid Build Coastguard Worker
271*9880d681SAndroid Build Coastguard Workerwhile.cond962:
272*9880d681SAndroid Build Coastguard Worker  br label %while.cond962
273*9880d681SAndroid Build Coastguard Worker
274*9880d681SAndroid Build Coastguard Workersw.bb979:
275*9880d681SAndroid Build Coastguard Worker  br label %while.cond197.backedge
276*9880d681SAndroid Build Coastguard Worker
277*9880d681SAndroid Build Coastguard Workerland.rhs1041:
278*9880d681SAndroid Build Coastguard Worker  unreachable
279*9880d681SAndroid Build Coastguard Worker
280*9880d681SAndroid Build Coastguard Workerif.end1070:
281*9880d681SAndroid Build Coastguard Worker  br label %sw.bb1077
282*9880d681SAndroid Build Coastguard Worker
283*9880d681SAndroid Build Coastguard Workersw.bb1077:
284*9880d681SAndroid Build Coastguard Worker  br label %while.cond197.backedge
285*9880d681SAndroid Build Coastguard Worker
286*9880d681SAndroid Build Coastguard Workersw.bb1134:
287*9880d681SAndroid Build Coastguard Worker  br i1 false, label %for.body1139, label %for.cond1145.preheader
288*9880d681SAndroid Build Coastguard Worker
289*9880d681SAndroid Build Coastguard Workerfor.cond1145.preheader:
290*9880d681SAndroid Build Coastguard Worker  br i1 %cmp293427, label %for.body1150.lr.ph, label %while.cond197.backedge
291*9880d681SAndroid Build Coastguard Worker
292*9880d681SAndroid Build Coastguard Workerfor.body1150.lr.ph:
293*9880d681SAndroid Build Coastguard Worker  unreachable
294*9880d681SAndroid Build Coastguard Worker
295*9880d681SAndroid Build Coastguard Workerfor.body1139:
296*9880d681SAndroid Build Coastguard Worker  unreachable
297*9880d681SAndroid Build Coastguard Worker
298*9880d681SAndroid Build Coastguard Workersw.default:
299*9880d681SAndroid Build Coastguard Worker  br label %while.cond197.backedge
300*9880d681SAndroid Build Coastguard Worker
301*9880d681SAndroid Build Coastguard Workerwhile.end1465:
302*9880d681SAndroid Build Coastguard Worker  %oldc.1.lcssa = phi i32 [ 0, %do.end ], [ %oldc.1.be, %while.cond197.backedge ]
303*9880d681SAndroid Build Coastguard Worker  %ch.21.lcssa = phi i32 [ %..ch.19, %do.end ], [ %last.1.be, %while.cond197.backedge ]
304*9880d681SAndroid Build Coastguard Worker  switch i32 %ch.21.lcssa, label %for.cond1480.preheader [
305*9880d681SAndroid Build Coastguard Worker    i32 -1, label %if.then1477
306*9880d681SAndroid Build Coastguard Worker    i32 15, label %if.then1477
307*9880d681SAndroid Build Coastguard Worker    i32 13, label %if.then1477
308*9880d681SAndroid Build Coastguard Worker    i32 10, label %if.then1477
309*9880d681SAndroid Build Coastguard Worker  ]
310*9880d681SAndroid Build Coastguard Worker
311*9880d681SAndroid Build Coastguard Workerfor.cond1480.preheader:
312*9880d681SAndroid Build Coastguard Worker  br i1 undef, label %for.body1606.lr.ph, label %for.end1609
313*9880d681SAndroid Build Coastguard Worker
314*9880d681SAndroid Build Coastguard Workerif.then1477:
315*9880d681SAndroid Build Coastguard Worker  %p.1.lcssa3539 = phi i8* [ null, %while.end1465 ], [ null, %while.end1465 ], [ null, %while.end1465 ], [ null, %while.end1465 ], [ %line, %while.body200 ]
316*9880d681SAndroid Build Coastguard Worker  %call1.i3057 = call i64 @"\01_write"(i32 undef, i8* undef, i64 1)
317*9880d681SAndroid Build Coastguard Worker  %sub.ptr.lhs.cast1717 = ptrtoint i8* %p.1.lcssa3539 to i64
318*9880d681SAndroid Build Coastguard Worker  %sub.ptr.sub1719 = sub i64 %sub.ptr.lhs.cast1717, %sub.ptr.rhs.cast646
319*9880d681SAndroid Build Coastguard Worker  %idx.neg1727 = sub i64 0, %sub.ptr.sub1719
320*9880d681SAndroid Build Coastguard Worker  br label %for.body1723
321*9880d681SAndroid Build Coastguard Worker
322*9880d681SAndroid Build Coastguard Workerfor.body1606.lr.ph:
323*9880d681SAndroid Build Coastguard Worker  br label %for.end1609
324*9880d681SAndroid Build Coastguard Worker
325*9880d681SAndroid Build Coastguard Workerfor.end1609:
326*9880d681SAndroid Build Coastguard Worker  br i1 undef, label %for.cond1659.preheader, label %land.lhs.true1614
327*9880d681SAndroid Build Coastguard Worker
328*9880d681SAndroid Build Coastguard Workerland.lhs.true1614:
329*9880d681SAndroid Build Coastguard Worker  br label %for.cond1659.preheader
330*9880d681SAndroid Build Coastguard Worker
331*9880d681SAndroid Build Coastguard Workerfor.cond1659.preheader:
332*9880d681SAndroid Build Coastguard Worker  %cmp16623414 = icmp ult i8* undef, %add.ptr1603
333*9880d681SAndroid Build Coastguard Worker  br i1 %cmp16623414, label %for.body1664.lr.ph, label %while.body1703.lr.ph
334*9880d681SAndroid Build Coastguard Worker
335*9880d681SAndroid Build Coastguard Workerfor.body1664.lr.ph:
336*9880d681SAndroid Build Coastguard Worker  %cmp16773405 = icmp slt i64 undef, undef
337*9880d681SAndroid Build Coastguard Worker  br i1 %cmp16773405, label %while.body1679, label %while.cond1683.preheader
338*9880d681SAndroid Build Coastguard Worker
339*9880d681SAndroid Build Coastguard Workerwhile.body1703.lr.ph:
340*9880d681SAndroid Build Coastguard Worker  unreachable
341*9880d681SAndroid Build Coastguard Worker
342*9880d681SAndroid Build Coastguard Workerwhile.cond1683.preheader:
343*9880d681SAndroid Build Coastguard Worker  br i1 undef, label %while.body1691, label %while.end1693
344*9880d681SAndroid Build Coastguard Worker
345*9880d681SAndroid Build Coastguard Workerwhile.body1679:
346*9880d681SAndroid Build Coastguard Worker  %oldc.43406 = phi i32 [ %inc, %syEchoch.exit3070 ], [ %oldc.1.lcssa, %for.body1664.lr.ph ]
347*9880d681SAndroid Build Coastguard Worker  %4 = load %struct.TMP.2*, %struct.TMP.2** %echo.i3101, align 8, !tbaa !6
348*9880d681SAndroid Build Coastguard Worker  %call.i3062 = call i32 @fileno(%struct.TMP.2* %4)
349*9880d681SAndroid Build Coastguard Worker  br i1 undef, label %if.then.i3069, label %syEchoch.exit3070
350*9880d681SAndroid Build Coastguard Worker
351*9880d681SAndroid Build Coastguard Workerif.then.i3069:
352*9880d681SAndroid Build Coastguard Worker  br label %syEchoch.exit3070
353*9880d681SAndroid Build Coastguard Worker
354*9880d681SAndroid Build Coastguard WorkersyEchoch.exit3070:
355*9880d681SAndroid Build Coastguard Worker  %inc = add i32 %oldc.43406, 1
356*9880d681SAndroid Build Coastguard Worker  %conv1672 = sext i32 %inc to i64
357*9880d681SAndroid Build Coastguard Worker  %cmp1677 = icmp slt i64 %conv1672, undef
358*9880d681SAndroid Build Coastguard Worker  br i1 %cmp1677, label %while.body1679, label %while.cond1683.preheader
359*9880d681SAndroid Build Coastguard Worker
360*9880d681SAndroid Build Coastguard Workerwhile.body1691:
361*9880d681SAndroid Build Coastguard Worker  unreachable
362*9880d681SAndroid Build Coastguard Worker
363*9880d681SAndroid Build Coastguard Workerwhile.end1693:
364*9880d681SAndroid Build Coastguard Worker  unreachable
365*9880d681SAndroid Build Coastguard Worker
366*9880d681SAndroid Build Coastguard Workerfor.body1723:
367*9880d681SAndroid Build Coastguard Worker  %q.303203 = phi i8* [ getelementptr inbounds ([8192 x i8], [8192 x i8]* @syHistory, i64 0, i64 8189), %if.then1477 ], [ %incdec.ptr1730, %for.body1723 ]
368*9880d681SAndroid Build Coastguard Worker  %add.ptr1728 = getelementptr i8, i8* %q.303203, i64 %idx.neg1727
369*9880d681SAndroid Build Coastguard Worker  %5 = load i8, i8* %add.ptr1728, align 1, !tbaa !5
370*9880d681SAndroid Build Coastguard Worker  %incdec.ptr1730 = getelementptr i8, i8* %q.303203, i64 -1
371*9880d681SAndroid Build Coastguard Worker  br label %for.body1723
372*9880d681SAndroid Build Coastguard Worker
373*9880d681SAndroid Build Coastguard Workercleanup:
374*9880d681SAndroid Build Coastguard Worker  ret i8* undef
375*9880d681SAndroid Build Coastguard Worker}
376*9880d681SAndroid Build Coastguard Worker
377*9880d681SAndroid Build Coastguard Workerdeclare i32 @fileno(%struct.TMP.2* nocapture)
378*9880d681SAndroid Build Coastguard Workerdeclare i64 @"\01_write"(i32, i8*, i64)
379*9880d681SAndroid Build Coastguard Workerdeclare i32 @__maskrune(i32, i64)
380*9880d681SAndroid Build Coastguard Workerdeclare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1)
381*9880d681SAndroid Build Coastguard Worker
382*9880d681SAndroid Build Coastguard Worker!llvm.ident = !{!0}
383*9880d681SAndroid Build Coastguard Worker
384*9880d681SAndroid Build Coastguard Worker!0 = !{!"clang version 3.5.0 (trunk 204257)"}
385*9880d681SAndroid Build Coastguard Worker!1 = !{!2, !2, i64 0}
386*9880d681SAndroid Build Coastguard Worker!2 = !{!"int", !3, i64 0}
387*9880d681SAndroid Build Coastguard Worker!3 = !{!"omnipotent char", !4, i64 0}
388*9880d681SAndroid Build Coastguard Worker!4 = !{!"Simple C/C++ TBAA"}
389*9880d681SAndroid Build Coastguard Worker!5 = !{!3, !3, i64 0}
390*9880d681SAndroid Build Coastguard Worker!6 = !{!7, !8, i64 8}
391*9880d681SAndroid Build Coastguard Worker!7 = !{!"", !8, i64 0, !8, i64 8, !3, i64 16}
392*9880d681SAndroid Build Coastguard Worker!8 = !{!"any pointer", !3, i64 0}
393