[AVX512] add PSLLD and PSLLQ Intrinsic
[oota-llvm.git] / test / CodeGen / X86 / code_placement_ignore_succ_in_inner_loop.ll
1 ; RUN: llc -mcpu=corei7 -mtriple=x86_64-linux < %s | FileCheck %s -check-prefix=CHECK
2
3 define void @foo() {
4 ; Test that when determining the edge probability from a node in an inner loop
5 ; to a node in an outer loop, the weights on edges in the inner loop should be
6 ; ignored if we are building the chain for the outer loop.
7 ;
8 ; CHECK-LABEL: foo:
9 ; CHECK: callq c
10 ; CHECK: callq b
11
12 entry:
13   %call = call zeroext i1 @a()
14   br i1 %call, label %if.then, label %if.else, !prof !1
15
16 if.then:
17   %call1 = call zeroext i1 @a()
18   br i1 %call1, label %while.body, label %if.end.1, !prof !1
19
20 while.body:
21   %call2 = call zeroext i1 @a()
22   br i1 %call2, label %if.then.1, label %while.cond
23
24 if.then.1:
25   call void @d()
26   br label %while.cond
27
28 while.cond:
29   %call3 = call zeroext i1 @a()
30   br i1 %call3, label %while.body, label %if.end
31
32 if.end.1:
33   call void @d()
34   br label %if.end
35
36 if.else:
37   call void @b()
38   br label %if.end
39
40 if.end:
41   call void @c()
42   ret void
43 }
44
45 define void @bar() {
46 ; Test that when determining the edge probability from a node in a loop to a
47 ; node in its peer loop, the weights on edges in the first loop should be
48 ; ignored.
49 ;
50 ; CHECK-LABEL: bar:
51 ; CHECK: callq c
52 ; CHECK: callq b
53
54 entry:
55   %call = call zeroext i1 @a()
56   br i1 %call, label %if.then, label %if.else, !prof !1
57
58 if.then:
59   %call1 = call zeroext i1 @a()
60   br i1 %call1, label %if.then, label %while.body, !prof !2
61
62 while.body:
63   %call2 = call zeroext i1 @a()
64   br i1 %call2, label %while.body, label %if.end, !prof !2
65
66 if.else:
67   call void @b()
68   br label %if.end
69
70 if.end:
71   call void @c()
72   ret void
73 }
74
75 define void @par() {
76 ; Test that when determining the edge probability from a node in a loop to a
77 ; node in its outer loop, the weights on edges in the outer loop should be
78 ; ignored if we are building the chain for the inner loop.
79 ;
80 ; CHECK-LABEL: par:
81 ; CHECK: callq c
82 ; CHECK: callq d
83 ; CHECK: callq b
84
85 entry:
86   br label %if.cond
87
88 if.cond:
89   %call = call zeroext i1 @a()
90   br i1 %call, label %if.then, label %if.else, !prof !3
91
92 if.then:
93   call void @b()
94   br label %if.end
95
96 if.else:
97   call void @c()
98   %call1 = call zeroext i1 @a()
99   br i1 %call1, label %if.end, label %exit, !prof !4
100
101 if.end:
102   call void @d()
103   %call2 = call zeroext i1 @a()
104   br i1 %call2, label %if.cond, label %if.end.2, !prof !2
105
106 if.end.2:
107   call void @e()
108   br label %if.cond
109
110 exit:
111   ret void
112 }
113
114 declare zeroext i1 @a()
115 declare void @b()
116 declare void @c()
117 declare void @d()
118 declare void @e()
119
120 !1 = !{!"branch_weights", i32 10, i32 1}
121 !2 = !{!"branch_weights", i32 100, i32 1}
122 !3 = !{!"branch_weights", i32 1, i32 100}
123 !4 = !{!"branch_weights", i32 1, i32 1}