[llvm] r284896 - [x86] add test for missing vector SRA combine via computeKnownBits

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 21 16:02:31 PDT 2016


Author: spatel
Date: Fri Oct 21 18:02:31 2016
New Revision: 284896

URL: http://llvm.org/viewvc/llvm-project?rev=284896&view=rev
Log:
[x86] add test for missing vector SRA combine via computeKnownBits

Modified:
    llvm/trunk/test/CodeGen/X86/combine-sra.ll

Modified: llvm/trunk/test/CodeGen/X86/combine-sra.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/combine-sra.ll?rev=284896&r1=284895&r2=284896&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/combine-sra.ll (original)
+++ llvm/trunk/test/CodeGen/X86/combine-sra.ll Fri Oct 21 18:02:31 2016
@@ -296,3 +296,21 @@ define <4 x i32> @combine_vec_ashr_posit
   %2 = ashr <4 x i32> %1, %y
   ret <4 x i32> %2
 }
+
+define <4 x i32> @combine_vec_ashr_positive_splat(<4 x i32> %x, <4 x i32> %y) {
+; SSE-LABEL: combine_vec_ashr_positive_splat:
+; SSE:       # BB#0:
+; SSE-NEXT:    pand {{.*}}(%rip), %xmm0
+; SSE-NEXT:    psrld $10, %xmm0
+; SSE-NEXT:    retq
+;
+; AVX-LABEL: combine_vec_ashr_positive_splat:
+; AVX:       # BB#0:
+; AVX-NEXT:    vpbroadcastd {{.*}}(%rip), %xmm1
+; AVX-NEXT:    vpand %xmm1, %xmm0, %xmm0
+; AVX-NEXT:    vpsrld $10, %xmm0, %xmm0
+; AVX-NEXT:    retq
+  %1 = and <4 x i32> %x, <i32 1023, i32 1023, i32 1023, i32 1023>
+  %2 = ashr <4 x i32> %1, <i32 10, i32 10, i32 10, i32 10>
+  ret <4 x i32> %2
+}




More information about the llvm-commits mailing list