brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.0 KiB · a466b50 Raw
95 lines · plain
1; RUN: opt -passes=loop-unroll -debug-only=loop-unroll -S < %s  2>&1 | FileCheck %s2; REQUIRES: asserts3 4 5; CHECK: Loop Unroll: F[test]6; CHECK-NEXT: Not unrolling loop since parent loop has llvm.loop.unroll_and_jam7; CHECK: Loop Unroll: F[test]8; CHECK-NEXT: Not unrolling loop since it has llvm.loop.unroll_and_jam9 10define i32 @test() {11for.body4.preheader.preheader:12  br label %for.body4.preheader413 14for.body4.preheader4:                             ; preds = %for.cond.cleanup3, %for.body4.preheader.preheader15  %indvars.iv28 = phi i64 [ %indvars.iv.next29, %for.cond.cleanup3 ], [ 0, %for.body4.preheader.preheader ]16  br label %for.body417 18for.body4:                                        ; preds = %for.body4.preheader4, %for.body419  %indvars.iv = phi i64 [ %indvars.iv.next, %for.body4 ], [ 0, %for.body4.preheader4 ]20  tail call void @test2(i64 %indvars.iv28, i64 %indvars.iv)21  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 122  %exitcond.not = icmp eq i64 %indvars.iv.next, 1023  br i1 %exitcond.not, label %for.cond.cleanup3, label %for.body424 25for.cond.cleanup3:                                ; preds = %for.body426  %indvars.iv.next29 = add nuw nsw i64 %indvars.iv28, 127  %exitcond31.not = icmp eq i64 %indvars.iv.next29, 1028  br i1 %exitcond31.not, label %for.cond.cleanup, label %for.body4.preheader4, !llvm.loop !129 30for.cond.cleanup:                                 ; preds = %for.cond.cleanup331  ret i32 5532}33 34 35; CHECK: F[test_02]36; CHECK-NOT: Not unrolling loop since {{.*}}  llvm.loop.unroll_and_jam37define i32 @test_02() {38for.body4.preheader.preheader:39  br label %for.body4.preheader440 41for.body4.preheader4:                             ; preds = %for.cond.cleanup3, %for.body4.preheader.preheader42  %indvars.iv28 = phi i64 [ %indvars.iv.next29, %for.cond.cleanup3 ], [ 0, %for.body4.preheader.preheader ]43  br label %for.body444 45for.body4:                                        ; preds = %for.body4.preheader4, %for.body446  %indvars.iv = phi i64 [ %indvars.iv.next, %for.body4 ], [ 0, %for.body4.preheader4 ]47  tail call void @test2(i64 %indvars.iv28, i64 %indvars.iv)48  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 149  %exitcond.not = icmp eq i64 %indvars.iv.next, 1050  br i1 %exitcond.not, label %for.cond.cleanup3, label %for.body451 52for.cond.cleanup3:                                ; preds = %for.body453  %indvars.iv.next29 = add nuw nsw i64 %indvars.iv28, 154  %exitcond31.not = icmp eq i64 %indvars.iv.next29, 1055  br i1 %exitcond31.not, label %for.cond.cleanup, label %for.body4.preheader4, !llvm.loop !256 57for.cond.cleanup:                                 ; preds = %for.cond.cleanup358  ret i32 5559}60 61; CHECK:F[test_03]62; CHECK-NOT: Not unrolling loop since {{.*}}  llvm.loop.unroll_and_jam63define i32 @test_03() {64for.body4.preheader.preheader:65  br label %for.body4.preheader466 67for.body4.preheader4:                             ; preds = %for.cond.cleanup3, %for.body4.preheader.preheader68  %indvars.iv28 = phi i64 [ %indvars.iv.next29, %for.cond.cleanup3 ], [ 0, %for.body4.preheader.preheader ]69  br label %for.body470 71for.body4:                                        ; preds = %for.body4.preheader4, %for.body472  %indvars.iv = phi i64 [ %indvars.iv.next, %for.body4 ], [ 0, %for.body4.preheader4 ]73  tail call void @test2(i64 %indvars.iv28, i64 %indvars.iv)74  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 175  %exitcond.not = icmp eq i64 %indvars.iv.next, 1076  br i1 %exitcond.not, label %for.cond.cleanup3, label %for.body477 78for.cond.cleanup3:                                ; preds = %for.body479  %indvars.iv.next29 = add nuw nsw i64 %indvars.iv28, 180  %exitcond31.not = icmp eq i64 %indvars.iv.next29, 1081  br i1 %exitcond31.not, label %for.cond.cleanup, label %for.body4.preheader4, !llvm.loop !382 83for.cond.cleanup:                                 ; preds = %for.cond.cleanup384  ret i32 5585}86 87declare void @test2(i64 signext, i64 signext)88 89!1 = distinct !{!1, !4}90!2 = distinct !{!1, !5}91!3 = distinct !{!1, !6}92!4 = !{!"llvm.loop.unroll_and_jam.count", i32 4}93!5 = !{!"llvm.loop.unroll_and_jam.count", i32 1}94!6 = !{!"llvm.loop.unroll_and_jam.disable"}95