brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.9 KiB · 859cb48 Raw
112 lines · plain
1; RUN: opt -loop-reduce -S < %s | FileCheck %s2;3; Test TransformForPostIncUse and LSR's expansion of expressions in4; post-inc form to ensure the implementation can handle expressions5; DAGs, not just trees.6 7target triple = "x86_64-apple-darwin"8 9; Verify that -loop-reduce runs without "hanging" and reuses post-inc10; expansions.11; CHECK-LABEL: @test(12; CHECK: icmp13; CHECK: icmp14; CHECK: icmp15; CHECK: icmp16; CHECK: icmp17; CHECK: icmp18; CHECK: icmp19; CHECK: icmp20; CHECK: icmp21; CHECK: icmp22; CHECK: icmp23; CHECK: icmp24; CHECK: icmp25; CHECK: icmp26; CHECK: icmp27; CHECK: icmp28; CHECK: icmp29; CHECK-NOT: icmp30define void @test(ptr %base, i32 %a0) nounwind {31entry:32  br label %bb133bb1:34  %n0 = sub i32 0, %a035  %t0 = icmp ugt i32 %n0, -436  %m0 = select i1 %t0, i32 %n0, i32 -437  %a1 = add i32 %m0, %a038  %n1 = sub i32 0, %a139  %t1 = icmp ugt i32 %n1, -440  %m1 = select i1 %t1, i32 %n1, i32 -441  %a2 = add i32 %m1, %a142  %n2 = sub i32 0, %a243  %t2 = icmp ugt i32 %n2, -444  %m2 = select i1 %t2, i32 %n2, i32 -445  %a3 = add i32 %m2, %a246  %n3 = sub i32 0, %a347  %t3 = icmp ugt i32 %n3, -448  %m3 = select i1 %t3, i32 %n3, i32 -449  %a4 = add i32 %m3, %a350  %n4 = sub i32 0, %a451  %t4 = icmp ugt i32 %n4, -452  %m4 = select i1 %t4, i32 %n4, i32 -453  %a5 = add i32 %m4, %a454  %n5 = sub i32 0, %a555  %t5 = icmp ugt i32 %n5, -456  %m5 = select i1 %t5, i32 %n5, i32 -457  %a6 = add i32 %m5, %a558  %n6 = sub i32 0, %a659  %t6 = icmp ugt i32 %n6, -460  %m6 = select i1 %t6, i32 %n6, i32 -461  %a7 = add i32 %m6, %a662  %n7 = sub i32 0, %a763  %t7 = icmp ugt i32 %n7, -464  %m7 = select i1 %t7, i32 %n7, i32 -465  %a8 = add i32 %m7, %a766  %n8 = sub i32 0, %a867  %t8 = icmp ugt i32 %n8, -468  %m8 = select i1 %t8, i32 %n8, i32 -469  %a9 = add i32 %m8, %a870  %n9 = sub i32 0, %a971  %t9 = icmp ugt i32 %n9, -472  %m9 = select i1 %t9, i32 %n9, i32 -473  %a10 = add i32 %m9, %a974  %n10 = sub i32 0, %a1075  %t10 = icmp ugt i32 %n10, -476  %m10 = select i1 %t10, i32 %n10, i32 -477  %a11 = add i32 %m10, %a1078  %n11 = sub i32 0, %a1179  %t11 = icmp ugt i32 %n11, -480  %m11 = select i1 %t11, i32 %n11, i32 -481  %a12 = add i32 %m11, %a1182  %n12 = sub i32 0, %a1283  %t12 = icmp ugt i32 %n12, -484  %m12 = select i1 %t12, i32 %n12, i32 -485  %a13 = add i32 %m12, %a1286  %n13 = sub i32 0, %a1387  %t13 = icmp ugt i32 %n13, -488  %m13 = select i1 %t13, i32 %n13, i32 -489  %a14 = add i32 %m13, %a1390  %n14 = sub i32 0, %a1491  %t14 = icmp ugt i32 %n14, -492  %m14 = select i1 %t14, i32 %n14, i32 -493  %a15 = add i32 %m14, %a1494  %n15 = sub i32 0, %a1595  %t15 = icmp ugt i32 %n15, -496  %m15 = select i1 %t15, i32 %n15, i32 -497  %a16 = add i32 %m15, %a1598  %gep = getelementptr i8, ptr %base, i32 %a1699  %ofs = add i32 %a16, 4100  %limit = getelementptr i8, ptr %base, i32 %ofs101  br label %loop102 103loop:104  %iv = phi ptr [ %gep, %bb1 ], [ %inc, %loop ]105  %inc = getelementptr inbounds i8, ptr %iv, i64 1106  %exitcond = icmp eq ptr %inc, %limit107  br i1 %exitcond, label %loop, label %exit108 109exit:110  ret void111}112