Add a flag to experiment with outlining optional branches.
[oota-llvm.git] / test / CodeGen / X86 / code_placement_outline_optional_branches.ll
1 ; RUN: llc -mcpu=corei7 -mtriple=x86_64-linux < %s | FileCheck %s -check-prefix=CHECK
2 ; RUN: llc -mcpu=corei7 -mtriple=x86_64-linux -outline-optional-branches < %s | FileCheck %s -check-prefix=CHECK-OUTLINE
3
4 define void @foo(i32 %t1, i32 %t2) {
5 ; Test that we lift the call to 'c' up to immediately follow the call to 'b'
6 ; when we disable the cfg conflict check.
7 ;
8 ; CHECK-LABEL: foo:
9 ; CHECK: callq a
10 ; CHECK: callq b
11 ; CHECK: callq c
12 ; CHECK: callq d
13 ;
14 ; CHECK-OUTLINE-LABEL: foo:
15 ; CHECK-OUTLINE: callq b
16 ; CHECK-OUTLINE: callq c
17 ; CHECK-OUTLINE: callq d
18 ; CHECK-OUTLINE: callq a
19
20 entry:
21   %cmp = icmp eq i32 %t1, 0
22   br i1 %cmp, label %if.then, label %if.end
23
24 if.then:
25   call void @a()
26   br label %if.end
27
28 if.end:
29   call void @b()
30   br label %hotbranch
31
32 hotbranch:
33   %cmp2 = icmp eq i32 %t2, 0
34   br i1 %cmp2, label %if.then2, label %if.end2, !prof !1
35
36 if.then2:
37   call void @c()
38   br label %if.end2
39
40 if.end2:
41   call void @d()
42   ret void
43 }
44
45 declare void @a()
46 declare void @b()
47 declare void @c()
48 declare void @d()
49
50 !1 = !{!"branch_weights", i32 64, i32 4}