[Types] Define a getWithNewBitWidth for Types and make use of it
[llvm-complete.git] / test / CodeGen / X86 / code_placement_ignore_succ_in_inner_loop.ll
blob48329ed86e15f23af7fad64bd3a604b800480b5e
1 ; RUN: llc -mcpu=corei7 -mtriple=x86_64-linux < %s | FileCheck %s
3 define void @foo() {
4 ; After moving the latch to the top of loop, there is no fall through from the
5 ; latch to outer loop.
7 ; CHECK-LABEL: foo:
8 ; CHECK: callq b
9 ; CHECK: callq c
11 entry:
12   %call = call zeroext i1 @a()
13   br i1 %call, label %if.then, label %if.else, !prof !1
15 if.then:
16   %call1 = call zeroext i1 @a()
17   br i1 %call1, label %while.body, label %if.end.1, !prof !1
19 while.body:
20   %call2 = call zeroext i1 @a()
21   br i1 %call2, label %if.then.1, label %while.cond
23 if.then.1:
24   call void @d()
25   br label %while.cond
27 while.cond:
28   %call3 = call zeroext i1 @a()
29   br i1 %call3, label %while.body, label %if.end
31 if.end.1:
32   call void @d()
33   br label %if.end
35 if.else:
36   call void @b()
37   br label %if.end
39 if.end:
40   call void @c()
41   ret void
44 define void @bar() {
45 ; Test that when determining the edge probability from a node in a loop to a
46 ; node in its peer loop, the weights on edges in the first loop should be
47 ; ignored.
49 ; CHECK-LABEL: bar:
50 ; CHECK: callq c
51 ; CHECK: callq b
53 entry:
54   %call = call zeroext i1 @a()
55   br i1 %call, label %if.then, label %if.else, !prof !1
57 if.then:
58   %call1 = call zeroext i1 @a()
59   br i1 %call1, label %if.then, label %while.body, !prof !2
61 while.body:
62   %call2 = call zeroext i1 @a()
63   br i1 %call2, label %while.body, label %if.end, !prof !2
65 if.else:
66   call void @b()
67   br label %if.end
69 if.end:
70   call void @c()
71   ret void
74 define void @par() {
75 ; Test that when determining the edge probability from a node in a loop to a
76 ; node in its outer loop, the weights on edges in the outer loop should be
77 ; ignored if we are building the chain for the inner loop.
79 ; CHECK-LABEL: par:
80 ; CHECK: callq c
81 ; CHECK: callq d
82 ; CHECK: callq b
84 entry:
85   br label %if.cond
87 if.cond:
88   %call = call zeroext i1 @a()
89   br i1 %call, label %if.then, label %if.else, !prof !3
91 if.then:
92   call void @b()
93   br label %if.end
95 if.else:
96   call void @c()
97   %call1 = call zeroext i1 @a()
98   br i1 %call1, label %if.end, label %exit, !prof !4
100 if.end:
101   call void @d()
102   %call2 = call zeroext i1 @a()
103   br i1 %call2, label %if.cond, label %if.end.2, !prof !2
105 if.end.2:
106   call void @e()
107   br label %if.cond
109 exit:
110   ret void
113 declare zeroext i1 @a()
114 declare void @b()
115 declare void @c()
116 declare void @d()
117 declare void @e()
119 !1 = !{!"branch_weights", i32 10, i32 1}
120 !2 = !{!"branch_weights", i32 100, i32 1}
121 !3 = !{!"branch_weights", i32 1, i32 100}
122 !4 = !{!"branch_weights", i32 1, i32 1}