brintos

brintos / llvm-project-archived public Read only

0
0
Text · 23.8 KiB · a7d5261 Raw
741 lines · plain
1; This is a copy of test/CodeGen/X86/ragreedy-hoist-spill.ll. It generates2; sufficiently interesting differences between the default eviction heuristic3; and the test ML policy: different eviction choices, and different reward.4;5;6%struct.TMP.1 = type { %struct.TMP.2*, %struct.TMP.2*, [1024 x i8] }7%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%struct.TMP.4 = type opaque9%struct.TMP.3 = type { i8*, i32 }10 11@syBuf = external global [16 x %struct.TMP.1], align 1612@syHistory = external global [8192 x i8], align 1613@SyFgets.yank = external global [512 x i8], align 1614@syCTRO = external global i32, align 415 16define i8* @SyFgets(i8* %line, i64 %length, i64 %fid) {17entry:18  %sub.ptr.rhs.cast646 = ptrtoint i8* %line to i6419  %old = alloca [512 x i8], align 1620  %0 = getelementptr inbounds [512 x i8], [512 x i8]* %old, i64 0, i64 021  switch i64 %fid, label %if.then [22    i64 2, label %if.end23    i64 0, label %if.end24  ]25 26if.then:27  br label %cleanup28 29if.end:30  switch i64 undef, label %if.end25 [31    i64 0, label %if.then432    i64 1, label %if.end2533  ]34 35if.then4:36  br i1 undef, label %SyTime.exit, label %if.then.i37 38if.then.i:39  unreachable40 41SyTime.exit:42  br i1 undef, label %SyTime.exit2681, label %if.then.i267343 44if.then.i2673:45  unreachable46 47SyTime.exit2681:48  br label %cleanup49 50land.lhs.true14:51  unreachable52 53if.end25:54  br i1 undef, label %SyTime.exit2720, label %if.then.i271255 56if.then.i2712:57  unreachable58 59SyTime.exit2720:60  %add.ptr = getelementptr [512 x i8], [512 x i8]* %old, i64 0, i64 51261  %cmp293427 = icmp ult i8* %0, %add.ptr62  br i1 %cmp293427, label %for.body.lr.ph, label %while.body.preheader63 64for.body.lr.ph:65  call void @llvm.memset.p0i8.i64(i8* align 16 undef, i8 32, i64 512, i1 false)66  br label %while.body.preheader67 68while.body.preheader:69  %add.ptr1603 = getelementptr [512 x i8], [512 x i8]* null, i64 0, i64 51270  %echo.i3101 = getelementptr [16 x %struct.TMP.1], [16 x %struct.TMP.1]* @syBuf, i64 0, i64 %fid, i32 171  %1 = xor i64 %sub.ptr.rhs.cast646, -172  br label %do.body73 74do.body:75  %ch2.0 = phi i32 [ 0, %while.body.preheader ], [ %ch.12.ch2.12, %do.body ]76  %rep.0 = phi i32 [ 1, %while.body.preheader ], [ %rep.6, %do.body ]77  store i32 0, i32* @syCTRO, align 4, !tbaa !178  %ch.0.ch2.0 = select i1 undef, i32 14, i32 %ch2.079  %ch2.2 = select i1 undef, i32 0, i32 %ch.0.ch2.080  %ch.2.ch2.2 = select i1 undef, i32 0, i32 %ch2.281  %ch2.4 = select i1 undef, i32 278, i32 %ch.2.ch2.282  %ch2.5 = select i1 undef, i32 0, i32 %ch2.483  %rep.2 = select i1 undef, i32 undef, i32 %rep.084  %ch.5.ch2.5 = select i1 undef, i32 undef, i32 %ch2.585  %ch2.7 = select i1 undef, i32 0, i32 %ch.5.ch2.586  %rep.3 = select i1 undef, i32 undef, i32 %rep.287  %ch.7.ch2.7 = select i1 false, i32 0, i32 %ch2.788  %mul98.rep.3 = select i1 false, i32 0, i32 %rep.389  %ch2.9 = select i1 undef, i32 undef, i32 %ch.7.ch2.790  %rep.5 = select i1 undef, i32 undef, i32 %mul98.rep.391  %ch2.10 = select i1 false, i32 undef, i32 %ch2.992  %rep.6 = select i1 false, i32 undef, i32 %rep.593  %isdigittmp = add i32 %ch2.10, -4894  %isdigit = icmp ult i32 %isdigittmp, 1095  %cmp119 = icmp eq i32 undef, 2296  %or.cond1875 = and i1 %isdigit, %cmp11997  %ch.10.ch2.10 = select i1 %or.cond1875, i32 undef, i32 %ch2.1098  %.ch.10 = select i1 %or.cond1875, i32 0, i32 undef99  %ch2.12 = select i1 undef, i32 %.ch.10, i32 %ch.10.ch2.10100  %ch.12 = select i1 undef, i32 0, i32 %.ch.10101  %ch.12.ch2.12 = select i1 false, i32 %ch.12, i32 %ch2.12102  %.ch.12 = select i1 false, i32 0, i32 %ch.12103  %cmp147 = icmp eq i32 %.ch.12, 0104  br i1 %cmp147, label %do.body, label %do.end105 106do.end:107  %cmp164 = icmp eq i32 %ch.12.ch2.12, 21108  %mul167 = shl i32 %rep.6, 2109  %rep.8 = select i1 %cmp164, i32 %mul167, i32 %rep.6110  %..ch.19 = select i1 false, i32 2, i32 0111  br i1 undef, label %while.body200, label %while.end1465112 113while.body200:114  %dec3386.in = phi i32 [ %dec3386, %while.cond197.backedge ], [ %rep.8, %do.end ]115  %oldc.13384 = phi i32 [ %oldc.1.be, %while.cond197.backedge ], [ 0, %do.end ]116  %ch.213379 = phi i32 [ %last.1.be, %while.cond197.backedge ], [ %..ch.19, %do.end ]117  %last.13371 = phi i32 [ %last.1.be, %while.cond197.backedge ], [ 0, %do.end ]118  %dec3386 = add i32 %dec3386.in, -1119  switch i32 %ch.213379, label %sw.default [120    i32 1, label %while.cond201.preheader121    i32 322, label %sw.bb206122    i32 354, label %sw.bb206123    i32 2, label %sw.bb243124    i32 364, label %sw.bb1077125    i32 326, label %sw.bb256126    i32 358, label %sw.bb256127    i32 341, label %sw.bb979128    i32 323, label %while.cond1037.preheader129    i32 373, label %sw.bb979130    i32 4, label %if.then1477131    i32 332, label %sw.bb1077132    i32 11, label %for.cond357133    i32 355, label %while.cond1037.preheader134    i32 324, label %sw.bb474135    i32 356, label %sw.bb474136    i32 20, label %sw.bb566137    i32 -1, label %while.cond197.backedge138    i32 268, label %sw.bb1134139    i32 16, label %while.cond635.preheader140    i32 18, label %sw.bb956141    i32 316, label %while.cond864142  ]143 144while.cond1037.preheader:145  %cmp10393273 = icmp eq i8 undef, 0146  br i1 %cmp10393273, label %if.end1070, label %land.rhs1041147 148while.cond635.preheader:149  br i1 undef, label %for.body643.us, label %while.cond661150 151for.body643.us:152  br label %for.body643.us153 154while.cond201.preheader:155  %umax = select i1 false, i64 undef, i64 %1156  %2 = xor i64 %umax, -1157  %3 = inttoptr i64 %2 to i8*158  br label %while.cond197.backedge159 160sw.bb206:161  br label %while.cond197.backedge162 163sw.bb243:164  br label %while.cond197.backedge165 166sw.bb256:167  br label %while.cond197.backedge168 169while.cond197.backedge:170  %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 ]171  %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 ]172  %cmp198 = icmp sgt i32 %dec3386, 0173  br i1 %cmp198, label %while.body200, label %while.end1465174 175for.cond357:176  br label %for.cond357177 178sw.bb474:179  ; spill is hoisted here. Although loop depth1 is even hotter than loop depth2, sw.bb474 is still cold.180  %cmp476 = icmp eq i8 undef, 0181  br i1 %cmp476, label %if.end517, label %do.body479.preheader182 183do.body479.preheader:184  %cmp4833314 = icmp eq i8 undef, 0185  br i1 %cmp4833314, label %if.end517, label %land.rhs485186 187land.rhs485:188  %incdec.ptr4803316 = phi i8* [ %incdec.ptr480, %do.body479.backedge.land.rhs485_crit_edge ], [ undef, %do.body479.preheader ]189  %isascii.i.i27763151 = icmp sgt i8 undef, -1190  br i1 %isascii.i.i27763151, label %cond.true.i.i2780, label %cond.false.i.i2782191 192cond.true.i.i2780:193  br i1 undef, label %land.lhs.true490, label %lor.rhs500194 195cond.false.i.i2782:196  unreachable197 198land.lhs.true490:199  br i1 false, label %lor.rhs500, label %do.body479.backedge200 201lor.rhs500:202  ; Make sure spill is hoisted to a cold preheader in outside loop.203  %call3.i.i2792 = call i32 @__maskrune(i32 undef, i64 256)204  br i1 undef, label %land.lhs.true504, label %do.body479.backedge205 206land.lhs.true504:207  br i1 undef, label %do.body479.backedge, label %if.end517208 209do.body479.backedge:210  %incdec.ptr480 = getelementptr i8, i8* %incdec.ptr4803316, i64 1211  %cmp483 = icmp eq i8 undef, 0212  br i1 %cmp483, label %if.end517, label %do.body479.backedge.land.rhs485_crit_edge213 214do.body479.backedge.land.rhs485_crit_edge:215  br label %land.rhs485216 217if.end517:218  %q.4 = phi i8* [ undef, %sw.bb474 ], [ undef, %do.body479.preheader ], [ %incdec.ptr480, %do.body479.backedge ], [ %incdec.ptr4803316, %land.lhs.true504 ]219  switch i32 %last.13371, label %if.then532 [220    i32 383, label %for.cond534221    i32 356, label %for.cond534222    i32 324, label %for.cond534223    i32 24, label %for.cond534224    i32 11, label %for.cond534225  ]226 227if.then532:228  store i8 0, i8* getelementptr inbounds ([512 x i8], [512 x i8]* @SyFgets.yank, i64 0, i64 0), align 16, !tbaa !5229  br label %for.cond534230 231for.cond534:232  %cmp536 = icmp eq i8 undef, 0233  br i1 %cmp536, label %for.cond542.preheader, label %for.cond534234 235for.cond542.preheader:236  br i1 undef, label %for.body545, label %for.end552237 238for.body545:239  br i1 undef, label %for.end552, label %for.body545240 241for.end552:242  %s.2.lcssa = phi i8* [ undef, %for.cond542.preheader ], [ %q.4, %for.body545 ]243  %sub.ptr.lhs.cast553 = ptrtoint i8* %s.2.lcssa to i64244  %sub.ptr.sub555 = sub i64 %sub.ptr.lhs.cast553, 0245  %arrayidx556 = getelementptr i8, i8* null, i64 %sub.ptr.sub555246  store i8 0, i8* %arrayidx556, align 1, !tbaa !5247  br label %while.cond197.backedge248 249sw.bb566:250  br label %while.cond197.backedge251 252while.cond661:253  br label %while.cond661254 255while.cond864:256  br label %while.cond864257 258sw.bb956:259  br i1 undef, label %if.then959, label %while.cond197.backedge260 261if.then959:262  br label %while.cond962263 264while.cond962:265  br label %while.cond962266 267sw.bb979:268  br label %while.cond197.backedge269 270land.rhs1041:271  unreachable272 273if.end1070:274  br label %sw.bb1077275 276sw.bb1077:277  br label %while.cond197.backedge278 279sw.bb1134:280  br i1 false, label %for.body1139, label %for.cond1145.preheader281 282for.cond1145.preheader:283  br i1 %cmp293427, label %for.body1150.lr.ph, label %while.cond197.backedge284 285for.body1150.lr.ph:286  unreachable287 288for.body1139:289  unreachable290 291sw.default:292  br label %while.cond197.backedge293 294while.end1465:295  %oldc.1.lcssa = phi i32 [ 0, %do.end ], [ %oldc.1.be, %while.cond197.backedge ]296  %ch.21.lcssa = phi i32 [ %..ch.19, %do.end ], [ %last.1.be, %while.cond197.backedge ]297  switch i32 %ch.21.lcssa, label %for.cond1480.preheader [298    i32 -1, label %if.then1477299    i32 15, label %if.then1477300    i32 13, label %if.then1477301    i32 10, label %if.then1477302  ]303 304for.cond1480.preheader:305  br i1 undef, label %for.body1606.lr.ph, label %for.end1609306 307if.then1477:308  %p.1.lcssa3539 = phi i8* [ null, %while.end1465 ], [ null, %while.end1465 ], [ null, %while.end1465 ], [ null, %while.end1465 ], [ %line, %while.body200 ]309  %call1.i3057 = call i64 @"\01_write"(i32 undef, i8* undef, i64 1)310  %sub.ptr.lhs.cast1717 = ptrtoint i8* %p.1.lcssa3539 to i64311  %sub.ptr.sub1719 = sub i64 %sub.ptr.lhs.cast1717, %sub.ptr.rhs.cast646312  %idx.neg1727 = sub i64 0, %sub.ptr.sub1719313  br label %for.body1723314 315for.body1606.lr.ph:316  br label %for.end1609317 318for.end1609:319  br i1 undef, label %for.cond1659.preheader, label %land.lhs.true1614320 321land.lhs.true1614:322  br label %for.cond1659.preheader323 324for.cond1659.preheader:325  %cmp16623414 = icmp ult i8* undef, %add.ptr1603326  br i1 %cmp16623414, label %for.body1664.lr.ph, label %while.body1703.lr.ph327 328for.body1664.lr.ph:329  %cmp16773405 = icmp slt i64 undef, undef330  br i1 %cmp16773405, label %while.body1679, label %while.cond1683.preheader331 332while.body1703.lr.ph:333  unreachable334 335while.cond1683.preheader:336  br i1 undef, label %while.body1691, label %while.end1693337 338while.body1679:339  %oldc.43406 = phi i32 [ %inc, %syEchoch.exit3070 ], [ %oldc.1.lcssa, %for.body1664.lr.ph ]340  %4 = load %struct.TMP.2*, %struct.TMP.2** %echo.i3101, align 8, !tbaa !6341  %call.i3062 = call i32 @fileno(%struct.TMP.2* %4)342  br i1 undef, label %if.then.i3069, label %syEchoch.exit3070343 344if.then.i3069:345  br label %syEchoch.exit3070346 347syEchoch.exit3070:348  %inc = add i32 %oldc.43406, 1349  %conv1672 = sext i32 %inc to i64350  %cmp1677 = icmp slt i64 %conv1672, undef351  br i1 %cmp1677, label %while.body1679, label %while.cond1683.preheader352 353while.body1691:354  unreachable355 356while.end1693:357  unreachable358 359for.body1723:360  %q.303203 = phi i8* [ getelementptr inbounds ([8192 x i8], [8192 x i8]* @syHistory, i64 0, i64 8189), %if.then1477 ], [ %incdec.ptr1730, %for.body1723 ]361  %add.ptr1728 = getelementptr i8, i8* %q.303203, i64 %idx.neg1727362  %5 = load i8, i8* %add.ptr1728, align 1, !tbaa !5363  %incdec.ptr1730 = getelementptr i8, i8* %q.303203, i64 -1364  br label %for.body1723365 366cleanup:367  ret i8* undef368}369 370 371define i8* @SyFgetsCopy(i8* %line, i64 %length, i64 %fid) {372entry:373  %sub.ptr.rhs.cast646 = ptrtoint i8* %line to i64374  %old = alloca [512 x i8], align 16375  %0 = getelementptr inbounds [512 x i8], [512 x i8]* %old, i64 0, i64 0376  switch i64 %fid, label %if.then [377    i64 2, label %if.end378    i64 0, label %if.end379  ]380 381if.then:382  br label %cleanup383 384if.end:385  switch i64 undef, label %if.end25 [386    i64 0, label %if.then4387    i64 1, label %if.end25388  ]389 390if.then4:391  br i1 undef, label %SyTime.exit, label %if.then.i392 393if.then.i:394  unreachable395 396SyTime.exit:397  br i1 undef, label %SyTime.exit2681, label %if.then.i2673398 399if.then.i2673:400  unreachable401 402SyTime.exit2681:403  br label %cleanup404 405land.lhs.true14:406  unreachable407 408if.end25:409  br i1 undef, label %SyTime.exit2720, label %if.then.i2712410 411if.then.i2712:412  unreachable413 414SyTime.exit2720:415  %add.ptr = getelementptr [512 x i8], [512 x i8]* %old, i64 0, i64 512416  %cmp293427 = icmp ult i8* %0, %add.ptr417  br i1 %cmp293427, label %for.body.lr.ph, label %while.body.preheader418 419for.body.lr.ph:420  call void @llvm.memset.p0i8.i64(i8* align 16 undef, i8 32, i64 512, i1 false)421  br label %while.body.preheader422 423while.body.preheader:424  %add.ptr1603 = getelementptr [512 x i8], [512 x i8]* null, i64 0, i64 512425  %echo.i3101 = getelementptr [16 x %struct.TMP.1], [16 x %struct.TMP.1]* @syBuf, i64 0, i64 %fid, i32 1426  %1 = xor i64 %sub.ptr.rhs.cast646, -1427  br label %do.body428 429do.body:430  %ch2.0 = phi i32 [ 0, %while.body.preheader ], [ %ch.12.ch2.12, %do.body ]431  %rep.0 = phi i32 [ 1, %while.body.preheader ], [ %rep.6, %do.body ]432  store i32 0, i32* @syCTRO, align 4, !tbaa !1433  %ch.0.ch2.0 = select i1 undef, i32 14, i32 %ch2.0434  %ch2.2 = select i1 undef, i32 0, i32 %ch.0.ch2.0435  %ch.2.ch2.2 = select i1 undef, i32 0, i32 %ch2.2436  %ch2.4 = select i1 undef, i32 278, i32 %ch.2.ch2.2437  %ch2.5 = select i1 undef, i32 0, i32 %ch2.4438  %rep.2 = select i1 undef, i32 undef, i32 %rep.0439  %ch.5.ch2.5 = select i1 undef, i32 undef, i32 %ch2.5440  %ch2.7 = select i1 undef, i32 0, i32 %ch.5.ch2.5441  %rep.3 = select i1 undef, i32 undef, i32 %rep.2442  %ch.7.ch2.7 = select i1 false, i32 0, i32 %ch2.7443  %mul98.rep.3 = select i1 false, i32 0, i32 %rep.3444  %ch2.9 = select i1 undef, i32 undef, i32 %ch.7.ch2.7445  %rep.5 = select i1 undef, i32 undef, i32 %mul98.rep.3446  %ch2.10 = select i1 false, i32 undef, i32 %ch2.9447  %rep.6 = select i1 false, i32 undef, i32 %rep.5448  %isdigittmp = add i32 %ch2.10, -48449  %isdigit = icmp ult i32 %isdigittmp, 10450  %cmp119 = icmp eq i32 undef, 22451  %or.cond1875 = and i1 %isdigit, %cmp119452  %ch.10.ch2.10 = select i1 %or.cond1875, i32 undef, i32 %ch2.10453  %.ch.10 = select i1 %or.cond1875, i32 0, i32 undef454  %ch2.12 = select i1 undef, i32 %.ch.10, i32 %ch.10.ch2.10455  %ch.12 = select i1 undef, i32 0, i32 %.ch.10456  %ch.12.ch2.12 = select i1 false, i32 %ch.12, i32 %ch2.12457  %.ch.12 = select i1 false, i32 0, i32 %ch.12458  %cmp147 = icmp eq i32 %.ch.12, 0459  br i1 %cmp147, label %do.body, label %do.end460 461do.end:462  %cmp164 = icmp eq i32 %ch.12.ch2.12, 21463  %mul167 = shl i32 %rep.6, 2464  %rep.8 = select i1 %cmp164, i32 %mul167, i32 %rep.6465  %..ch.19 = select i1 false, i32 2, i32 0466  br i1 undef, label %while.body200, label %while.end1465467 468while.body200:469  %dec3386.in = phi i32 [ %dec3386, %while.cond197.backedge ], [ %rep.8, %do.end ]470  %oldc.13384 = phi i32 [ %oldc.1.be, %while.cond197.backedge ], [ 0, %do.end ]471  %ch.213379 = phi i32 [ %last.1.be, %while.cond197.backedge ], [ %..ch.19, %do.end ]472  %last.13371 = phi i32 [ %last.1.be, %while.cond197.backedge ], [ 0, %do.end ]473  %dec3386 = add i32 %dec3386.in, -1474  switch i32 %ch.213379, label %sw.default [475    i32 1, label %while.cond201.preheader476    i32 322, label %sw.bb206477    i32 354, label %sw.bb206478    i32 2, label %sw.bb243479    i32 364, label %sw.bb1077480    i32 326, label %sw.bb256481    i32 358, label %sw.bb256482    i32 341, label %sw.bb979483    i32 323, label %while.cond1037.preheader484    i32 373, label %sw.bb979485    i32 4, label %if.then1477486    i32 332, label %sw.bb1077487    i32 11, label %for.cond357488    i32 355, label %while.cond1037.preheader489    i32 324, label %sw.bb474490    i32 356, label %sw.bb474491    i32 20, label %sw.bb566492    i32 -1, label %while.cond197.backedge493    i32 268, label %sw.bb1134494    i32 16, label %while.cond635.preheader495    i32 18, label %sw.bb956496    i32 316, label %while.cond864497  ]498 499while.cond1037.preheader:500  %cmp10393273 = icmp eq i8 undef, 0501  br i1 %cmp10393273, label %if.end1070, label %land.rhs1041502 503while.cond635.preheader:504  br i1 undef, label %for.body643.us, label %while.cond661505 506for.body643.us:507  br label %for.body643.us508 509while.cond201.preheader:510  %umax = select i1 false, i64 undef, i64 %1511  %2 = xor i64 %umax, -1512  %3 = inttoptr i64 %2 to i8*513  br label %while.cond197.backedge514 515sw.bb206:516  br label %while.cond197.backedge517 518sw.bb243:519  br label %while.cond197.backedge520 521sw.bb256:522  br label %while.cond197.backedge523 524while.cond197.backedge:525  %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 ]526  %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 ]527  %cmp198 = icmp sgt i32 %dec3386, 0528  br i1 %cmp198, label %while.body200, label %while.end1465529 530for.cond357:531  br label %for.cond357532 533sw.bb474:534  ; spill is hoisted here. Although loop depth1 is even hotter than loop depth2, sw.bb474 is still cold.535  %cmp476 = icmp eq i8 undef, 0536  br i1 %cmp476, label %if.end517, label %do.body479.preheader537 538do.body479.preheader:539  %cmp4833314 = icmp eq i8 undef, 0540  br i1 %cmp4833314, label %if.end517, label %land.rhs485541 542land.rhs485:543  %incdec.ptr4803316 = phi i8* [ %incdec.ptr480, %do.body479.backedge.land.rhs485_crit_edge ], [ undef, %do.body479.preheader ]544  %isascii.i.i27763151 = icmp sgt i8 undef, -1545  br i1 %isascii.i.i27763151, label %cond.true.i.i2780, label %cond.false.i.i2782546 547cond.true.i.i2780:548  br i1 undef, label %land.lhs.true490, label %lor.rhs500549 550cond.false.i.i2782:551  unreachable552 553land.lhs.true490:554  br i1 false, label %lor.rhs500, label %do.body479.backedge555 556lor.rhs500:557  ; Make sure spill is hoisted to a cold preheader in outside loop.558  %call3.i.i2792 = call i32 @__maskrune(i32 undef, i64 256)559  br i1 undef, label %land.lhs.true504, label %do.body479.backedge560 561land.lhs.true504:562  br i1 undef, label %do.body479.backedge, label %if.end517563 564do.body479.backedge:565  %incdec.ptr480 = getelementptr i8, i8* %incdec.ptr4803316, i64 1566  %cmp483 = icmp eq i8 undef, 0567  br i1 %cmp483, label %if.end517, label %do.body479.backedge.land.rhs485_crit_edge568 569do.body479.backedge.land.rhs485_crit_edge:570  br label %land.rhs485571 572if.end517:573  %q.4 = phi i8* [ undef, %sw.bb474 ], [ undef, %do.body479.preheader ], [ %incdec.ptr480, %do.body479.backedge ], [ %incdec.ptr4803316, %land.lhs.true504 ]574  switch i32 %last.13371, label %if.then532 [575    i32 383, label %for.cond534576    i32 356, label %for.cond534577    i32 324, label %for.cond534578    i32 24, label %for.cond534579    i32 11, label %for.cond534580  ]581 582if.then532:583  store i8 0, i8* getelementptr inbounds ([512 x i8], [512 x i8]* @SyFgets.yank, i64 0, i64 0), align 16, !tbaa !5584  br label %for.cond534585 586for.cond534:587  %cmp536 = icmp eq i8 undef, 0588  br i1 %cmp536, label %for.cond542.preheader, label %for.cond534589 590for.cond542.preheader:591  br i1 undef, label %for.body545, label %for.end552592 593for.body545:594  br i1 undef, label %for.end552, label %for.body545595 596for.end552:597  %s.2.lcssa = phi i8* [ undef, %for.cond542.preheader ], [ %q.4, %for.body545 ]598  %sub.ptr.lhs.cast553 = ptrtoint i8* %s.2.lcssa to i64599  %sub.ptr.sub555 = sub i64 %sub.ptr.lhs.cast553, 0600  %arrayidx556 = getelementptr i8, i8* null, i64 %sub.ptr.sub555601  store i8 0, i8* %arrayidx556, align 1, !tbaa !5602  br label %while.cond197.backedge603 604sw.bb566:605  br label %while.cond197.backedge606 607while.cond661:608  br label %while.cond661609 610while.cond864:611  br label %while.cond864612 613sw.bb956:614  br i1 undef, label %if.then959, label %while.cond197.backedge615 616if.then959:617  br label %while.cond962618 619while.cond962:620  br label %while.cond962621 622sw.bb979:623  br label %while.cond197.backedge624 625land.rhs1041:626  unreachable627 628if.end1070:629  br label %sw.bb1077630 631sw.bb1077:632  br label %while.cond197.backedge633 634sw.bb1134:635  br i1 false, label %for.body1139, label %for.cond1145.preheader636 637for.cond1145.preheader:638  br i1 %cmp293427, label %for.body1150.lr.ph, label %while.cond197.backedge639 640for.body1150.lr.ph:641  unreachable642 643for.body1139:644  unreachable645 646sw.default:647  br label %while.cond197.backedge648 649while.end1465:650  %oldc.1.lcssa = phi i32 [ 0, %do.end ], [ %oldc.1.be, %while.cond197.backedge ]651  %ch.21.lcssa = phi i32 [ %..ch.19, %do.end ], [ %last.1.be, %while.cond197.backedge ]652  switch i32 %ch.21.lcssa, label %for.cond1480.preheader [653    i32 -1, label %if.then1477654    i32 15, label %if.then1477655    i32 13, label %if.then1477656    i32 10, label %if.then1477657  ]658 659for.cond1480.preheader:660  br i1 undef, label %for.body1606.lr.ph, label %for.end1609661 662if.then1477:663  %p.1.lcssa3539 = phi i8* [ null, %while.end1465 ], [ null, %while.end1465 ], [ null, %while.end1465 ], [ null, %while.end1465 ], [ %line, %while.body200 ]664  %call1.i3057 = call i64 @"\01_write"(i32 undef, i8* undef, i64 1)665  %sub.ptr.lhs.cast1717 = ptrtoint i8* %p.1.lcssa3539 to i64666  %sub.ptr.sub1719 = sub i64 %sub.ptr.lhs.cast1717, %sub.ptr.rhs.cast646667  %idx.neg1727 = sub i64 0, %sub.ptr.sub1719668  br label %for.body1723669 670for.body1606.lr.ph:671  br label %for.end1609672 673for.end1609:674  br i1 undef, label %for.cond1659.preheader, label %land.lhs.true1614675 676land.lhs.true1614:677  br label %for.cond1659.preheader678 679for.cond1659.preheader:680  %cmp16623414 = icmp ult i8* undef, %add.ptr1603681  br i1 %cmp16623414, label %for.body1664.lr.ph, label %while.body1703.lr.ph682 683for.body1664.lr.ph:684  %cmp16773405 = icmp slt i64 undef, undef685  br i1 %cmp16773405, label %while.body1679, label %while.cond1683.preheader686 687while.body1703.lr.ph:688  unreachable689 690while.cond1683.preheader:691  br i1 undef, label %while.body1691, label %while.end1693692 693while.body1679:694  %oldc.43406 = phi i32 [ %inc, %syEchoch.exit3070 ], [ %oldc.1.lcssa, %for.body1664.lr.ph ]695  %4 = load %struct.TMP.2*, %struct.TMP.2** %echo.i3101, align 8, !tbaa !6696  %call.i3062 = call i32 @fileno(%struct.TMP.2* %4)697  br i1 undef, label %if.then.i3069, label %syEchoch.exit3070698 699if.then.i3069:700  br label %syEchoch.exit3070701 702syEchoch.exit3070:703  %inc = add i32 %oldc.43406, 1704  %conv1672 = sext i32 %inc to i64705  %cmp1677 = icmp slt i64 %conv1672, undef706  br i1 %cmp1677, label %while.body1679, label %while.cond1683.preheader707 708while.body1691:709  unreachable710 711while.end1693:712  unreachable713 714for.body1723:715  %q.303203 = phi i8* [ getelementptr inbounds ([8192 x i8], [8192 x i8]* @syHistory, i64 0, i64 8189), %if.then1477 ], [ %incdec.ptr1730, %for.body1723 ]716  %add.ptr1728 = getelementptr i8, i8* %q.303203, i64 %idx.neg1727717  %5 = load i8, i8* %add.ptr1728, align 1, !tbaa !5718  %incdec.ptr1730 = getelementptr i8, i8* %q.303203, i64 -1719  br label %for.body1723720 721cleanup:722  ret i8* undef723}724 725declare i32 @fileno(%struct.TMP.2* nocapture)726declare i64 @"\01_write"(i32, i8*, i64)727declare i32 @__maskrune(i32, i64)728declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i1)729 730!llvm.ident = !{!0}731 732!0 = !{!"clang version 3.5.0 (trunk 204257)"}733!1 = !{!2, !2, i64 0}734!2 = !{!"int", !3, i64 0}735!3 = !{!"omnipotent char", !4, i64 0}736!4 = !{!"Simple C/C++ TBAA"}737!5 = !{!3, !3, i64 0}738!6 = !{!7, !8, i64 8}739!7 = !{!"", !8, i64 0, !8, i64 8, !3, i64 16}740!8 = !{!"any pointer", !3, i64 0}741