diff options
author | Amaury Séchet <deadalnix@gmail.com> | 2022-09-27 23:47:41 +0300 |
---|---|---|
committer | Amaury Séchet <deadalnix@gmail.com> | 2022-09-28 00:07:10 +0300 |
commit | 4bab490de238a07f70749246930654bff5892e12 (patch) | |
tree | c948732fb774ed3058fd2921495c394c154b88ae | |
parent | fbfb4a6359c100ac4f33982688cb0e2c299fb239 (diff) |
[X86] Add test case for D134736. NFC
-rw-r--r-- | llvm/test/CodeGen/X86/select_const.ll | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/llvm/test/CodeGen/X86/select_const.ll b/llvm/test/CodeGen/X86/select_const.ll index cbf55fb7ce7f..c910e3da33ed 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> <i32 -4, i32 12, i32 1, i32 0>, <4 x i32> <i32 11, i32 11, i32 11, i32 11> @@ -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> <double -4.0, double 12.0>, <2 x double> <double 23.3, double 11.0> @@ -509,4 +521,3 @@ define float @select_undef_fp(float %x) { %f = select i1 undef, float 4.0, float %x ret float %f } - |