From d621e3a25bc32b8e9936bf125760bd033fbd1207 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Thu, 24 Nov 2016 21:48:50 +0000 Subject: [PATCH] [X86] Modify two tests that passed undef to both sides of a vselect to instead pass unique values. I'd like to teach DAG combine to remove vselects where both sides are identical and these tests were in the way of that. llvm-svn: 287903 --- llvm/test/CodeGen/X86/2011-10-19-widen_vselect.ll | 8 ++++---- llvm/test/CodeGen/X86/2011-10-21-widen-cmp.ll | 18 ++++++++++-------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/llvm/test/CodeGen/X86/2011-10-19-widen_vselect.ll b/llvm/test/CodeGen/X86/2011-10-19-widen_vselect.ll index 07dff95..b527269 100644 --- a/llvm/test/CodeGen/X86/2011-10-19-widen_vselect.ll +++ b/llvm/test/CodeGen/X86/2011-10-19-widen_vselect.ll @@ -6,9 +6,9 @@ ; CHECK-LABEL: simple_widen ; CHECK-NOT: blend ; CHECK: ret -define void @simple_widen() { +define void @simple_widen(<2 x float> %a, <2 x float> %b) { entry: - %0 = select <2 x i1> undef, <2 x float> undef, <2 x float> undef + %0 = select <2 x i1> undef, <2 x float> %a, <2 x float> %b store <2 x float> %0, <2 x float>* undef ret void } @@ -17,10 +17,10 @@ entry: ; CHECK: blend ; CHECK: ret -define void @complex_inreg_work() { +define void @complex_inreg_work(<2 x float> %a, <2 x float> %b) { entry: %0 = fcmp oeq <2 x float> undef, undef - %1 = select <2 x i1> %0, <2 x float> undef, <2 x float> undef + %1 = select <2 x i1> %0, <2 x float> %a, <2 x float> %b store <2 x float> %1, <2 x float>* undef ret void } diff --git a/llvm/test/CodeGen/X86/2011-10-21-widen-cmp.ll b/llvm/test/CodeGen/X86/2011-10-21-widen-cmp.ll index f916ff2..f60eb5a 100644 --- a/llvm/test/CodeGen/X86/2011-10-21-widen-cmp.ll +++ b/llvm/test/CodeGen/X86/2011-10-21-widen-cmp.ll @@ -4,34 +4,36 @@ ; Check that a <4 x float> compare is generated and that we are ; not stuck in an endless loop. -define void @cmp_2_floats() { +define void @cmp_2_floats(<2 x float> %a, <2 x float> %b) { ; CHECK-LABEL: cmp_2_floats: ; CHECK: # BB#0: # %entry +; CHECK-NEXT: movaps %xmm0, %xmm2 ; CHECK-NEXT: cmpordps %xmm0, %xmm0 ; CHECK-NEXT: pmovzxdq {{.*#+}} xmm0 = xmm0[0],zero,xmm0[1],zero ; CHECK-NEXT: psllq $32, %xmm0 ; CHECK-NEXT: pshufd {{.*#+}} xmm0 = xmm0[1,3,2,3] ; CHECK-NEXT: pslld $31, %xmm0 -; CHECK-NEXT: blendvps %xmm0, %xmm0 -; CHECK-NEXT: movlps %xmm0, (%rax) +; CHECK-NEXT: blendvps %xmm2, %xmm1 +; CHECK-NEXT: movlps %xmm1, (%rax) ; CHECK-NEXT: retq entry: %0 = fcmp oeq <2 x float> undef, undef - %1 = select <2 x i1> %0, <2 x float> undef, <2 x float> undef + %1 = select <2 x i1> %0, <2 x float> %a, <2 x float> %b store <2 x float> %1, <2 x float>* undef ret void } -define void @cmp_2_doubles() { +define void @cmp_2_doubles(<2 x double> %a, <2 x double> %b) { ; CHECK-LABEL: cmp_2_doubles: ; CHECK: # BB#0: # %entry +; CHECK-NEXT: movapd %xmm0, %xmm2 ; CHECK-NEXT: cmpordpd %xmm0, %xmm0 -; CHECK-NEXT: blendvpd %xmm0, %xmm0 -; CHECK-NEXT: movapd %xmm0, (%rax) +; CHECK-NEXT: blendvpd %xmm2, %xmm1 +; CHECK-NEXT: movapd %xmm1, (%rax) ; CHECK-NEXT: retq entry: %0 = fcmp oeq <2 x double> undef, undef - %1 = select <2 x i1> %0, <2 x double> undef, <2 x double> undef + %1 = select <2 x i1> %0, <2 x double> %a, <2 x double> %b store <2 x double> %1, <2 x double>* undef ret void } -- 2.7.4