Pass edges weights to MachineBasicBlock::addSuccessor in TailDuplicatePass to
[oota-llvm.git] / test / CodeGen / ARM / taildup-branch-weight.ll
1 ; RUN: llc < %s -march=arm -print-machineinstrs=tailduplication -tail-dup-size=100 -enable-tail-merge=false -disable-cgp -o /dev/null 2>&1 | FileCheck %s
2
3 ; CHECK: Machine code for function test0:
4 ; CHECK: Successors according to CFG: BB#1(4) BB#2(124)
5
6 define void @test0(i32 %a, i32 %b, i32* %c, i32* %d) {
7 entry:
8   store i32 3, i32* %d
9   br label %B1
10
11 B2:
12   store i32 2, i32* %c
13   br label %B4
14
15 B3:
16   store i32 2, i32* %c
17   br label %B4
18
19 B1:
20   store i32 1, i32* %d
21   %test0 = icmp slt i32 %a, %b
22   br i1 %test0, label %B2, label %B3, !prof !0
23
24 B4:
25   ret void
26 }
27
28 !0 = metadata !{metadata !"branch_weights", i32 4, i32 124}
29
30 ; CHECK: Machine code for function test1:
31 ; CHECK: Successors according to CFG: BB#1(8) BB#2(248)
32
33 @g0 = common global i32 0, align 4
34
35 define void @test1(i32 %a, i32 %b, i32* %c, i32* %d, i32* %e) {
36
37   %test0 = icmp slt i32 %a, %b
38   br i1 %test0, label %B1, label %B2, !prof !1
39
40 B1:
41   br label %B3
42
43 B2:
44   store i32 2, i32* %c
45   br label %B3
46
47 B3:
48   store i32 3, i32* %e
49   ret void
50 }
51
52 !1 = metadata !{metadata !"branch_weights", i32 248, i32 8}