1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ;RUN: llc < %s -O2 -mattr=+avx512f -mtriple=x86_64-unknown | FileCheck %s
4 @n = common dso_local global i32 0, align 4
5 @m = common dso_local global i32 0, align 4
7 define dso_local i32 @main(i8 %small) {
9 ; CHECK: # %bb.0: # %entry
10 ; CHECK-NEXT: testb $1, %dil
11 ; CHECK-NEXT: movl $m, %eax
12 ; CHECK-NEXT: movl $n, %ecx
13 ; CHECK-NEXT: cmoveq %rax, %rcx
14 ; CHECK-NEXT: movl (%rcx), %eax
18 %cmp = icmp eq i8 %0, 0
19 %m.n = select i1 %cmp, ptr @m, ptr @n
20 %retval = load volatile i32, ptr %m.n, align 4
25 define dso_local i32 @main2(i8 %small) {
27 ; CHECK: # %bb.0: # %entry
28 ; CHECK-NEXT: movl $m, %eax
29 ; CHECK-NEXT: movl $n, %ecx
30 ; CHECK-NEXT: testb $1, %dil
31 ; CHECK-NEXT: cmovneq %rax, %rcx
32 ; CHECK-NEXT: movl (%rcx), %eax
36 %cmp = icmp eq i8 %0, 1
37 %m.n = select i1 %cmp, ptr @m, ptr @n
38 %retval = load volatile i32, ptr %m.n, align 4