blob: 6f8d245e74a02bd23d668ff128725e156ba020b8 [file] [log] [blame]
Saleem Abdulrasool72587352014-04-03 16:01:44 +00001; RUN: llc -mtriple=arm-eabi -print-machineinstrs=tailduplication -tail-dup-size=100 \
2; RUN: -enable-tail-merge=false -disable-cgp %s -o /dev/null 2>&1 \
3; RUN: | FileCheck %s
Akira Hatanakaa07ffb52014-02-12 18:09:18 +00004
5; CHECK: Machine code for function test0:
Cong Houd97c1002015-12-01 05:29:22 +00006; CHECK: Successors according to CFG: BB#1({{[0-9a-fx/= ]+}}3.12%) BB#2({{[0-9a-fx/= ]+}}96.88%)
Akira Hatanakaa07ffb52014-02-12 18:09:18 +00007
8define void @test0(i32 %a, i32 %b, i32* %c, i32* %d) {
9entry:
10 store i32 3, i32* %d
11 br label %B1
12
13B2:
14 store i32 2, i32* %c
15 br label %B4
16
17B3:
18 store i32 2, i32* %c
19 br label %B4
20
21B1:
22 store i32 1, i32* %d
23 %test0 = icmp slt i32 %a, %b
24 br i1 %test0, label %B2, label %B3, !prof !0
25
26B4:
27 ret void
28}
29
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000030!0 = !{!"branch_weights", i32 4, i32 124}
Akira Hatanakaa07ffb52014-02-12 18:09:18 +000031
32; CHECK: Machine code for function test1:
Cong Hou3ba9cf62015-12-15 10:10:40 +000033; CHECK: Successors according to CFG: BB#2(0x7c000000 / 0x80000000 = 96.88%) BB#1(0x04000000 / 0x80000000 = 3.12%)
Akira Hatanakaa07ffb52014-02-12 18:09:18 +000034
35@g0 = common global i32 0, align 4
36
37define void @test1(i32 %a, i32 %b, i32* %c, i32* %d, i32* %e) {
38
39 %test0 = icmp slt i32 %a, %b
40 br i1 %test0, label %B1, label %B2, !prof !1
41
42B1:
43 br label %B3
44
45B2:
46 store i32 2, i32* %c
47 br label %B3
48
49B3:
50 store i32 3, i32* %e
51 ret void
52}
53
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000054!1 = !{!"branch_weights", i32 248, i32 8}