diff --git a/llvm/test/CodeGen/X86/select_const.ll b/llvm/test/CodeGen/X86/select_const.ll index cbf55fb7ce7f7..c910e3da33ed7 100644 --- a/llvm/test/CodeGen/X86/select_const.ll +++ b/llvm/test/CodeGen/X86/select_const.ll @@ -429,6 +429,18 @@ define i32 @select_C1_C2_signext(i1 signext %cond) { ret i32 %sel } +define i32 @select_n_or_minus1(i1 signext %cond) { +; CHECK-LABEL: select_n_or_minus1: +; CHECK: # %bb.0: +; CHECK-NEXT: testb $1, %dil +; CHECK-NEXT: movl $12414, %ecx # imm = 0x307E +; CHECK-NEXT: movl $-1, %eax +; CHECK-NEXT: cmovnel %ecx, %eax +; CHECK-NEXT: retq + %sel = select i1 %cond, i32 12414, i32 -1 + ret i32 %sel +} + ; select (x == 2), 2, (x + 1) --> select (x == 2), x, (x + 1) define i64 @select_2_or_inc(i64 %x) { @@ -448,11 +460,11 @@ define <4 x i32> @sel_constants_add_constant_vec(i1 %cond) { ; CHECK-LABEL: sel_constants_add_constant_vec: ; CHECK: # %bb.0: ; CHECK-NEXT: testb $1, %dil -; CHECK-NEXT: jne .LBB36_1 +; CHECK-NEXT: jne .LBB37_1 ; CHECK-NEXT: # %bb.2: ; CHECK-NEXT: movaps {{.*#+}} xmm0 = [12,13,14,15] ; CHECK-NEXT: retq -; CHECK-NEXT: .LBB36_1: +; CHECK-NEXT: .LBB37_1: ; CHECK-NEXT: movaps {{.*#+}} xmm0 = [4294967293,14,4,4] ; CHECK-NEXT: retq %sel = select i1 %cond, <4 x i32> , <4 x i32> @@ -464,11 +476,11 @@ define <2 x double> @sel_constants_fmul_constant_vec(i1 %cond) { ; CHECK-LABEL: sel_constants_fmul_constant_vec: ; CHECK: # %bb.0: ; CHECK-NEXT: testb $1, %dil -; CHECK-NEXT: jne .LBB37_1 +; CHECK-NEXT: jne .LBB38_1 ; CHECK-NEXT: # %bb.2: ; CHECK-NEXT: movaps {{.*#+}} xmm0 = [1.1883E+2,3.4539999999999999E+1] ; CHECK-NEXT: retq -; CHECK-NEXT: .LBB37_1: +; CHECK-NEXT: .LBB38_1: ; CHECK-NEXT: movaps {{.*#+}} xmm0 = [-2.0399999999999999E+1,3.768E+1] ; CHECK-NEXT: retq %sel = select i1 %cond, <2 x double> , <2 x double> @@ -509,4 +521,3 @@ define float @select_undef_fp(float %x) { %f = select i1 undef, float 4.0, float %x ret float %f } -