brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · e3cfe53 Raw
44 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt < %s -S -passes=loop-unroll,loop-unroll -verify-dom-info -debug-only=loop-unroll -unroll-peel-max-count=7 2>&1 | FileCheck %s3; REQUIRES: asserts4 5declare void @f1()6declare void @f2()7 8; Check that we can peel off iterations that make conditions true.9; The second invocation of loop-unroll will do profile based peeling of10; remained iterations.11define void @test1(i32 %k) !prof !4 {12; CHECK: Loop Unroll: F[test1] Loop %for.body13; CHECK: PEELING loop %for.body with iteration count 2!14; CHECK: PEELING loop %for.body with iteration count 5!15; CHECK: llvm.loop.unroll.disable16for.body.lr.ph:17  br label %for.body18 19for.body:20  %i.05 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.inc ]21  %cmp1 = icmp ult i32 %i.05, 222  br i1 %cmp1, label %if.then, label %if.else23 24if.then:25  call void @f1()26  br label %for.inc27 28if.else:29  call void @f2()30  br label %for.inc31 32for.inc:33  %inc = add nsw i32 %i.05, 134  %cmp = icmp slt i32 %inc, %k35  br i1 %cmp, label %for.body, label %for.end, !llvm.loop !1, !prof !236 37for.end:38  ret void39}40 41!1 = distinct !{!1}42!2 = !{!"branch_weights", i32 6, i32 1}43!4 = !{!"function_entry_count", i64 1}44