llvm.org GIT mirror llvm / e53b5c2
auto-generate checks Note: I removed the checks after each jump because that's noise, but we apparently need branches rather than returning i1 to see the bt codegen in some cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275439 91177308-0d34-0410-b5e6-96231b3b80d8 Sanjay Patel 3 years ago
1 changed file(s) with 486 addition(s) and 422 deletion(s). Raw diff Collapse all Expand all
None ; RUN: llc < %s -mtriple=i386-apple-macosx -mcpu=penryn | FileCheck %s
0 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
1 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s
12 ; PR3253
23
34 ; The register+memory form of the BT instruction should be usable on
1718 ; - The and can be commuted.
1819
1920 define void @test2(i32 %x, i32 %n) nounwind {
20 entry:
21 ; CHECK: test2
22 ; CHECK: btl %ecx, %eax
23 ; CHECK: jb
24 %tmp29 = lshr i32 %x, %n ; [#uses=1]
25 %tmp3 = and i32 %tmp29, 1 ; [#uses=1]
26 %tmp4 = icmp eq i32 %tmp3, 0 ; [#uses=1]
27 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
28
29 bb: ; preds = %entry
30 call void @foo()
31 ret void
32
33 UnifiedReturnBlock: ; preds = %entry
34 ret void
21 ; CHECK-LABEL: test2:
22 ; CHECK: # BB#0: # %entry
23 ; CHECK-NEXT: btl %esi, %edi
24 ; CHECK-NEXT: jb .LBB0_2
25 ;
26 entry:
27 %tmp29 = lshr i32 %x, %n
28 %tmp3 = and i32 %tmp29, 1
29 %tmp4 = icmp eq i32 %tmp3, 0
30 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
31
32 bb:
33 call void @foo()
34 ret void
35
36 UnifiedReturnBlock:
37 ret void
3538 }
3639
3740 define void @test2b(i32 %x, i32 %n) nounwind {
38 entry:
39 ; CHECK: test2b
40 ; CHECK: btl %e{{..}}, %e{{..}}
41 ; CHECK: jb
42 %tmp29 = lshr i32 %x, %n ; [#uses=1]
43 %tmp3 = and i32 1, %tmp29
44 %tmp4 = icmp eq i32 %tmp3, 0 ; [#uses=1]
45 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
46
47 bb: ; preds = %entry
48 call void @foo()
49 ret void
50
51 UnifiedReturnBlock: ; preds = %entry
52 ret void
41 ; CHECK-LABEL: test2b:
42 ; CHECK: # BB#0: # %entry
43 ; CHECK-NEXT: btl %esi, %edi
44 ; CHECK-NEXT: jb .LBB1_2
45 ;
46 entry:
47 %tmp29 = lshr i32 %x, %n
48 %tmp3 = and i32 1, %tmp29
49 %tmp4 = icmp eq i32 %tmp3, 0
50 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
51
52 bb:
53 call void @foo()
54 ret void
55
56 UnifiedReturnBlock:
57 ret void
5358 }
5459
5560 define void @atest2(i32 %x, i32 %n) nounwind {
56 entry:
57 ; CHECK: atest2
58 ; CHECK: btl %e{{..}}, %e{{..}}
59 ; CHECK: jb
60 %tmp29 = ashr i32 %x, %n ; [#uses=1]
61 %tmp3 = and i32 %tmp29, 1 ; [#uses=1]
62 %tmp4 = icmp eq i32 %tmp3, 0 ; [#uses=1]
63 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
64
65 bb: ; preds = %entry
66 call void @foo()
67 ret void
68
69 UnifiedReturnBlock: ; preds = %entry
70 ret void
61 ; CHECK-LABEL: atest2:
62 ; CHECK: # BB#0: # %entry
63 ; CHECK-NEXT: btl %esi, %edi
64 ; CHECK-NEXT: jb .LBB2_2
65 ;
66 entry:
67 %tmp29 = ashr i32 %x, %n
68 %tmp3 = and i32 %tmp29, 1
69 %tmp4 = icmp eq i32 %tmp3, 0
70 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
71
72 bb:
73 call void @foo()
74 ret void
75
76 UnifiedReturnBlock:
77 ret void
7178 }
7279
7380 define void @atest2b(i32 %x, i32 %n) nounwind {
74 entry:
75 ; CHECK: atest2b
76 ; CHECK: btl %e{{..}}, %e{{..}}
77 %tmp29 = ashr i32 %x, %n ; [#uses=1]
78 %tmp3 = and i32 1, %tmp29
79 %tmp4 = icmp eq i32 %tmp3, 0 ; [#uses=1]
80 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
81
82 bb: ; preds = %entry
83 call void @foo()
84 ret void
85
86 UnifiedReturnBlock: ; preds = %entry
87 ret void
81 ; CHECK-LABEL: atest2b:
82 ; CHECK: # BB#0: # %entry
83 ; CHECK-NEXT: btl %esi, %edi
84 ; CHECK-NEXT: jb .LBB3_2
85 ;
86 entry:
87 %tmp29 = ashr i32 %x, %n
88 %tmp3 = and i32 1, %tmp29
89 %tmp4 = icmp eq i32 %tmp3, 0
90 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
91
92 bb:
93 call void @foo()
94 ret void
95
96 UnifiedReturnBlock:
97 ret void
8898 }
8999
90100 define void @test3(i32 %x, i32 %n) nounwind {
91 entry:
92 ; CHECK: test3
93 ; CHECK: btl %e{{..}}, %e{{..}}
94 ; CHECK: jb
95 %tmp29 = shl i32 1, %n ; [#uses=1]
96 %tmp3 = and i32 %tmp29, %x ; [#uses=1]
97 %tmp4 = icmp eq i32 %tmp3, 0 ; [#uses=1]
98 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
99
100 bb: ; preds = %entry
101 call void @foo()
102 ret void
103
104 UnifiedReturnBlock: ; preds = %entry
105 ret void
101 ; CHECK-LABEL: test3:
102 ; CHECK: # BB#0: # %entry
103 ; CHECK-NEXT: btl %esi, %edi
104 ; CHECK-NEXT: jb .LBB4_2
105 ;
106 entry:
107 %tmp29 = shl i32 1, %n
108 %tmp3 = and i32 %tmp29, %x
109 %tmp4 = icmp eq i32 %tmp3, 0
110 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
111
112 bb:
113 call void @foo()
114 ret void
115
116 UnifiedReturnBlock:
117 ret void
106118 }
107119
108120 define void @test3b(i32 %x, i32 %n) nounwind {
109 entry:
110 ; CHECK: test3b
111 ; CHECK: btl %e{{..}}, %e{{..}}
112 ; CHECK: jb
113 %tmp29 = shl i32 1, %n ; [#uses=1]
114 %tmp3 = and i32 %x, %tmp29
115 %tmp4 = icmp eq i32 %tmp3, 0 ; [#uses=1]
116 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
117
118 bb: ; preds = %entry
119 call void @foo()
120 ret void
121
122 UnifiedReturnBlock: ; preds = %entry
123 ret void
121 ; CHECK-LABEL: test3b:
122 ; CHECK: # BB#0: # %entry
123 ; CHECK-NEXT: btl %esi, %edi
124 ; CHECK-NEXT: jb .LBB5_2
125 ;
126 entry:
127 %tmp29 = shl i32 1, %n
128 %tmp3 = and i32 %x, %tmp29
129 %tmp4 = icmp eq i32 %tmp3, 0
130 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
131
132 bb:
133 call void @foo()
134 ret void
135
136 UnifiedReturnBlock:
137 ret void
124138 }
125139
126140 define void @testne2(i32 %x, i32 %n) nounwind {
127 entry:
128 ; CHECK: testne2
129 ; CHECK: btl %e{{..}}, %e{{..}}
130 ; CHECK: jae
131 %tmp29 = lshr i32 %x, %n ; [#uses=1]
132 %tmp3 = and i32 %tmp29, 1 ; [#uses=1]
133 %tmp4 = icmp ne i32 %tmp3, 0 ; [#uses=1]
134 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
135
136 bb: ; preds = %entry
137 call void @foo()
138 ret void
139
140 UnifiedReturnBlock: ; preds = %entry
141 ret void
141 ; CHECK-LABEL: testne2:
142 ; CHECK: # BB#0: # %entry
143 ; CHECK-NEXT: btl %esi, %edi
144 ; CHECK-NEXT: jae .LBB6_2
145 ;
146 entry:
147 %tmp29 = lshr i32 %x, %n
148 %tmp3 = and i32 %tmp29, 1
149 %tmp4 = icmp ne i32 %tmp3, 0
150 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
151
152 bb:
153 call void @foo()
154 ret void
155
156 UnifiedReturnBlock:
157 ret void
142158 }
143159
144160 define void @testne2b(i32 %x, i32 %n) nounwind {
145 entry:
146 ; CHECK: testne2b
147 ; CHECK: btl %e{{..}}, %e{{..}}
148 ; CHECK: jae
149 %tmp29 = lshr i32 %x, %n ; [#uses=1]
150 %tmp3 = and i32 1, %tmp29
151 %tmp4 = icmp ne i32 %tmp3, 0 ; [#uses=1]
152 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
153
154 bb: ; preds = %entry
155 call void @foo()
156 ret void
157
158 UnifiedReturnBlock: ; preds = %entry
159 ret void
161 ; CHECK-LABEL: testne2b:
162 ; CHECK: # BB#0: # %entry
163 ; CHECK-NEXT: btl %esi, %edi
164 ; CHECK-NEXT: jae .LBB7_2
165 ;
166 entry:
167 %tmp29 = lshr i32 %x, %n
168 %tmp3 = and i32 1, %tmp29
169 %tmp4 = icmp ne i32 %tmp3, 0
170 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
171
172 bb:
173 call void @foo()
174 ret void
175
176 UnifiedReturnBlock:
177 ret void
160178 }
161179
162180 define void @atestne2(i32 %x, i32 %n) nounwind {
163 entry:
164 ; CHECK: atestne2
165 ; CHECK: btl %e{{..}}, %e{{..}}
166 ; CHECK: jae
167 %tmp29 = ashr i32 %x, %n ; [#uses=1]
168 %tmp3 = and i32 %tmp29, 1 ; [#uses=1]
169 %tmp4 = icmp ne i32 %tmp3, 0 ; [#uses=1]
170 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
171
172 bb: ; preds = %entry
173 call void @foo()
174 ret void
175
176 UnifiedReturnBlock: ; preds = %entry
177 ret void
181 ; CHECK-LABEL: atestne2:
182 ; CHECK: # BB#0: # %entry
183 ; CHECK-NEXT: btl %esi, %edi
184 ; CHECK-NEXT: jae .LBB8_2
185 ;
186 entry:
187 %tmp29 = ashr i32 %x, %n
188 %tmp3 = and i32 %tmp29, 1
189 %tmp4 = icmp ne i32 %tmp3, 0
190 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
191
192 bb:
193 call void @foo()
194 ret void
195
196 UnifiedReturnBlock:
197 ret void
178198 }
179199
180200 define void @atestne2b(i32 %x, i32 %n) nounwind {
181 entry:
182 ; CHECK: atestne2b
183 ; CHECK: btl %e{{..}}, %e{{..}}
184 ; CHECK: jae
185 %tmp29 = ashr i32 %x, %n ; [#uses=1]
186 %tmp3 = and i32 1, %tmp29
187 %tmp4 = icmp ne i32 %tmp3, 0 ; [#uses=1]
188 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
189
190 bb: ; preds = %entry
191 call void @foo()
192 ret void
193
194 UnifiedReturnBlock: ; preds = %entry
195 ret void
201 ; CHECK-LABEL: atestne2b:
202 ; CHECK: # BB#0: # %entry
203 ; CHECK-NEXT: btl %esi, %edi
204 ; CHECK-NEXT: jae .LBB9_2
205 ;
206 entry:
207 %tmp29 = ashr i32 %x, %n
208 %tmp3 = and i32 1, %tmp29
209 %tmp4 = icmp ne i32 %tmp3, 0
210 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
211
212 bb:
213 call void @foo()
214 ret void
215
216 UnifiedReturnBlock:
217 ret void
196218 }
197219
198220 define void @testne3(i32 %x, i32 %n) nounwind {
199 entry:
200 ; CHECK: testne3
201 ; CHECK: btl %e{{..}}, %e{{..}}
202 ; CHECK: jae
203 %tmp29 = shl i32 1, %n ; [#uses=1]
204 %tmp3 = and i32 %tmp29, %x ; [#uses=1]
205 %tmp4 = icmp ne i32 %tmp3, 0 ; [#uses=1]
206 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
207
208 bb: ; preds = %entry
209 call void @foo()
210 ret void
211
212 UnifiedReturnBlock: ; preds = %entry
213 ret void
221 ; CHECK-LABEL: testne3:
222 ; CHECK: # BB#0: # %entry
223 ; CHECK-NEXT: btl %esi, %edi
224 ; CHECK-NEXT: jae .LBB10_2
225 ;
226 entry:
227 %tmp29 = shl i32 1, %n
228 %tmp3 = and i32 %tmp29, %x
229 %tmp4 = icmp ne i32 %tmp3, 0
230 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
231
232 bb:
233 call void @foo()
234 ret void
235
236 UnifiedReturnBlock:
237 ret void
214238 }
215239
216240 define void @testne3b(i32 %x, i32 %n) nounwind {
217 entry:
218 ; CHECK: testne3b
219 ; CHECK: btl %e{{..}}, %e{{..}}
220 ; CHECK: jae
221 %tmp29 = shl i32 1, %n ; [#uses=1]
222 %tmp3 = and i32 %x, %tmp29
223 %tmp4 = icmp ne i32 %tmp3, 0 ; [#uses=1]
224 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
225
226 bb: ; preds = %entry
227 call void @foo()
228 ret void
229
230 UnifiedReturnBlock: ; preds = %entry
231 ret void
241 ; CHECK-LABEL: testne3b:
242 ; CHECK: # BB#0: # %entry
243 ; CHECK-NEXT: btl %esi, %edi
244 ; CHECK-NEXT: jae .LBB11_2
245 ;
246 entry:
247 %tmp29 = shl i32 1, %n
248 %tmp3 = and i32 %x, %tmp29
249 %tmp4 = icmp ne i32 %tmp3, 0
250 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
251
252 bb:
253 call void @foo()
254 ret void
255
256 UnifiedReturnBlock:
257 ret void
232258 }
233259
234260 define void @query2(i32 %x, i32 %n) nounwind {
235 entry:
236 ; CHECK: query2
237 ; CHECK: btl %e{{..}}, %e{{..}}
238 ; CHECK: jae
239 %tmp29 = lshr i32 %x, %n ; [#uses=1]
240 %tmp3 = and i32 %tmp29, 1 ; [#uses=1]
241 %tmp4 = icmp eq i32 %tmp3, 1 ; [#uses=1]
242 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
243
244 bb: ; preds = %entry
245 call void @foo()
246 ret void
247
248 UnifiedReturnBlock: ; preds = %entry
249 ret void
261 ; CHECK-LABEL: query2:
262 ; CHECK: # BB#0: # %entry
263 ; CHECK-NEXT: btl %esi, %edi
264 ; CHECK-NEXT: jae .LBB12_2
265 ;
266 entry:
267 %tmp29 = lshr i32 %x, %n
268 %tmp3 = and i32 %tmp29, 1
269 %tmp4 = icmp eq i32 %tmp3, 1
270 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
271
272 bb:
273 call void @foo()
274 ret void
275
276 UnifiedReturnBlock:
277 ret void
250278 }
251279
252280 define void @query2b(i32 %x, i32 %n) nounwind {
253 entry:
254 ; CHECK: query2b
255 ; CHECK: btl %e{{..}}, %e{{..}}
256 ; CHECK: jae
257 %tmp29 = lshr i32 %x, %n ; [#uses=1]
258 %tmp3 = and i32 1, %tmp29
259 %tmp4 = icmp eq i32 %tmp3, 1 ; [#uses=1]
260 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
261
262 bb: ; preds = %entry
263 call void @foo()
264 ret void
265
266 UnifiedReturnBlock: ; preds = %entry
267 ret void
281 ; CHECK-LABEL: query2b:
282 ; CHECK: # BB#0: # %entry
283 ; CHECK-NEXT: btl %esi, %edi
284 ; CHECK-NEXT: jae .LBB13_2
285 ;
286 entry:
287 %tmp29 = lshr i32 %x, %n
288 %tmp3 = and i32 1, %tmp29
289 %tmp4 = icmp eq i32 %tmp3, 1
290 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
291
292 bb:
293 call void @foo()
294 ret void
295
296 UnifiedReturnBlock:
297 ret void
268298 }
269299
270300 define void @aquery2(i32 %x, i32 %n) nounwind {
271 entry:
272 ; CHECK: aquery2
273 ; CHECK: btl %e{{..}}, %e{{..}}
274 ; CHECK: jae
275 %tmp29 = ashr i32 %x, %n ; [#uses=1]
276 %tmp3 = and i32 %tmp29, 1 ; [#uses=1]
277 %tmp4 = icmp eq i32 %tmp3, 1 ; [#uses=1]
278 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
279
280 bb: ; preds = %entry
281 call void @foo()
282 ret void
283
284 UnifiedReturnBlock: ; preds = %entry
285 ret void
301 ; CHECK-LABEL: aquery2:
302 ; CHECK: # BB#0: # %entry
303 ; CHECK-NEXT: btl %esi, %edi
304 ; CHECK-NEXT: jae .LBB14_2
305 ;
306 entry:
307 %tmp29 = ashr i32 %x, %n
308 %tmp3 = and i32 %tmp29, 1
309 %tmp4 = icmp eq i32 %tmp3, 1
310 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
311
312 bb:
313 call void @foo()
314 ret void
315
316 UnifiedReturnBlock:
317 ret void
286318 }
287319
288320 define void @aquery2b(i32 %x, i32 %n) nounwind {
289 entry:
290 ; CHECK: aquery2b
291 ; CHECK: btl %e{{..}}, %e{{..}}
292 ; CHECK: jae
293 %tmp29 = ashr i32 %x, %n ; [#uses=1]
294 %tmp3 = and i32 1, %tmp29
295 %tmp4 = icmp eq i32 %tmp3, 1 ; [#uses=1]
296 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
297
298 bb: ; preds = %entry
299 call void @foo()
300 ret void
301
302 UnifiedReturnBlock: ; preds = %entry
303 ret void
321 ; CHECK-LABEL: aquery2b:
322 ; CHECK: # BB#0: # %entry
323 ; CHECK-NEXT: btl %esi, %edi
324 ; CHECK-NEXT: jae .LBB15_2
325 ;
326 entry:
327 %tmp29 = ashr i32 %x, %n
328 %tmp3 = and i32 1, %tmp29
329 %tmp4 = icmp eq i32 %tmp3, 1
330 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
331
332 bb:
333 call void @foo()
334 ret void
335
336 UnifiedReturnBlock:
337 ret void
304338 }
305339
306340 define void @query3(i32 %x, i32 %n) nounwind {
307 entry:
308 ; CHECK: query3
309 ; CHECK: btl %e{{..}}, %e{{..}}
310 ; CHECK: jae
311 %tmp29 = shl i32 1, %n ; [#uses=1]
312 %tmp3 = and i32 %tmp29, %x ; [#uses=1]
313 %tmp4 = icmp eq i32 %tmp3, %tmp29 ; [#uses=1]
314 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
315
316 bb: ; preds = %entry
317 call void @foo()
318 ret void
319
320 UnifiedReturnBlock: ; preds = %entry
321 ret void
341 ; CHECK-LABEL: query3:
342 ; CHECK: # BB#0: # %entry
343 ; CHECK-NEXT: btl %esi, %edi
344 ; CHECK-NEXT: jae .LBB16_2
345 ;
346 entry:
347 %tmp29 = shl i32 1, %n
348 %tmp3 = and i32 %tmp29, %x
349 %tmp4 = icmp eq i32 %tmp3, %tmp29
350 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
351
352 bb:
353 call void @foo()
354 ret void
355
356 UnifiedReturnBlock:
357 ret void
322358 }
323359
324360 define void @query3b(i32 %x, i32 %n) nounwind {
325 entry:
326 ; CHECK: query3b
327 ; CHECK: btl %e{{..}}, %e{{..}}
328 ; CHECK: jae
329 %tmp29 = shl i32 1, %n ; [#uses=1]
330 %tmp3 = and i32 %x, %tmp29
331 %tmp4 = icmp eq i32 %tmp3, %tmp29 ; [#uses=1]
332 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
333
334 bb: ; preds = %entry
335 call void @foo()
336 ret void
337
338 UnifiedReturnBlock: ; preds = %entry
339 ret void
361 ; CHECK-LABEL: query3b:
362 ; CHECK: # BB#0: # %entry
363 ; CHECK-NEXT: btl %esi, %edi
364 ; CHECK-NEXT: jae .LBB17_2
365 ;
366 entry:
367 %tmp29 = shl i32 1, %n
368 %tmp3 = and i32 %x, %tmp29
369 %tmp4 = icmp eq i32 %tmp3, %tmp29
370 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
371
372 bb:
373 call void @foo()
374 ret void
375
376 UnifiedReturnBlock:
377 ret void
340378 }
341379
342380 define void @query3x(i32 %x, i32 %n) nounwind {
343 entry:
344 ; CHECK: query3x
345 ; CHECK: btl %e{{..}}, %e{{..}}
346 ; CHECK: jae
347 %tmp29 = shl i32 1, %n ; [#uses=1]
348 %tmp3 = and i32 %tmp29, %x ; [#uses=1]
349 %tmp4 = icmp eq i32 %tmp29, %tmp3 ; [#uses=1]
350 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
351
352 bb: ; preds = %entry
353 call void @foo()
354 ret void
355
356 UnifiedReturnBlock: ; preds = %entry
357 ret void
381 ; CHECK-LABEL: query3x:
382 ; CHECK: # BB#0: # %entry
383 ; CHECK-NEXT: btl %esi, %edi
384 ; CHECK-NEXT: jae .LBB18_2
385 ;
386 entry:
387 %tmp29 = shl i32 1, %n
388 %tmp3 = and i32 %tmp29, %x
389 %tmp4 = icmp eq i32 %tmp29, %tmp3
390 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
391
392 bb:
393 call void @foo()
394 ret void
395
396 UnifiedReturnBlock:
397 ret void
358398 }
359399
360400 define void @query3bx(i32 %x, i32 %n) nounwind {
361 entry:
362 ; CHECK: query3bx
363 ; CHECK: btl %e{{..}}, %e{{..}}
364 ; CHECK: jae
365 %tmp29 = shl i32 1, %n ; [#uses=1]
366 %tmp3 = and i32 %x, %tmp29
367 %tmp4 = icmp eq i32 %tmp29, %tmp3 ; [#uses=1]
368 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
369
370 bb: ; preds = %entry
371 call void @foo()
372 ret void
373
374 UnifiedReturnBlock: ; preds = %entry
375 ret void
401 ; CHECK-LABEL: query3bx:
402 ; CHECK: # BB#0: # %entry
403 ; CHECK-NEXT: btl %esi, %edi
404 ; CHECK-NEXT: jae .LBB19_2
405 ;
406 entry:
407 %tmp29 = shl i32 1, %n
408 %tmp3 = and i32 %x, %tmp29
409 %tmp4 = icmp eq i32 %tmp29, %tmp3
410 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
411
412 bb:
413 call void @foo()
414 ret void
415
416 UnifiedReturnBlock:
417 ret void
376418 }
377419
378420 define void @queryne2(i32 %x, i32 %n) nounwind {
379 entry:
380 ; CHECK: queryne2
381 ; CHECK: btl %e{{..}}, %e{{..}}
382 ; CHECK: jb
383 %tmp29 = lshr i32 %x, %n ; [#uses=1]
384 %tmp3 = and i32 %tmp29, 1 ; [#uses=1]
385 %tmp4 = icmp ne i32 %tmp3, 1 ; [#uses=1]
386 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
387
388 bb: ; preds = %entry
389 call void @foo()
390 ret void
391
392 UnifiedReturnBlock: ; preds = %entry
393 ret void
421 ; CHECK-LABEL: queryne2:
422 ; CHECK: # BB#0: # %entry
423 ; CHECK-NEXT: btl %esi, %edi
424 ; CHECK-NEXT: jb .LBB20_2
425 ;
426 entry:
427 %tmp29 = lshr i32 %x, %n
428 %tmp3 = and i32 %tmp29, 1
429 %tmp4 = icmp ne i32 %tmp3, 1
430 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
431
432 bb:
433 call void @foo()
434 ret void
435
436 UnifiedReturnBlock:
437 ret void
394438 }
395439
396440 define void @queryne2b(i32 %x, i32 %n) nounwind {
397 entry:
398 ; CHECK: queryne2b
399 ; CHECK: btl %e{{..}}, %e{{..}}
400 ; CHECK: jb
401 %tmp29 = lshr i32 %x, %n ; [#uses=1]
402 %tmp3 = and i32 1, %tmp29
403 %tmp4 = icmp ne i32 %tmp3, 1 ; [#uses=1]
404 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
405
406 bb: ; preds = %entry
407 call void @foo()
408 ret void
409
410 UnifiedReturnBlock: ; preds = %entry
411 ret void
441 ; CHECK-LABEL: queryne2b:
442 ; CHECK: # BB#0: # %entry
443 ; CHECK-NEXT: btl %esi, %edi
444 ; CHECK-NEXT: jb .LBB21_2
445 ;
446 entry:
447 %tmp29 = lshr i32 %x, %n
448 %tmp3 = and i32 1, %tmp29
449 %tmp4 = icmp ne i32 %tmp3, 1
450 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
451
452 bb:
453 call void @foo()
454 ret void
455
456 UnifiedReturnBlock:
457 ret void
412458 }
413459
414460 define void @aqueryne2(i32 %x, i32 %n) nounwind {
415 entry:
416 ; CHECK: aqueryne2
417 ; CHECK: btl %e{{..}}, %e{{..}}
418 ; CHECK: jb
419 %tmp29 = ashr i32 %x, %n ; [#uses=1]
420 %tmp3 = and i32 %tmp29, 1 ; [#uses=1]
421 %tmp4 = icmp ne i32 %tmp3, 1 ; [#uses=1]
422 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
423
424 bb: ; preds = %entry
425 call void @foo()
426 ret void
427
428 UnifiedReturnBlock: ; preds = %entry
429 ret void
461 ; CHECK-LABEL: aqueryne2:
462 ; CHECK: # BB#0: # %entry
463 ; CHECK-NEXT: btl %esi, %edi
464 ; CHECK-NEXT: jb .LBB22_2
465 ;
466 entry:
467 %tmp29 = ashr i32 %x, %n
468 %tmp3 = and i32 %tmp29, 1
469 %tmp4 = icmp ne i32 %tmp3, 1
470 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
471
472 bb:
473 call void @foo()
474 ret void
475
476 UnifiedReturnBlock:
477 ret void
430478 }
431479
432480 define void @aqueryne2b(i32 %x, i32 %n) nounwind {
433 entry:
434 ; CHECK: aqueryne2b
435 ; CHECK: btl %e{{..}}, %e{{..}}
436 ; CHECK: jb
437 %tmp29 = ashr i32 %x, %n ; [#uses=1]
438 %tmp3 = and i32 1, %tmp29
439 %tmp4 = icmp ne i32 %tmp3, 1 ; [#uses=1]
440 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
441
442 bb: ; preds = %entry
443 call void @foo()
444 ret void
445
446 UnifiedReturnBlock: ; preds = %entry
447 ret void
481 ; CHECK-LABEL: aqueryne2b:
482 ; CHECK: # BB#0: # %entry
483 ; CHECK-NEXT: btl %esi, %edi
484 ; CHECK-NEXT: jb .LBB23_2
485 ;
486 entry:
487 %tmp29 = ashr i32 %x, %n
488 %tmp3 = and i32 1, %tmp29
489 %tmp4 = icmp ne i32 %tmp3, 1
490 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
491
492 bb:
493 call void @foo()
494 ret void
495
496 UnifiedReturnBlock:
497 ret void
448498 }
449499
450500 define void @queryne3(i32 %x, i32 %n) nounwind {
451 entry:
452 ; CHECK: queryne3
453 ; CHECK: btl %e{{..}}, %e{{..}}
454 ; CHECK: jb
455 %tmp29 = shl i32 1, %n ; [#uses=1]
456 %tmp3 = and i32 %tmp29, %x ; [#uses=1]
457 %tmp4 = icmp ne i32 %tmp3, %tmp29 ; [#uses=1]
458 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
459
460 bb: ; preds = %entry
461 call void @foo()
462 ret void
463
464 UnifiedReturnBlock: ; preds = %entry
465 ret void
501 ; CHECK-LABEL: queryne3:
502 ; CHECK: # BB#0: # %entry
503 ; CHECK-NEXT: btl %esi, %edi
504 ; CHECK-NEXT: jb .LBB24_2
505 ;
506 entry:
507 %tmp29 = shl i32 1, %n
508 %tmp3 = and i32 %tmp29, %x
509 %tmp4 = icmp ne i32 %tmp3, %tmp29
510 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
511
512 bb:
513 call void @foo()
514 ret void
515
516 UnifiedReturnBlock:
517 ret void
466518 }
467519
468520 define void @queryne3b(i32 %x, i32 %n) nounwind {
469 entry:
470 ; CHECK: queryne3b
471 ; CHECK: btl %e{{..}}, %e{{..}}
472 ; CHECK: jb
473 %tmp29 = shl i32 1, %n ; [#uses=1]
474 %tmp3 = and i32 %x, %tmp29
475 %tmp4 = icmp ne i32 %tmp3, %tmp29 ; [#uses=1]
476 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
477
478 bb: ; preds = %entry
479 call void @foo()
480 ret void
481
482 UnifiedReturnBlock: ; preds = %entry
483 ret void
521 ; CHECK-LABEL: queryne3b:
522 ; CHECK: # BB#0: # %entry
523 ; CHECK-NEXT: btl %esi, %edi
524 ; CHECK-NEXT: jb .LBB25_2
525 ;
526 entry:
527 %tmp29 = shl i32 1, %n
528 %tmp3 = and i32 %x, %tmp29
529 %tmp4 = icmp ne i32 %tmp3, %tmp29
530 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
531
532 bb:
533 call void @foo()
534 ret void
535
536 UnifiedReturnBlock:
537 ret void
484538 }
485539
486540 define void @queryne3x(i32 %x, i32 %n) nounwind {
487 entry:
488 ; CHECK: queryne3x
489 ; CHECK: btl %e{{..}}, %e{{..}}
490 ; CHECK: jb
491 %tmp29 = shl i32 1, %n ; [#uses=1]
492 %tmp3 = and i32 %tmp29, %x ; [#uses=1]
493 %tmp4 = icmp ne i32 %tmp29, %tmp3 ; [#uses=1]
494 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
495
496 bb: ; preds = %entry
497 call void @foo()
498 ret void
499
500 UnifiedReturnBlock: ; preds = %entry
501 ret void
541 ; CHECK-LABEL: queryne3x:
542 ; CHECK: # BB#0: # %entry
543 ; CHECK-NEXT: btl %esi, %edi
544 ; CHECK-NEXT: jb .LBB26_2
545 ;
546 entry:
547 %tmp29 = shl i32 1, %n
548 %tmp3 = and i32 %tmp29, %x
549 %tmp4 = icmp ne i32 %tmp29, %tmp3
550 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
551
552 bb:
553 call void @foo()
554 ret void
555
556 UnifiedReturnBlock:
557 ret void
502558 }
503559
504560 define void @queryne3bx(i32 %x, i32 %n) nounwind {
505 entry:
506 ; CHECK: queryne3bx
507 ; CHECK: btl %e{{..}}, %e{{..}}
508 ; CHECK: jb
509 %tmp29 = shl i32 1, %n ; [#uses=1]
510 %tmp3 = and i32 %x, %tmp29
511 %tmp4 = icmp ne i32 %tmp29, %tmp3 ; [#uses=1]
512 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
513
514 bb: ; preds = %entry
515 call void @foo()
516 ret void
517
518 UnifiedReturnBlock: ; preds = %entry
519 ret void
561 ; CHECK-LABEL: queryne3bx:
562 ; CHECK: # BB#0: # %entry
563 ; CHECK-NEXT: btl %esi, %edi
564 ; CHECK-NEXT: jb .LBB27_2
565 ;
566 entry:
567 %tmp29 = shl i32 1, %n
568 %tmp3 = and i32 %x, %tmp29
569 %tmp4 = icmp ne i32 %tmp29, %tmp3
570 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
571
572 bb:
573 call void @foo()
574 ret void
575
576 UnifiedReturnBlock:
577 ret void
520578 }
521579
522580 declare void @foo()
523581
524582 define zeroext i1 @invert(i32 %flags, i32 %flag) nounwind {
525 ; CHECK: btl
526 entry:
583 ; CHECK-LABEL: invert:
584 ; CHECK: # BB#0:
585 ; CHECK-NEXT: notl %edi
586 ; CHECK-NEXT: btl %esi, %edi
587 ; CHECK-NEXT: setb %al
588 ; CHECK-NEXT: retq
589 ;
527590 %neg = xor i32 %flags, -1
528591 %shl = shl i32 1, %flag
529592 %and = and i32 %shl, %neg
530593 %tobool = icmp ne i32 %and, 0
531594 ret i1 %tobool
532595 }
596