1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -verify-machineinstrs -mtriple=x86_64-- | FileCheck %s
4 define i64 @select_consts_i64(i64 %offset, i32 %x) {
5 ; CHECK-LABEL: select_consts_i64:
7 ; CHECK-NEXT: leaq 42(%rdi), %rax
8 ; CHECK-NEXT: testl %esi, %esi
9 ; CHECK-NEXT: cmovneq %rdi, %rax
11 %b = icmp eq i32 %x, 0
12 %s = select i1 %b, i64 42, i64 0
13 %r = add i64 %s, %offset
17 define i64 @select_consts_big_i64(i64 %offset, i32 %x) {
18 ; CHECK-LABEL: select_consts_big_i64:
20 ; CHECK-NEXT: movabsq $42000000000, %rax # imm = 0x9C7652400
21 ; CHECK-NEXT: addq %rdi, %rax
22 ; CHECK-NEXT: testl %esi, %esi
23 ; CHECK-NEXT: cmovneq %rdi, %rax
25 %b = icmp eq i32 %x, 0
26 %s = select i1 %b, i64 42000000000, i64 0
27 %r = add i64 %s, %offset
31 define i32 @select_consts_i32(i32 %offset, i64 %x) {
32 ; CHECK-LABEL: select_consts_i32:
34 ; CHECK-NEXT: # kill: def $edi killed $edi def $rdi
35 ; CHECK-NEXT: leal 43(%rdi), %eax
36 ; CHECK-NEXT: cmpq $42, %rsi
37 ; CHECK-NEXT: cmovgel %edi, %eax
39 %b = icmp sgt i64 %x, 41
40 %s = select i1 %b, i32 0, i32 43
41 %r = add i32 %offset, %s
45 define i16 @select_consts_i16(i16 %offset, i1 %b) {
46 ; CHECK-LABEL: select_consts_i16:
48 ; CHECK-NEXT: # kill: def $edi killed $edi def $rdi
49 ; CHECK-NEXT: leal 44(%rdi), %eax
50 ; CHECK-NEXT: testb $1, %sil
51 ; CHECK-NEXT: cmovel %edi, %eax
52 ; CHECK-NEXT: # kill: def $ax killed $ax killed $eax
54 %s = select i1 %b, i16 44, i16 0
55 %r = add i16 %s, %offset
59 define i8 @select_consts_i8(i8 %offset, i1 %b) {
60 ; CHECK-LABEL: select_consts_i8:
62 ; CHECK-NEXT: xorl %ecx, %ecx
63 ; CHECK-NEXT: testb $1, %sil
64 ; CHECK-NEXT: movl $45, %eax
65 ; CHECK-NEXT: cmovnel %ecx, %eax
66 ; CHECK-NEXT: addb %dil, %al
67 ; CHECK-NEXT: # kill: def $al killed $al killed $eax
69 %s = select i1 %b, i8 0, i8 45
70 %r = add i8 %offset, %s
74 define i32 @select_consts_use_i32(i32 %offset, i64 %x, ptr %p) {
75 ; CHECK-LABEL: select_consts_use_i32:
77 ; CHECK-NEXT: xorl %ecx, %ecx
78 ; CHECK-NEXT: cmpq $42, %rsi
79 ; CHECK-NEXT: movl $43, %eax
80 ; CHECK-NEXT: cmovgel %ecx, %eax
81 ; CHECK-NEXT: movl %eax, (%rdx)
82 ; CHECK-NEXT: addl %edi, %eax
84 %b = icmp sgt i64 %x, 41
85 %s = select i1 %b, i32 0, i32 43
87 %r = add i32 %offset, %s
91 ; Special-case LEA hacks are done before we try to push the add into a CMOV.
93 define i32 @select_40_43_i32(i32 %offset, i64 %x) {
94 ; CHECK-LABEL: select_40_43_i32:
96 ; CHECK-NEXT: # kill: def $edi killed $edi def $rdi
97 ; CHECK-NEXT: xorl %eax, %eax
98 ; CHECK-NEXT: cmpq $42, %rsi
99 ; CHECK-NEXT: setl %al
100 ; CHECK-NEXT: leal (%rax,%rax,2), %eax
101 ; CHECK-NEXT: leal 40(%rdi,%rax), %eax
103 %b = icmp sgt i64 %x, 41
104 %s = select i1 %b, i32 40, i32 43
105 %r = add i32 %offset, %s
109 define i32 @select_0_1_i32(i32 %offset, i64 %x) {
110 ; CHECK-LABEL: select_0_1_i32:
112 ; CHECK-NEXT: movl %edi, %eax
113 ; CHECK-NEXT: cmpq $42, %rsi
114 ; CHECK-NEXT: adcl $0, %eax
116 %b = icmp ugt i64 %x, 41
117 %s = select i1 %b, i32 0, i32 1
118 %r = add i32 %offset, %s
122 define i32 @select_1_0_i32(i32 %offset, i64 %x) {
123 ; CHECK-LABEL: select_1_0_i32:
125 ; CHECK-NEXT: movl %edi, %eax
126 ; CHECK-NEXT: cmpq $42, %rsi
127 ; CHECK-NEXT: sbbl $-1, %eax
129 %b = icmp ugt i64 %x, 41
130 %s = select i1 %b, i32 1, i32 0
131 %r = add i32 %offset, %s
135 define i64 @select_max32_2_i64(i64 %offset, i64 %x) {
136 ; CHECK-LABEL: select_max32_2_i64:
138 ; CHECK-NEXT: leaq 2(%rdi), %rax
139 ; CHECK-NEXT: leaq 2147483647(%rdi), %rcx
140 ; CHECK-NEXT: cmpq $41, %rsi
141 ; CHECK-NEXT: cmovneq %rcx, %rax
143 %b = icmp ne i64 %x, 41
144 %s = select i1 %b, i64 2147483647, i64 2
145 %r = add i64 %offset, %s
149 define i64 @select_42_min32_i64(i64 %offset, i1 %b) {
150 ; CHECK-LABEL: select_42_min32_i64:
152 ; CHECK-NEXT: testb $1, %sil
153 ; CHECK-NEXT: movl $42, %ecx
154 ; CHECK-NEXT: movl $2147483648, %eax # imm = 0x80000000
155 ; CHECK-NEXT: cmovneq %rcx, %rax
156 ; CHECK-NEXT: addq %rdi, %rax
158 %s = select i1 %b, i64 42, i64 2147483648
159 %r = add i64 %offset, %s
163 define i64 @select_big_42_i64(i64 %offset, i64 %x) {
164 ; CHECK-LABEL: select_big_42_i64:
166 ; CHECK-NEXT: cmpq $41, %rsi
167 ; CHECK-NEXT: movl $2147483649, %ecx # imm = 0x80000001
168 ; CHECK-NEXT: movl $42, %eax
169 ; CHECK-NEXT: cmovneq %rcx, %rax
170 ; CHECK-NEXT: addq %rdi, %rax
172 %b = icmp ne i64 %x, 41
173 %s = select i1 %b, i64 2147483649, i64 42
174 %r = add i64 %s, %offset
178 define i64 @select_n42_big_i64(i64 %offset, i64 %x) {
179 ; CHECK-LABEL: select_n42_big_i64:
181 ; CHECK-NEXT: cmpq $41, %rsi
182 ; CHECK-NEXT: movq $-42, %rcx
183 ; CHECK-NEXT: movl $2147483649, %eax # imm = 0x80000001
184 ; CHECK-NEXT: cmovneq %rcx, %rax
185 ; CHECK-NEXT: addq %rdi, %rax
187 %b = icmp ne i64 %x, 41
188 %s = select i1 %b, i64 -42, i64 2147483649
189 %r = add i64 %s, %offset
193 define i64 @select_big_bigger_i64(i64 %offset, i64 %x) {
194 ; CHECK-LABEL: select_big_bigger_i64:
196 ; CHECK-NEXT: cmpq $41, %rsi
197 ; CHECK-NEXT: movl $2147483649, %ecx # imm = 0x80000001
198 ; CHECK-NEXT: movabsq $42000000000, %rax # imm = 0x9C7652400
199 ; CHECK-NEXT: cmovneq %rcx, %rax
200 ; CHECK-NEXT: addq %rdi, %rax
202 %b = icmp ne i64 %x, 41
203 %s = select i1 %b, i64 2147483649, i64 42000000000
204 %r = add i64 %s, %offset
208 define i32 @select_20_43_i32(i32 %offset, i64 %x) {
209 ; CHECK-LABEL: select_20_43_i32:
211 ; CHECK-NEXT: # kill: def $edi killed $edi def $rdi
212 ; CHECK-NEXT: leal 43(%rdi), %ecx
213 ; CHECK-NEXT: leal 20(%rdi), %eax
214 ; CHECK-NEXT: cmpq $42, %rsi
215 ; CHECK-NEXT: cmovll %ecx, %eax
217 %b = icmp sgt i64 %x, 41
218 %s = select i1 %b, i32 20, i32 43
219 %r = add i32 %offset, %s
223 define i16 @select_n2_17_i16(i16 %offset, i1 %b) {
224 ; CHECK-LABEL: select_n2_17_i16:
226 ; CHECK-NEXT: # kill: def $edi killed $edi def $rdi
227 ; CHECK-NEXT: leal 17(%rdi), %ecx
228 ; CHECK-NEXT: leal 65534(%rdi), %eax
229 ; CHECK-NEXT: testb $1, %sil
230 ; CHECK-NEXT: cmovel %ecx, %eax
231 ; CHECK-NEXT: # kill: def $ax killed $ax killed $eax
233 %s = select i1 %b, i16 -2, i16 17
234 %r = add i16 %offset, %s
238 %class.btAxis = type { %struct.btBroadphaseProxy.base, [3 x i16], [3 x i16], ptr }
239 %struct.btBroadphaseProxy.base = type <{ ptr, i16, i16, [4 x i8], ptr, i32, [4 x float], [4 x float] }>
240 %struct.btBroadphaseProxy = type <{ ptr, i16, i16, [4 x i8], ptr, i32, [4 x float], [4 x float], [4 x i8] }>
242 define ptr @bullet(i1 %b, ptr readnone %ptr, i64 %idx) {
243 ; CHECK-LABEL: bullet:
245 ; CHECK-NEXT: leaq (%rdx,%rdx,4), %rax
246 ; CHECK-NEXT: shlq $4, %rax
247 ; CHECK-NEXT: leaq 60(%rsi,%rax), %rcx
248 ; CHECK-NEXT: leaq 66(%rsi,%rax), %rax
249 ; CHECK-NEXT: testb $1, %dil
250 ; CHECK-NEXT: cmovneq %rcx, %rax
252 %gep2 = getelementptr inbounds %class.btAxis, ptr %ptr, i64 %idx, i32 2, i64 0
253 %gep1 = getelementptr inbounds %class.btAxis, ptr %ptr, i64 %idx, i32 1, i64 0
254 %sel = select i1 %b, ptr %gep1, ptr %gep2
258 define ptr @bullet_alt1(i1 %b, ptr readnone %ptr, i64 %idx) {
259 ; CHECK-LABEL: bullet_alt1:
261 ; CHECK-NEXT: leaq 60(%rsi), %rax
262 ; CHECK-NEXT: leaq 66(%rsi), %rcx
263 ; CHECK-NEXT: testb $1, %dil
264 ; CHECK-NEXT: cmovneq %rax, %rcx
265 ; CHECK-NEXT: leaq (%rdx,%rdx,4), %rax
266 ; CHECK-NEXT: shlq $4, %rax
267 ; CHECK-NEXT: addq %rcx, %rax
269 %idx40 = mul i64 %idx, 40
270 %gep2 = getelementptr inbounds i16, ptr %ptr, i64 33
271 %gep1 = getelementptr inbounds i16, ptr %ptr, i64 30
272 %sel = select i1 %b, ptr %gep1, ptr %gep2
273 %gep3 = getelementptr inbounds i16, ptr %sel, i64 %idx40
277 define void @bullet_load_store(i32 %x, i64 %y, ptr %p) {
278 ; CHECK-LABEL: bullet_load_store:
280 ; CHECK-NEXT: leaq (%rsi,%rsi,4), %rax
281 ; CHECK-NEXT: shlq $4, %rax
282 ; CHECK-NEXT: leaq 66(%rdx), %rcx
283 ; CHECK-NEXT: addq $60, %rdx
284 ; CHECK-NEXT: testb $1, %dil
285 ; CHECK-NEXT: cmovneq %rcx, %rdx
286 ; CHECK-NEXT: decw (%rdx,%rax)
289 %b = icmp eq i32 %and, 0
290 %gep2 = getelementptr inbounds %class.btAxis, ptr %p, i64 %y, i32 2, i64 0
291 %gep1 = getelementptr inbounds %class.btAxis, ptr %p, i64 %y, i32 1, i64 0
292 %sel = select i1 %b, ptr %gep1, ptr %gep2
293 %ld = load i16, ptr %sel, align 4
294 %dec = add i16 %ld, -1
295 store i16 %dec, ptr %sel, align 4
299 define void @complex_lea_alt1(i1 %b, ptr readnone %ptr, i64 %idx) {
300 ; CHECK-LABEL: complex_lea_alt1:
302 ; CHECK-NEXT: leaq 60(%rdx), %rax
303 ; CHECK-NEXT: addq $66, %rdx
304 ; CHECK-NEXT: testb $1, %dil
305 ; CHECK-NEXT: cmovneq %rax, %rdx
306 ; CHECK-NEXT: decw (%rdx,%rsi)
308 %i = ptrtoint ptr %ptr to i64
309 %sum = add i64 %idx, %i
310 %base = inttoptr i64 %sum to ptr
311 %gep2 = getelementptr inbounds i16, ptr %base, i64 33
312 %gep1 = getelementptr inbounds i16, ptr %base, i64 30
313 %sel = select i1 %b, ptr %gep1, ptr %gep2
314 %ld = load i16, ptr %sel, align 4
315 %dec = add i16 %ld, -1
316 store i16 %dec, ptr %sel, align 4
320 define void @complex_lea_alt2(i1 %b, ptr readnone %ptr, i64 %idx) {
321 ; CHECK-LABEL: complex_lea_alt2:
323 ; CHECK-NEXT: leaq 60(%rsi), %rax
324 ; CHECK-NEXT: addq $66, %rsi
325 ; CHECK-NEXT: testb $1, %dil
326 ; CHECK-NEXT: cmovneq %rax, %rsi
327 ; CHECK-NEXT: decw (%rsi,%rdx)
329 %i = ptrtoint ptr %ptr to i64
330 %sum = add i64 %i, %idx
331 %base = inttoptr i64 %sum to ptr
332 %gep2 = getelementptr inbounds i16, ptr %base, i64 33
333 %gep1 = getelementptr inbounds i16, ptr %base, i64 30
334 %sel = select i1 %b, ptr %gep1, ptr %gep2
335 %ld = load i16, ptr %sel, align 4
336 %dec = add i16 %ld, -1
337 store i16 %dec, ptr %sel, align 4
341 define void @complex_lea_alt3(i1 %b, ptr readnone %ptr, i64 %idx) {
342 ; CHECK-LABEL: complex_lea_alt3:
344 ; CHECK-NEXT: leaq 60(%rsi), %rax
345 ; CHECK-NEXT: addq $66, %rsi
346 ; CHECK-NEXT: testb $1, %dil
347 ; CHECK-NEXT: cmovneq %rax, %rsi
348 ; CHECK-NEXT: decw (%rsi,%rdx)
350 %i = ptrtoint ptr %ptr to i64
351 %i66 = add i64 %i, 66
352 %i60 = add i64 %i, 60
353 %o66 = add i64 %i66, %idx
354 %o60 = add i64 %i60, %idx
355 %p66 = inttoptr i64 %o66 to ptr
356 %p60 = inttoptr i64 %o60 to ptr
357 %sel = select i1 %b, ptr %p60, ptr %p66
358 %ld = load i16, ptr %sel, align 4
359 %dec = add i16 %ld, -1
360 store i16 %dec, ptr %sel, align 4
364 define void @complex_lea_alt4(i1 %b, ptr readnone %ptr, i64 %idx) {
365 ; CHECK-LABEL: complex_lea_alt4:
367 ; CHECK-NEXT: leaq 60(%rsi), %rax
368 ; CHECK-NEXT: addq $66, %rsi
369 ; CHECK-NEXT: testb $1, %dil
370 ; CHECK-NEXT: cmovneq %rax, %rsi
371 ; CHECK-NEXT: decw (%rdx,%rsi)
373 %i = ptrtoint ptr %ptr to i64
374 %i66 = add i64 %i, 66
375 %i60 = add i64 %i, 60
376 %o66 = add i64 %idx, %i66
377 %o60 = add i64 %idx, %i60
378 %p66 = inttoptr i64 %o66 to ptr
379 %p60 = inttoptr i64 %o60 to ptr
380 %sel = select i1 %b, ptr %p60, ptr %p66
381 %ld = load i16, ptr %sel, align 4
382 %dec = add i16 %ld, -1
383 store i16 %dec, ptr %sel, align 4
387 define void @complex_lea_alt5(i1 %b, ptr readnone %ptr, i64 %idx) {
388 ; CHECK-LABEL: complex_lea_alt5:
390 ; CHECK-NEXT: leaq 60(%rdx), %rax
391 ; CHECK-NEXT: addq $66, %rdx
392 ; CHECK-NEXT: testb $1, %dil
393 ; CHECK-NEXT: cmovneq %rax, %rdx
394 ; CHECK-NEXT: decw (%rdx,%rsi)
396 %i = ptrtoint ptr %ptr to i64
397 %i66 = add i64 %idx, 66
398 %i60 = add i64 %idx, 60
399 %o66 = add i64 %i66, %i
400 %o60 = add i64 %i60, %i
401 %p66 = inttoptr i64 %o66 to ptr
402 %p60 = inttoptr i64 %o60 to ptr
403 %sel = select i1 %b, ptr %p60, ptr %p66
404 %ld = load i16, ptr %sel, align 4
405 %dec = add i16 %ld, -1
406 store i16 %dec, ptr %sel, align 4
410 define void @complex_lea_alt6(i1 %b, ptr readnone %ptr, i64 %idx) {
411 ; CHECK-LABEL: complex_lea_alt6:
413 ; CHECK-NEXT: leaq 60(%rdx), %rax
414 ; CHECK-NEXT: addq $66, %rdx
415 ; CHECK-NEXT: testb $1, %dil
416 ; CHECK-NEXT: cmovneq %rax, %rdx
417 ; CHECK-NEXT: decw (%rsi,%rdx)
419 %i = ptrtoint ptr %ptr to i64
420 %i66 = add i64 %idx, 66
421 %i60 = add i64 %idx, 60
422 %o66 = add i64 %i, %i66
423 %o60 = add i64 %i, %i60
424 %p66 = inttoptr i64 %o66 to ptr
425 %p60 = inttoptr i64 %o60 to ptr
426 %sel = select i1 %b, ptr %p60, ptr %p66
427 %ld = load i16, ptr %sel, align 4
428 %dec = add i16 %ld, -1
429 store i16 %dec, ptr %sel, align 4
433 define void @complex_lea_alt7(i1 %b, ptr readnone %ptr, i64 %idx) {
434 ; CHECK-LABEL: complex_lea_alt7:
436 ; CHECK-NEXT: leaq 60(%rdx), %rax
437 ; CHECK-NEXT: addq $66, %rdx
438 ; CHECK-NEXT: testb $1, %dil
439 ; CHECK-NEXT: cmovneq %rax, %rdx
440 ; CHECK-NEXT: decw (%rdx,%rsi)
442 %i = ptrtoint ptr %ptr to i64
443 %o = add i64 %idx, %i
444 %o66 = add i64 %o, 66
445 %o60 = add i64 %o, 60
446 %p66 = inttoptr i64 %o66 to ptr
447 %p60 = inttoptr i64 %o60 to ptr
448 %sel = select i1 %b, ptr %p60, ptr %p66
449 %ld = load i16, ptr %sel, align 4
450 %dec = add i16 %ld, -1
451 store i16 %dec, ptr %sel, align 4
455 define void @complex_lea_alt8(i1 %b, ptr readnone %ptr, i64 %idx) {
456 ; CHECK-LABEL: complex_lea_alt8:
458 ; CHECK-NEXT: leaq 60(%rsi), %rax
459 ; CHECK-NEXT: addq $66, %rsi
460 ; CHECK-NEXT: testb $1, %dil
461 ; CHECK-NEXT: cmovneq %rax, %rsi
462 ; CHECK-NEXT: decw (%rsi,%rdx)
464 %i = ptrtoint ptr %ptr to i64
465 %o = add i64 %i, %idx
466 %o66 = add i64 %o, 66
467 %o60 = add i64 %o, 60
468 %p66 = inttoptr i64 %o66 to ptr
469 %p60 = inttoptr i64 %o60 to ptr
470 %sel = select i1 %b, ptr %p60, ptr %p66
471 %ld = load i16, ptr %sel, align 4
472 %dec = add i16 %ld, -1
473 store i16 %dec, ptr %sel, align 4
477 define i32 @loadfold_select_const_arms(ptr %x, i1 %y) {
478 ; CHECK-LABEL: loadfold_select_const_arms:
480 ; CHECK-NEXT: testb $1, %sil
481 ; CHECK-NEXT: movl $10, %ecx
482 ; CHECK-NEXT: movl $-10, %eax
483 ; CHECK-NEXT: cmovnel %ecx, %eax
484 ; CHECK-NEXT: addl (%rdi), %eax
486 %cond = select i1 %y, i32 10, i32 -10
487 %t0 = load i32, ptr %x, align 4
488 %add = add nsw i32 %t0, %cond
492 define void @rmw_add(ptr %x, i1 %y, i32 %z, i32 %w) {
493 ; CHECK-LABEL: rmw_add:
495 ; CHECK-NEXT: testb $1, %sil
496 ; CHECK-NEXT: cmovel %ecx, %edx
497 ; CHECK-NEXT: addl %edx, (%rdi)
499 %cond = select i1 %y, i32 %z, i32 %w
500 %t0 = load i32, ptr %x, align 4
501 %add = add nsw i32 %t0, %cond
502 store i32 %add, ptr %x, align 4
506 define void @rmw_add_select_const_arm(ptr %x, i1 %y, i32 %z) {
507 ; CHECK-LABEL: rmw_add_select_const_arm:
509 ; CHECK-NEXT: testb $1, %sil
510 ; CHECK-NEXT: movl $-10, %eax
511 ; CHECK-NEXT: cmovnel %edx, %eax
512 ; CHECK-NEXT: addl %eax, (%rdi)
514 %cond = select i1 %y, i32 %z, i32 -10
515 %t0 = load i32, ptr %x, align 4
516 %add = add nsw i32 %t0, %cond
517 store i32 %add, ptr %x, align 4
521 define void @rmw_select_const_arms(ptr %x, i1 %y) {
522 ; CHECK-LABEL: rmw_select_const_arms:
524 ; CHECK-NEXT: testb $1, %sil
525 ; CHECK-NEXT: movl $10, %eax
526 ; CHECK-NEXT: movl $-10, %ecx
527 ; CHECK-NEXT: cmovnel %eax, %ecx
528 ; CHECK-NEXT: addl %ecx, (%rdi)
530 %cond = select i1 %y, i32 10, i32 -10
531 %t0 = load i32, ptr %x, align 4
532 %add = add nsw i32 %t0, %cond
533 store i32 %add, ptr %x, align 4
537 define i32 @rmw_select_const_arms_extra_load_use(ptr %x, i1 %y) {
538 ; CHECK-LABEL: rmw_select_const_arms_extra_load_use:
540 ; CHECK-NEXT: movl (%rdi), %eax
541 ; CHECK-NEXT: leal -10(%rax), %ecx
542 ; CHECK-NEXT: leal 10(%rax), %edx
543 ; CHECK-NEXT: testb $1, %sil
544 ; CHECK-NEXT: cmovel %ecx, %edx
545 ; CHECK-NEXT: movl %edx, (%rdi)
546 ; CHECK-NEXT: # kill: def $eax killed $eax killed $rax
548 %cond = select i1 %y, i32 10, i32 -10
549 %t0 = load i32, ptr %x, align 4
550 %add = add nsw i32 %t0, %cond
551 store i32 %add, ptr %x, align 4
555 define i32 @rmw_select_const_arms_extra_add_use(ptr %x, i1 %y) {
556 ; CHECK-LABEL: rmw_select_const_arms_extra_add_use:
558 ; CHECK-NEXT: testb $1, %sil
559 ; CHECK-NEXT: movl $10, %ecx
560 ; CHECK-NEXT: movl $-10, %eax
561 ; CHECK-NEXT: cmovnel %ecx, %eax
562 ; CHECK-NEXT: addl (%rdi), %eax
563 ; CHECK-NEXT: movl %eax, (%rdi)
565 %cond = select i1 %y, i32 10, i32 -10
566 %t0 = load i32, ptr %x, align 4
567 %add = add nsw i32 %t0, %cond
568 store i32 %add, ptr %x, align 4