f4eb1f35bfc852892153d9c9de35ef64c6651f10
[oota-llvm.git] / test / Transforms / PGOProfile / loop1_use.ll
1 ; RUN: llvm-profdata merge %S/Inputs/loop1.proftext -o %T/loop1.profdata
2 ; RUN: opt < %s -pgo-instr-use -pgo-profile-file=%T/loop1.profdata -S | FileCheck %s
3 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
4 target triple = "x86_64-unknown-linux-gnu"
5
6 define i32 @_Z15test_simple_fori(i32 %n) {
7 entry:
8   br label %for.cond
9
10 for.cond:
11   %i = phi i32 [ 0, %entry ], [ %inc1, %for.inc ]
12   %sum = phi i32 [ 1, %entry ], [ %inc, %for.inc ]
13   %cmp = icmp slt i32 %i, %n
14   br i1 %cmp, label %for.body, label %for.end
15 ; CHECK: !prof !0
16
17 for.body:
18   %inc = add nsw i32 %sum, 1
19   br label %for.inc
20
21 for.inc:
22   %inc1 = add nsw i32 %i, 1
23   br label %for.cond
24
25 for.end:
26   ret i32 %sum
27 }
28
29 ; CHECK: !0 = !{!"branch_weights", i32 96, i32 4}