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