brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · b73f695 Raw
29 lines · plain
1; RUN: opt < %s -S -passes=loop-unroll -pass-remarks=loop-unroll -pass-remarks-with-hotness -unroll-count=16 2>&1 | FileCheck -check-prefix=COMPLETE-UNROLL %s2; RUN: opt < %s -S -passes=loop-unroll -pass-remarks=loop-unroll -pass-remarks-with-hotness -unroll-count=4 2>&1 | FileCheck -check-prefix=PARTIAL-UNROLL %s3 4; COMPLETE-UNROLL: remark: {{.*}}: completely unrolled loop with 16 iterations (hotness: 300)5; PARTIAL-UNROLL: remark: {{.*}}: unrolled loop by a factor of 4 (hotness: 300)6 7define i32 @sum() !prof !0 {8entry:9  br label %for.body10 11for.body:                                         ; preds = %for.body, %entry12  %s.06 = phi i32 [ 0, %entry ], [ %add1, %for.body ]13  %i.05 = phi i32 [ 0, %entry ], [ %inc, %for.body ]14  %add = add nsw i32 %i.05, 415  %call = tail call i32 @baz(i32 %add) #216  %add1 = add nsw i32 %call, %s.0617  %inc = add nsw i32 %i.05, 118  %exitcond = icmp eq i32 %inc, 1619  br i1 %exitcond, label %for.end, label %for.body, !prof !120 21for.end:                                          ; preds = %for.body22  ret i32 %add123}24 25declare i32 @baz(i32)26 27!0 = !{!"function_entry_count", i64 3}28!1 = !{!"branch_weights", i32 1, i32 99}29