1; RUN: llc -mcpu=corei7 -mtriple=x86_64-linux -force-precise-rotation-cost < %s | FileCheck %s
2
3define void @bar()  {
4; Test that all edges in the loop chain are fall through with profile data.
5;
6; CHECK-LABEL: bar:
7; CHECK: latch
8; CHECK: header
9; CHECK: if.then
10; CHECK: end
11
12entry:
13  br label %header
14
15header:
16  call void @e()
17  %call = call zeroext i1 @a()
18  br i1 %call, label %if.then, label %latch, !prof !1
19
20if.then:
21  call void @f()
22  %call3 = call zeroext i1 @a()
23  br i1 %call3, label %latch, label %end, !prof !2
24
25latch:
26  call void @h()
27  %call2 = call zeroext i1 @a()
28  br i1 %call2, label %header, label %end, !prof !3
29
30end:
31  ret void
32}
33
34declare zeroext i1 @a()
35declare void @e()
36declare void @f()
37declare void @g()
38declare void @h()
39
40!1 = !{!"branch_weights", i32 16, i32 16}
41!2 = !{!"branch_weights", i32 97, i32 3}
42!3 = !{!"branch_weights", i32 97, i32 3}
43