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 3 4@n = common global i32 0, align 4 5@m = common global i32 0, align 4 6 7define i32 @main(i8 %small) { 8; CHECK-LABEL: main: 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 15; CHECK-NEXT: retq 16entry: 17 %0 = and i8 %small, 1 18 %cmp = icmp eq i8 %0, 0 19 %m.n = select i1 %cmp, i32* @m, i32* @n 20 %retval = load volatile i32, i32* %m.n, align 4 21 ret i32 %retval 22} 23 24 25define i32 @main2(i8 %small) { 26; CHECK-LABEL: main2: 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 33; CHECK-NEXT: retq 34entry: 35 %0 = and i8 %small, 1 36 %cmp = icmp eq i8 %0, 1 37 %m.n = select i1 %cmp, i32* @m, i32* @n 38 %retval = load volatile i32, i32* %m.n, align 4 39 ret i32 %retval 40} 41