Revert " [LoongArch][ISel] Check the number of sign bits in `PatGprGpr_32` (#107432)"
[llvm-project.git] / llvm / test / CodeGen / X86 / code_placement_ext_tsp_large.ll
blob842aced4884f79bb64f229bcd943157d874dfd06
1 ; REQUIRES: asserts
2 ; RUN: llc -mcpu=corei7 -mtriple=x86_64-linux -enable-ext-tsp-block-placement=1 -ext-tsp-chain-split-threshold=128 -debug-only=block-placement < %s 2>&1 | FileCheck %s
3 ; RUN: llc -mcpu=corei7 -mtriple=x86_64-linux -enable-ext-tsp-block-placement=1 -ext-tsp-chain-split-threshold=1 -debug-only=block-placement < %s 2>&1 | FileCheck %s -check-prefix=CHECK2
4 ; RUN: llc -mcpu=corei7 -mtriple=x86_64-linux -enable-ext-tsp-block-placement=0 -debug-only=block-placement < %s 2>&1 | FileCheck %s -check-prefix=CHECK3
6 @yydebug = dso_local global i32 0, align 4
8 define void @func_large() !prof !0 {
9 ; A large CFG instance where chain splitting helps to
10 ; compute a better basic block ordering. The test verifies that with chain
11 ; splitting, the resulting layout is improved (e.g., the score is increased).
13 ;                                     +----------------+
14 ;                                     | b0 [76 bytes]  | -------------------+
15 ;                                     +----------------+                    |
16 ;                                       |                                   |
17 ;                                       | 3,065,981,778                     |
18 ;                                       v                                   |
19 ; +----------------+  766,495,444     +----------------+                    |
20 ; | b8 [244 bytes] | <--------------- |  b2 [4 bytes]  |                    |
21 ; +----------------+                  +----------------+                    |
22 ;   |        ^                          |                                   |
23 ;   |        |                          | 2,299,486,333                     |
24 ;   |        | 766,495,444              v                                   |
25 ;   |        |                        +----------------+                    |
26 ;   |        +----------------------- | b3 [12 bytes]  |                    |
27 ;   |                                 +----------------+                    |
28 ;   |                                   |                                   |
29 ;   |                                   | 1,532,990,888                     |
30 ;   |                                   v                                   |
31 ;   |                                 +----------------+                    | 574,869,946
32 ;   |                 +-------------- | b4 [12 bytes]  |                    |
33 ;   |                 |               +----------------+                    |
34 ;   |                 |                 |                                   |
35 ;   |                 |                 | 574,871,583                       |
36 ;   |                 |                 v                                   |
37 ;   |                 |               +----------------+                    |
38 ;   |                 |               | b5 [116 bytes] | -+                 |
39 ;   |                 |               +----------------+  |                 |
40 ;   |                 |                 |                 |                 |
41 ;   |                 |                 | 1,636           |                 |
42 ;   |                 |                 v                 |                 |
43 ;   |                 |               +----------------+  |                 |
44 ;   |                 |       +------ | b6 [32 bytes]  |  |                 |
45 ;   |                 |       |       +----------------+  |                 |
46 ;   |                 |       |         |                 |                 |
47 ;   |                 |       |         | 7               | 3,065,981,778   |
48 ;   |                 |       |         v                 |                 |
49 ;   |                 |       |       +----------------+  |                 |
50 ;   |                 |       | 1,628 | b9 [16 bytes]  |  |                 |
51 ;   |                 |       |       +----------------+  |                 |
52 ;   |                 |       |         |                 |                 |
53 ;   |                 |       |         | 7               |                 |
54 ;   |                 |       |         v                 |                 |
55 ;   |                 |       |       +----------------+  |                 |
56 ;   |                 |       +-----> | b7 [12 bytes]  |  |                 |
57 ;   |                 |               +----------------+  |                 |
58 ;   |                 |                 |                 |                 |
59 ;   |                 | 958,119,305     | 1,636           |                 |
60 ;   |                 |                 v                 v                 v
61 ;   |                 |               +------------------------------------------+
62 ;   |                 +-------------> |                                          |
63 ;   |       1,532,990,889             |                  b1 [36 bytes]           |
64 ;   +-------------------------------> |                                          |
65 ;                                     +------------------------------------------+
67 ; An expected output with a large chain-split-threshold -- the layout score is
68 ; increased by ~17%
70 ; CHECK-LABEL: Applying ext-tsp layout
71 ; CHECK:   original  layout score: 23587612604815436.00
72 ; CHECK:   optimized layout score: 27891096739311172.00
73 ; CHECK: b0
74 ; CHECK: b2
75 ; CHECK: b3
76 ; CHECK: b4
77 ; CHECK: b5
78 ; CHECK: b8
79 ; CHECK: b1
80 ; CHECK: b6
81 ; CHECK: b7
82 ; CHECK: b9
84 ; An expected output with chain-split-threshold=1 (disabling split point enumeration)
86 ; CHECK2-LABEL: Applying ext-tsp layout
87 ; CHECK2:   original  layout score: 23587612604815436.00
88 ; CHECK2:   optimized layout score: 27891096739311172.00
89 ; CHECK2: b0
90 ; CHECK2: b2
91 ; CHECK2: b3
92 ; CHECK2: b4
93 ; CHECK2: b5
94 ; CHECK2: b8
95 ; CHECK2: b1
96 ; CHECK2: b6
97 ; CHECK2: b7
98 ; CHECK2: b9
100 ; An expected output with ext-tsp disabled -- the layout is not modified:
102 ; CHECK3-LABEL: func_large:
103 ; CHECK3: b0
104 ; CHECK3: b1
105 ; CHECK3: b2
106 ; CHECK3: b3
107 ; CHECK3: b4
108 ; CHECK3: b5
109 ; CHECK3: b6
110 ; CHECK3: b7
111 ; CHECK3: b8
112 ; CHECK3: b9
115   %0 = load i32, ptr @yydebug, align 4
116   %cmp = icmp ne i32 %0, 0
117   call void @a()
118   call void @a()
119   call void @a()
120   call void @a()
121   call void @a()
122   call void @a()
123   call void @a()
124   call void @a()
125   call void @a()
126   call void @a()
127   call void @a()
128   call void @a()
129   call void @a()
130   call void @a()
131   call void @a()
132   call void @a()
133   call void @a()
134   call void @a()
135   br i1 %cmp, label %b1, label %b2, !prof !1
137   call void @b()
138   call void @b()
139   call void @b()
140   call void @b()
141   call void @b()
142   call void @b()
143   call void @b()
144   call void @b()
145   ret void
147   call void @c()
148   call void @c()
149   call void @c()
150   call void @c()
151   call void @c()
152   call void @c()
153   call void @c()
154   call void @c()
155   call void @c()
156   call void @c()
157   br i1 %cmp, label %b3, label %b8, !prof !2
159   call void @d()
160   call void @d()
161   br i1 %cmp, label %b4, label %b8, !prof !3
163   call void @e()
164   call void @e()
165   br i1 %cmp, label %b5, label %b1, !prof !4
167   call void @f()
168   call void @f()
169   call void @f()
170   call void @f()
171   call void @f()
172   call void @f()
173   call void @f()
174   call void @f()
175   call void @f()
176   call void @f()
177   call void @f()
178   call void @f()
179   call void @f()
180   call void @f()
181   call void @f()
182   call void @f()
183   call void @f()
184   call void @f()
185   call void @f()
186   call void @f()
187   call void @f()
188   call void @f()
189   call void @f()
190   call void @f()
191   call void @f()
192   call void @f()
193   call void @f()
194   call void @f()
195   br i1 %cmp, label %b1, label %b6, !prof !5
197   call void @g()
198   call void @g()
199   call void @g()
200   call void @g()
201   call void @g()
202   call void @g()
203   call void @g()
204   br i1 %cmp, label %b7, label %b9, !prof !6
206   call void @h()
207   call void @h()
208   br label %b1
210   call void @i()
211   call void @i()
212   call void @i()
213   call void @i()
214   call void @i()
215   call void @i()
216   call void @i()
217   call void @i()
218   call void @i()
219   call void @i()
220   call void @i()
221   call void @i()
222   call void @i()
223   call void @i()
224   call void @i()
225   call void @i()
226   call void @i()
227   call void @i()
228   call void @i()
229   call void @i()
230   call void @i()
231   call void @i()
232   call void @i()
233   call void @i()
234   call void @i()
235   call void @i()
236   call void @i()
237   call void @i()
238   call void @i()
239   call void @i()
240   call void @i()
241   call void @i()
242   call void @i()
243   call void @i()
244   call void @i()
245   call void @i()
246   call void @i()
247   call void @i()
248   call void @i()
249   call void @i()
250   call void @i()
251   call void @i()
252   call void @i()
253   call void @i()
254   call void @i()
255   call void @i()
256   call void @i()
257   call void @i()
258   call void @i()
259   call void @i()
260   call void @i()
261   call void @i()
262   call void @i()
263   call void @i()
264   call void @i()
265   call void @i()
266   call void @i()
267   call void @i()
268   call void @i()
269   call void @i()
270   br label %b1
272   call void @j()
273   call void @j()
274   call void @j()
275   br label %b7
279 declare void @a()
280 declare void @b()
281 declare void @c()
282 declare void @d()
283 declare void @e()
284 declare void @f()
285 declare void @g()
286 declare void @h()
287 declare void @i()
288 declare void @j()
290 !0 = !{!"function_entry_count", i64 6131963556}
291 !1 = !{!"branch_weights", i32 3065981778, i32 3065981778}
292 !2 = !{!"branch_weights", i32 2299486333, i32 766495444}
293 !3 = !{!"branch_weights", i32 1532990888, i32 766495444}
294 !4 = !{!"branch_weights", i32 574871583, i32 958119305}
295 !5 = !{!"branch_weights", i32 574869946, i32 1636}
296 !6 = !{!"branch_weights", i32 1628, i32 7}