1 ; RUN: llc -O2 -ppc-reduce-cr-logicals -print-machine-bfi -o - %s 2>&1 | FileCheck %s
2 target datalayout = "e-m:e-i64:64-n32:64"
3 target triple = "powerpc64le-grtev4-linux-gnu"
5 ; First block frequency info
6 ;CHECK: block-frequency-info: loop_test
7 ;CHECK-NEXT: - BB0[entry]: float = 1.0, int = 12
8 ;CHECK-NEXT: - BB1[for.check]: float = 2.6667, int = 34
9 ;CHECK-NEXT: - BB2[test1]: float = 1.6667, int = 21
10 ;CHECK-NEXT: - BB3[optional1]: float = 0.625, int = 8
12 ;CHECK: block-frequency-info: loop_test
13 ;CHECK: block-frequency-info: loop_test
14 ;CHECK: block-frequency-info: loop_test
16 ; Last block frequency info
17 ;CHECK: block-frequency-info: loop_test
18 ;CHECK-NEXT: - BB0[entry]: float = 1.0, int = 12
19 ;CHECK-NEXT: - BB1[for.check]: float = 2.6667, int = 34
20 ;CHECK-NEXT: - BB2[for.check]: float = 2.1667, int = 27
21 ;CHECK-NEXT: - BB3[test1]: float = 1.6667, int = 21
22 ;CHECK-NEXT: - BB4[optional1]: float = 0.625, int = 8
25 define void @loop_test(i32* %tags, i32 %count) {
29 %count.loop = phi i32 [%count, %entry], [%count.sub, %for.latch]
30 %done.count = icmp ugt i32 %count.loop, 0
31 %tag_ptr = getelementptr inbounds i32, i32* %tags, i32 %count
32 %tag = load i32, i32* %tag_ptr
33 %done.tag = icmp eq i32 %tag, 0
34 %done = and i1 %done.count, %done.tag
35 br i1 %done, label %test1, label %exit, !prof !1
37 %tagbit1 = and i32 %tag, 1
38 %tagbit1eq0 = icmp eq i32 %tagbit1, 0
39 br i1 %tagbit1eq0, label %test2, label %optional1, !prof !1
47 %tagbit2 = and i32 %tag, 2
48 %tagbit2eq0 = icmp eq i32 %tagbit2, 0
49 br i1 %tagbit2eq0, label %test3, label %optional2, !prof !1
57 %tagbit3 = and i32 %tag, 4
58 %tagbit3eq0 = icmp eq i32 %tagbit3, 0
59 br i1 %tagbit3eq0, label %test4, label %optional3, !prof !1
67 %tagbit4 = and i32 %tag, 8
68 %tagbit4eq0 = icmp eq i32 %tagbit4, 0
69 br i1 %tagbit4eq0, label %for.latch, label %optional4, !prof !1
77 %count.sub = sub i32 %count.loop, 1
88 !1 = !{!"branch_weights", i32 5, i32 3}