1 ; RUN: opt < %s -analyze -block-freq | FileCheck %s
2 ; RUN: opt < %s -passes='print<block-freq>' -disable-output 2>&1 | FileCheck %s
4 ; CHECK-LABEL: Printing analysis {{.*}} for function 'loop_with_branch':
5 ; CHECK-NEXT: block-frequency-info: loop_with_branch
6 define void @loop_with_branch(i32 %a) {
7 ; CHECK-NEXT: entry: float = 1.0, int = [[ENTRY:[0-9]+]]
9 %skip_loop = call i1 @foo0(i32 %a)
10 br i1 %skip_loop, label %skip, label %header, !prof !0
12 ; CHECK-NEXT: skip: float = 0.25,
16 ; CHECK-NEXT: header: float = 4.5,
18 %i = phi i32 [ 0, %entry ], [ %i.next, %back ]
19 %i.next = add i32 %i, 1
20 %choose = call i2 @foo1(i32 %i)
21 switch i2 %choose, label %exit [ i2 0, label %left
22 i2 1, label %right ], !prof !1
24 ; CHECK-NEXT: left: float = 1.5,
28 ; CHECK-NEXT: right: float = 2.25,
32 ; CHECK-NEXT: back: float = 3.75,
36 ; CHECK-NEXT: exit: float = 1.0, int = [[ENTRY]]
44 !0 = !{!"branch_weights", i32 1, i32 3}
45 !1 = !{!"branch_weights", i32 1, i32 2, i32 3}