Duncan P. N. Exon Smith | cb7d29d | 2014-04-25 04:38:43 +0000 | [diff] [blame] | 1 | ; RUN: opt < %s -analyze -block-freq | FileCheck %s |
Xinliang David Li | 28a9327 | 2016-05-05 21:13:27 +0000 | [diff] [blame] | 2 | ; RUN: opt < %s -passes='print<block-freq>' -disable-output 2>&1 | FileCheck %s |
Duncan P. N. Exon Smith | cb7d29d | 2014-04-25 04:38:43 +0000 | [diff] [blame] | 3 | |
| 4 | define void @double_backedge(i1 %x) { |
| 5 | ; CHECK-LABEL: Printing analysis {{.*}} for function 'double_backedge': |
| 6 | ; CHECK-NEXT: block-frequency-info: double_backedge |
| 7 | entry: |
| 8 | ; CHECK-NEXT: entry: float = 1.0, int = [[ENTRY:[0-9]+]] |
| 9 | br label %loop |
| 10 | |
| 11 | loop: |
| 12 | ; CHECK-NEXT: loop: float = 10.0, |
| 13 | br i1 %x, label %exit, label %loop.1, !prof !0 |
| 14 | |
| 15 | loop.1: |
| 16 | ; CHECK-NEXT: loop.1: float = 9.0, |
| 17 | br i1 %x, label %loop, label %loop.2, !prof !1 |
| 18 | |
| 19 | loop.2: |
| 20 | ; CHECK-NEXT: loop.2: float = 5.0, |
| 21 | br label %loop |
| 22 | |
| 23 | exit: |
| 24 | ; CHECK-NEXT: exit: float = 1.0, int = [[ENTRY]] |
| 25 | ret void |
| 26 | } |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 27 | !0 = !{!"branch_weights", i32 1, i32 9} |
| 28 | !1 = !{!"branch_weights", i32 4, i32 5} |