1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=x86_64-unknown-unknown -O3 -cgp-icmp-eq2icmp-st -verify-machineinstrs < %s | FileCheck %s
4 ; Test cases are generated from:
5 ; long long NAME(PARAM a, PARAM b) {
12 ; Please note funtion name is defined as <PARAM>_<LHS>_<RHS>. Take ll_a_op_b__1
13 ; for example. ll is PARAM, a_op_b (i.e., a << b) is LHS, _1 (i.e., -1) is RHS.
15 target datalayout = "e-m:e-i64:64-n32:64"
17 define i64 @ll_a_op_b__2(i64 %a, i64 %b) {
18 ; CHECK-LABEL: ll_a_op_b__2:
19 ; CHECK: # %bb.0: # %entry
20 ; CHECK-NEXT: movq %rsi, %rax
21 ; CHECK-NEXT: movq %rdi, %rdx
22 ; CHECK-NEXT: movl %eax, %ecx
23 ; CHECK-NEXT: shlq %cl, %rdx
24 ; CHECK-NEXT: cmpq $-2, %rdx
25 ; CHECK-NEXT: jg .LBB0_2
26 ; CHECK-NEXT: # %bb.1: # %if.end
27 ; CHECK-NEXT: movl $1, %ecx
28 ; CHECK-NEXT: cmovlq %rcx, %rax
29 ; CHECK-NEXT: imulq %rdi, %rax
30 ; CHECK-NEXT: .LBB0_2: # %return
34 %cmp = icmp sgt i64 %shl, -2
35 br i1 %cmp, label %return, label %if.end
37 if.end: ; preds = %entry
38 %cmp2 = icmp eq i64 %shl, -2
39 %mul = select i1 %cmp2, i64 %b, i64 1
40 %spec.select = mul nsw i64 %mul, %a
43 return: ; preds = %entry
47 define i64 @ll_a_op_b__1(i64 %a, i64 %b) {
48 ; CHECK-LABEL: ll_a_op_b__1:
49 ; CHECK: # %bb.0: # %entry
50 ; CHECK-NEXT: movq %rsi, %rax
51 ; CHECK-NEXT: movq %rdi, %rdx
52 ; CHECK-NEXT: movl %eax, %ecx
53 ; CHECK-NEXT: shlq %cl, %rdx
54 ; CHECK-NEXT: testq %rdx, %rdx
55 ; CHECK-NEXT: js .LBB1_1
56 ; CHECK-NEXT: # %bb.2: # %return
58 ; CHECK-NEXT: .LBB1_1: # %if.end
59 ; CHECK-NEXT: cmpq $-1, %rdx
60 ; CHECK-NEXT: movl $1, %ecx
61 ; CHECK-NEXT: cmovlq %rcx, %rax
62 ; CHECK-NEXT: imulq %rdi, %rax
66 %cmp = icmp sgt i64 %shl, -1
67 br i1 %cmp, label %return, label %if.end
69 if.end: ; preds = %entry
70 %cmp2 = icmp eq i64 %shl, -1
71 %mul = select i1 %cmp2, i64 %b, i64 1
72 %spec.select = mul nsw i64 %mul, %a
75 return: ; preds = %entry
79 define i64 @ll_a_op_b_0(i64 %a, i64 %b) {
80 ; CHECK-LABEL: ll_a_op_b_0:
81 ; CHECK: # %bb.0: # %entry
82 ; CHECK-NEXT: movq %rsi, %rax
83 ; CHECK-NEXT: movq %rdi, %rdx
84 ; CHECK-NEXT: movl %eax, %ecx
85 ; CHECK-NEXT: shlq %cl, %rdx
86 ; CHECK-NEXT: testq %rdx, %rdx
87 ; CHECK-NEXT: jle .LBB2_1
88 ; CHECK-NEXT: # %bb.2: # %return
90 ; CHECK-NEXT: .LBB2_1: # %if.end
91 ; CHECK-NEXT: movl $1, %ecx
92 ; CHECK-NEXT: cmovsq %rcx, %rax
93 ; CHECK-NEXT: imulq %rdi, %rax
97 %cmp = icmp sgt i64 %shl, 0
98 br i1 %cmp, label %return, label %if.end
100 if.end: ; preds = %entry
101 %cmp2 = icmp eq i64 %shl, 0
102 %mul = select i1 %cmp2, i64 %b, i64 1
103 %spec.select = mul nsw i64 %mul, %a
106 return: ; preds = %entry
110 define i64 @ll_a_op_b_1(i64 %a, i64 %b) {
111 ; CHECK-LABEL: ll_a_op_b_1:
112 ; CHECK: # %bb.0: # %entry
113 ; CHECK-NEXT: movq %rsi, %rax
114 ; CHECK-NEXT: movq %rdi, %rdx
115 ; CHECK-NEXT: movl %eax, %ecx
116 ; CHECK-NEXT: shlq %cl, %rdx
117 ; CHECK-NEXT: cmpq $1, %rdx
118 ; CHECK-NEXT: jg .LBB3_2
119 ; CHECK-NEXT: # %bb.1: # %if.end
120 ; CHECK-NEXT: testq %rdx, %rdx
121 ; CHECK-NEXT: movl $1, %ecx
122 ; CHECK-NEXT: cmovleq %rcx, %rax
123 ; CHECK-NEXT: imulq %rdi, %rax
124 ; CHECK-NEXT: .LBB3_2: # %return
127 %shl = shl i64 %a, %b
128 %cmp = icmp sgt i64 %shl, 1
129 br i1 %cmp, label %return, label %if.end
131 if.end: ; preds = %entry
132 %cmp2 = icmp eq i64 %shl, 1
133 %mul = select i1 %cmp2, i64 %b, i64 1
134 %spec.select = mul nsw i64 %mul, %a
137 return: ; preds = %entry
141 define i64 @ll_a_op_b_2(i64 %a, i64 %b) {
142 ; CHECK-LABEL: ll_a_op_b_2:
143 ; CHECK: # %bb.0: # %entry
144 ; CHECK-NEXT: movq %rsi, %rax
145 ; CHECK-NEXT: movq %rdi, %rdx
146 ; CHECK-NEXT: movl %eax, %ecx
147 ; CHECK-NEXT: shlq %cl, %rdx
148 ; CHECK-NEXT: cmpq $2, %rdx
149 ; CHECK-NEXT: jg .LBB4_2
150 ; CHECK-NEXT: # %bb.1: # %if.end
151 ; CHECK-NEXT: movl $1, %ecx
152 ; CHECK-NEXT: cmovlq %rcx, %rax
153 ; CHECK-NEXT: imulq %rdi, %rax
154 ; CHECK-NEXT: .LBB4_2: # %return
157 %shl = shl i64 %a, %b
158 %cmp = icmp sgt i64 %shl, 2
159 br i1 %cmp, label %return, label %if.end
161 if.end: ; preds = %entry
162 %cmp2 = icmp eq i64 %shl, 2
163 %mul = select i1 %cmp2, i64 %b, i64 1
164 %spec.select = mul nsw i64 %mul, %a
167 return: ; preds = %entry
171 define i64 @ll_a__2(i64 %a, i64 %b) {
172 ; CHECK-LABEL: ll_a__2:
173 ; CHECK: # %bb.0: # %entry
174 ; CHECK-NEXT: movq %rsi, %rax
175 ; CHECK-NEXT: cmpq $-2, %rdi
176 ; CHECK-NEXT: jg .LBB5_2
177 ; CHECK-NEXT: # %bb.1: # %if.end
178 ; CHECK-NEXT: movl $1, %ecx
179 ; CHECK-NEXT: cmovlq %rcx, %rax
180 ; CHECK-NEXT: imulq %rdi, %rax
181 ; CHECK-NEXT: .LBB5_2: # %return
184 %cmp = icmp sgt i64 %a, -2
185 br i1 %cmp, label %return, label %if.end
187 if.end: ; preds = %entry
188 %cmp1 = icmp eq i64 %a, -2
189 %mul = select i1 %cmp1, i64 %b, i64 1
190 %spec.select = mul nsw i64 %mul, %a
193 return: ; preds = %entry
197 define i64 @ll_a__1(i64 %a, i64 %b) {
198 ; CHECK-LABEL: ll_a__1:
199 ; CHECK: # %bb.0: # %entry
200 ; CHECK-NEXT: movq %rsi, %rax
201 ; CHECK-NEXT: testq %rdi, %rdi
202 ; CHECK-NEXT: js .LBB6_1
203 ; CHECK-NEXT: # %bb.2: # %return
205 ; CHECK-NEXT: .LBB6_1: # %if.end
206 ; CHECK-NEXT: cmpq $-1, %rdi
207 ; CHECK-NEXT: movl $1, %ecx
208 ; CHECK-NEXT: cmovlq %rcx, %rax
209 ; CHECK-NEXT: imulq %rdi, %rax
212 %cmp = icmp sgt i64 %a, -1
213 br i1 %cmp, label %return, label %if.end
215 if.end: ; preds = %entry
216 %cmp1 = icmp eq i64 %a, -1
217 %mul = select i1 %cmp1, i64 %b, i64 1
218 %spec.select = mul nsw i64 %mul, %a
221 return: ; preds = %entry
225 define i64 @ll_a_0(i64 %a, i64 %b) {
226 ; CHECK-LABEL: ll_a_0:
227 ; CHECK: # %bb.0: # %entry
228 ; CHECK-NEXT: movq %rsi, %rax
229 ; CHECK-NEXT: testq %rdi, %rdi
230 ; CHECK-NEXT: jle .LBB7_1
231 ; CHECK-NEXT: # %bb.2: # %return
233 ; CHECK-NEXT: .LBB7_1: # %if.end
234 ; CHECK-NEXT: movl $1, %ecx
235 ; CHECK-NEXT: cmovsq %rcx, %rax
236 ; CHECK-NEXT: imulq %rdi, %rax
239 %cmp = icmp sgt i64 %a, 0
240 br i1 %cmp, label %return, label %if.end
242 if.end: ; preds = %entry
243 %cmp1 = icmp eq i64 %a, 0
244 %mul = select i1 %cmp1, i64 %b, i64 1
245 %spec.select = mul nsw i64 %mul, %a
248 return: ; preds = %entry
252 define i64 @ll_a_1(i64 %a, i64 %b) {
253 ; CHECK-LABEL: ll_a_1:
254 ; CHECK: # %bb.0: # %entry
255 ; CHECK-NEXT: movq %rsi, %rax
256 ; CHECK-NEXT: cmpq $1, %rdi
257 ; CHECK-NEXT: jg .LBB8_2
258 ; CHECK-NEXT: # %bb.1: # %if.end
259 ; CHECK-NEXT: testq %rdi, %rdi
260 ; CHECK-NEXT: movl $1, %ecx
261 ; CHECK-NEXT: cmovleq %rcx, %rax
262 ; CHECK-NEXT: imulq %rdi, %rax
263 ; CHECK-NEXT: .LBB8_2: # %return
266 %cmp = icmp sgt i64 %a, 1
267 br i1 %cmp, label %return, label %if.end
269 if.end: ; preds = %entry
270 %cmp1 = icmp eq i64 %a, 1
271 %mul = select i1 %cmp1, i64 %b, i64 1
272 %spec.select = mul nsw i64 %mul, %a
275 return: ; preds = %entry
279 define i64 @ll_a_2(i64 %a, i64 %b) {
280 ; CHECK-LABEL: ll_a_2:
281 ; CHECK: # %bb.0: # %entry
282 ; CHECK-NEXT: movq %rsi, %rax
283 ; CHECK-NEXT: cmpq $2, %rdi
284 ; CHECK-NEXT: jg .LBB9_2
285 ; CHECK-NEXT: # %bb.1: # %if.end
286 ; CHECK-NEXT: movl $1, %ecx
287 ; CHECK-NEXT: cmovlq %rcx, %rax
288 ; CHECK-NEXT: imulq %rdi, %rax
289 ; CHECK-NEXT: .LBB9_2: # %return
292 %cmp = icmp sgt i64 %a, 2
293 br i1 %cmp, label %return, label %if.end
295 if.end: ; preds = %entry
296 %cmp1 = icmp eq i64 %a, 2
297 %mul = select i1 %cmp1, i64 %b, i64 1
298 %spec.select = mul nsw i64 %mul, %a
301 return: ; preds = %entry
305 define i64 @i_a_op_b__2(i32 signext %a, i32 signext %b) {
306 ; CHECK-LABEL: i_a_op_b__2:
307 ; CHECK: # %bb.0: # %entry
308 ; CHECK-NEXT: movl %esi, %ecx
309 ; CHECK-NEXT: movl %edi, %eax
310 ; CHECK-NEXT: shll %cl, %eax
311 ; CHECK-NEXT: cmpl $-2, %eax
312 ; CHECK-NEXT: jg .LBB10_2
313 ; CHECK-NEXT: # %bb.1: # %if.end
314 ; CHECK-NEXT: movl $1, %eax
315 ; CHECK-NEXT: cmovll %eax, %ecx
316 ; CHECK-NEXT: imull %edi, %ecx
317 ; CHECK-NEXT: .LBB10_2: # %return
318 ; CHECK-NEXT: movslq %ecx, %rax
321 %shl = shl i32 %a, %b
322 %cmp = icmp sgt i32 %shl, -2
323 br i1 %cmp, label %return, label %if.end
325 if.end: ; preds = %entry
326 %cmp2 = icmp eq i32 %shl, -2
327 %mul = select i1 %cmp2, i32 %b, i32 1
328 %spec.select = mul nsw i32 %mul, %a
331 return: ; preds = %if.end, %entry
332 %retval.0.in = phi i32 [ %b, %entry ], [ %spec.select, %if.end ]
333 %retval.0 = sext i32 %retval.0.in to i64
337 define i64 @i_a_op_b__1(i32 signext %a, i32 signext %b) {
338 ; CHECK-LABEL: i_a_op_b__1:
339 ; CHECK: # %bb.0: # %entry
340 ; CHECK-NEXT: movl %esi, %ecx
341 ; CHECK-NEXT: movl %edi, %eax
342 ; CHECK-NEXT: shll %cl, %eax
343 ; CHECK-NEXT: testl %eax, %eax
344 ; CHECK-NEXT: js .LBB11_1
345 ; CHECK-NEXT: # %bb.2: # %return
346 ; CHECK-NEXT: movslq %ecx, %rax
348 ; CHECK-NEXT: .LBB11_1: # %if.end
349 ; CHECK-NEXT: cmpl $-1, %eax
350 ; CHECK-NEXT: movl $1, %eax
351 ; CHECK-NEXT: cmovll %eax, %ecx
352 ; CHECK-NEXT: imull %edi, %ecx
353 ; CHECK-NEXT: movslq %ecx, %rax
356 %shl = shl i32 %a, %b
357 %cmp = icmp sgt i32 %shl, -1
358 br i1 %cmp, label %return, label %if.end
360 if.end: ; preds = %entry
361 %cmp2 = icmp eq i32 %shl, -1
362 %mul = select i1 %cmp2, i32 %b, i32 1
363 %spec.select = mul nsw i32 %mul, %a
366 return: ; preds = %if.end, %entry
367 %retval.0.in = phi i32 [ %b, %entry ], [ %spec.select, %if.end ]
368 %retval.0 = sext i32 %retval.0.in to i64
372 define i64 @i_a_op_b_0(i32 signext %a, i32 signext %b) {
373 ; CHECK-LABEL: i_a_op_b_0:
374 ; CHECK: # %bb.0: # %entry
375 ; CHECK-NEXT: movl %esi, %ecx
376 ; CHECK-NEXT: movl %edi, %eax
377 ; CHECK-NEXT: shll %cl, %eax
378 ; CHECK-NEXT: testl %eax, %eax
379 ; CHECK-NEXT: jle .LBB12_1
380 ; CHECK-NEXT: # %bb.2: # %return
381 ; CHECK-NEXT: movslq %ecx, %rax
383 ; CHECK-NEXT: .LBB12_1: # %if.end
384 ; CHECK-NEXT: movl $1, %eax
385 ; CHECK-NEXT: cmovsl %eax, %ecx
386 ; CHECK-NEXT: imull %edi, %ecx
387 ; CHECK-NEXT: movslq %ecx, %rax
390 %shl = shl i32 %a, %b
391 %cmp = icmp sgt i32 %shl, 0
392 br i1 %cmp, label %return, label %if.end
394 if.end: ; preds = %entry
395 %cmp2 = icmp eq i32 %shl, 0
396 %mul = select i1 %cmp2, i32 %b, i32 1
397 %spec.select = mul nsw i32 %mul, %a
400 return: ; preds = %if.end, %entry
401 %retval.0.in = phi i32 [ %b, %entry ], [ %spec.select, %if.end ]
402 %retval.0 = sext i32 %retval.0.in to i64
406 define i64 @i_a_op_b_1(i32 signext %a, i32 signext %b) {
407 ; CHECK-LABEL: i_a_op_b_1:
408 ; CHECK: # %bb.0: # %entry
409 ; CHECK-NEXT: movl %esi, %ecx
410 ; CHECK-NEXT: movl %edi, %eax
411 ; CHECK-NEXT: shll %cl, %eax
412 ; CHECK-NEXT: cmpl $1, %eax
413 ; CHECK-NEXT: jg .LBB13_2
414 ; CHECK-NEXT: # %bb.1: # %if.end
415 ; CHECK-NEXT: testl %eax, %eax
416 ; CHECK-NEXT: movl $1, %eax
417 ; CHECK-NEXT: cmovlel %eax, %ecx
418 ; CHECK-NEXT: imull %edi, %ecx
419 ; CHECK-NEXT: .LBB13_2: # %return
420 ; CHECK-NEXT: movslq %ecx, %rax
423 %shl = shl i32 %a, %b
424 %cmp = icmp sgt i32 %shl, 1
425 br i1 %cmp, label %return, label %if.end
427 if.end: ; preds = %entry
428 %cmp2 = icmp eq i32 %shl, 1
429 %mul = select i1 %cmp2, i32 %b, i32 1
430 %spec.select = mul nsw i32 %mul, %a
433 return: ; preds = %if.end, %entry
434 %retval.0.in = phi i32 [ %b, %entry ], [ %spec.select, %if.end ]
435 %retval.0 = sext i32 %retval.0.in to i64
439 define i64 @i_a_op_b_2(i32 signext %a, i32 signext %b) {
440 ; CHECK-LABEL: i_a_op_b_2:
441 ; CHECK: # %bb.0: # %entry
442 ; CHECK-NEXT: movl %esi, %ecx
443 ; CHECK-NEXT: movl %edi, %eax
444 ; CHECK-NEXT: shll %cl, %eax
445 ; CHECK-NEXT: cmpl $2, %eax
446 ; CHECK-NEXT: jg .LBB14_2
447 ; CHECK-NEXT: # %bb.1: # %if.end
448 ; CHECK-NEXT: movl $1, %eax
449 ; CHECK-NEXT: cmovll %eax, %ecx
450 ; CHECK-NEXT: imull %edi, %ecx
451 ; CHECK-NEXT: .LBB14_2: # %return
452 ; CHECK-NEXT: movslq %ecx, %rax
455 %shl = shl i32 %a, %b
456 %cmp = icmp sgt i32 %shl, 2
457 br i1 %cmp, label %return, label %if.end
459 if.end: ; preds = %entry
460 %cmp2 = icmp eq i32 %shl, 2
461 %mul = select i1 %cmp2, i32 %b, i32 1
462 %spec.select = mul nsw i32 %mul, %a
465 return: ; preds = %if.end, %entry
466 %retval.0.in = phi i32 [ %b, %entry ], [ %spec.select, %if.end ]
467 %retval.0 = sext i32 %retval.0.in to i64
471 define i64 @i_a__2(i32 signext %a, i32 signext %b) {
472 ; CHECK-LABEL: i_a__2:
473 ; CHECK: # %bb.0: # %entry
474 ; CHECK-NEXT: cmpl $-2, %edi
475 ; CHECK-NEXT: jg .LBB15_2
476 ; CHECK-NEXT: # %bb.1: # %if.end
477 ; CHECK-NEXT: movl $1, %eax
478 ; CHECK-NEXT: cmovll %eax, %esi
479 ; CHECK-NEXT: imull %edi, %esi
480 ; CHECK-NEXT: .LBB15_2: # %return
481 ; CHECK-NEXT: movslq %esi, %rax
484 %cmp = icmp sgt i32 %a, -2
485 br i1 %cmp, label %return, label %if.end
487 if.end: ; preds = %entry
488 %cmp1 = icmp eq i32 %a, -2
489 %mul = select i1 %cmp1, i32 %b, i32 1
490 %spec.select = mul nsw i32 %mul, %a
493 return: ; preds = %if.end, %entry
494 %retval.0.in = phi i32 [ %b, %entry ], [ %spec.select, %if.end ]
495 %retval.0 = sext i32 %retval.0.in to i64
499 define i64 @i_a__1(i32 signext %a, i32 signext %b) {
500 ; CHECK-LABEL: i_a__1:
501 ; CHECK: # %bb.0: # %entry
502 ; CHECK-NEXT: testl %edi, %edi
503 ; CHECK-NEXT: js .LBB16_1
504 ; CHECK-NEXT: # %bb.2: # %return
505 ; CHECK-NEXT: movslq %esi, %rax
507 ; CHECK-NEXT: .LBB16_1: # %if.end
508 ; CHECK-NEXT: cmpl $-1, %edi
509 ; CHECK-NEXT: movl $1, %eax
510 ; CHECK-NEXT: cmovll %eax, %esi
511 ; CHECK-NEXT: imull %edi, %esi
512 ; CHECK-NEXT: movslq %esi, %rax
515 %cmp = icmp sgt i32 %a, -1
516 br i1 %cmp, label %return, label %if.end
518 if.end: ; preds = %entry
519 %cmp1 = icmp eq i32 %a, -1
520 %mul = select i1 %cmp1, i32 %b, i32 1
521 %spec.select = mul nsw i32 %mul, %a
524 return: ; preds = %if.end, %entry
525 %retval.0.in = phi i32 [ %b, %entry ], [ %spec.select, %if.end ]
526 %retval.0 = sext i32 %retval.0.in to i64
530 define i64 @i_a_0(i32 signext %a, i32 signext %b) {
531 ; CHECK-LABEL: i_a_0:
532 ; CHECK: # %bb.0: # %entry
533 ; CHECK-NEXT: testl %edi, %edi
534 ; CHECK-NEXT: jle .LBB17_1
535 ; CHECK-NEXT: # %bb.2: # %return
536 ; CHECK-NEXT: movslq %esi, %rax
538 ; CHECK-NEXT: .LBB17_1: # %if.end
539 ; CHECK-NEXT: movl $1, %eax
540 ; CHECK-NEXT: cmovsl %eax, %esi
541 ; CHECK-NEXT: imull %edi, %esi
542 ; CHECK-NEXT: movslq %esi, %rax
545 %cmp = icmp sgt i32 %a, 0
546 br i1 %cmp, label %return, label %if.end
548 if.end: ; preds = %entry
549 %cmp1 = icmp eq i32 %a, 0
550 %mul = select i1 %cmp1, i32 %b, i32 1
551 %spec.select = mul nsw i32 %mul, %a
554 return: ; preds = %if.end, %entry
555 %retval.0.in = phi i32 [ %b, %entry ], [ %spec.select, %if.end ]
556 %retval.0 = sext i32 %retval.0.in to i64
560 define i64 @i_a_1(i32 signext %a, i32 signext %b) {
561 ; CHECK-LABEL: i_a_1:
562 ; CHECK: # %bb.0: # %entry
563 ; CHECK-NEXT: cmpl $1, %edi
564 ; CHECK-NEXT: jg .LBB18_2
565 ; CHECK-NEXT: # %bb.1: # %if.end
566 ; CHECK-NEXT: testl %edi, %edi
567 ; CHECK-NEXT: movl $1, %eax
568 ; CHECK-NEXT: cmovlel %eax, %esi
569 ; CHECK-NEXT: imull %edi, %esi
570 ; CHECK-NEXT: .LBB18_2: # %return
571 ; CHECK-NEXT: movslq %esi, %rax
574 %cmp = icmp sgt i32 %a, 1
575 br i1 %cmp, label %return, label %if.end
577 if.end: ; preds = %entry
578 %cmp1 = icmp eq i32 %a, 1
579 %mul = select i1 %cmp1, i32 %b, i32 1
580 %spec.select = mul nsw i32 %mul, %a
583 return: ; preds = %if.end, %entry
584 %retval.0.in = phi i32 [ %b, %entry ], [ %spec.select, %if.end ]
585 %retval.0 = sext i32 %retval.0.in to i64
589 define i64 @i_a_2(i32 signext %a, i32 signext %b) {
590 ; CHECK-LABEL: i_a_2:
591 ; CHECK: # %bb.0: # %entry
592 ; CHECK-NEXT: cmpl $2, %edi
593 ; CHECK-NEXT: jg .LBB19_2
594 ; CHECK-NEXT: # %bb.1: # %if.end
595 ; CHECK-NEXT: movl $1, %eax
596 ; CHECK-NEXT: cmovll %eax, %esi
597 ; CHECK-NEXT: imull %edi, %esi
598 ; CHECK-NEXT: .LBB19_2: # %return
599 ; CHECK-NEXT: movslq %esi, %rax
602 %cmp = icmp sgt i32 %a, 2
603 br i1 %cmp, label %return, label %if.end
605 if.end: ; preds = %entry
606 %cmp1 = icmp eq i32 %a, 2
607 %mul = select i1 %cmp1, i32 %b, i32 1
608 %spec.select = mul nsw i32 %mul, %a
611 return: ; preds = %if.end, %entry
612 %retval.0.in = phi i32 [ %b, %entry ], [ %spec.select, %if.end ]
613 %retval.0 = sext i32 %retval.0.in to i64