[PGO] MST based PGO instrumentation infrastructure
[oota-llvm.git] / test / Transforms / PGOProfile / loop2_use.ll
1 ; RUN: llvm-profdata merge %S/Inputs/loop2.proftext -o %T/loop2.profdata
2 ; RUN: opt < %s -pgo-instr-use -pgo-profile-file=%T/loop2.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 @_Z13test_do_whilei(i32 %n) {
7 entry:
8   br label %do.body
9
10 do.body:
11   %i.0 = phi i32 [ 0, %entry ], [ %inc1, %do.cond ]
12   %sum = phi i32 [ 1, %entry ], [ %inc, %do.cond ]
13   %inc = add nsw i32 %sum, 1
14   br label %do.cond
15
16 do.cond:
17   %inc1 = add nsw i32 %i.0, 1
18   %cmp = icmp slt i32 %i.0, %n
19   br i1 %cmp, label %do.body, label %do.end
20 ; CHECK: !prof !0
21
22 do.end:
23   ret i32 %inc
24 }
25
26 ; CHECK: !0 = !{!"branch_weights", i32 92, i32 4}