[llvm] r297564 - [X86] Add avx2 gather tests cases that show a failure to remove zeroing of the source when the mask is all ones.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Sat Mar 11 10:26:00 PST 2017
Author: ctopper
Date: Sat Mar 11 12:26:00 2017
New Revision: 297564
URL: http://llvm.org/viewvc/llvm-project?rev=297564&view=rev
Log:
[X86] Add avx2 gather tests cases that show a failure to remove zeroing of the source when the mask is all ones.
Modified:
llvm/trunk/test/CodeGen/X86/avx2-gather.ll
Modified: llvm/trunk/test/CodeGen/X86/avx2-gather.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/avx2-gather.ll?rev=297564&r1=297563&r2=297564&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/avx2-gather.ll (original)
+++ llvm/trunk/test/CodeGen/X86/avx2-gather.ll Sat Mar 11 12:26:00 2017
@@ -85,3 +85,55 @@ define <4 x double> @test_x86_avx2_gathe
i8* %a1, <4 x i32> %idx, <4 x double> %mask, i8 8) ;
ret <4 x double> %res
}
+
+define <2 x i64> @test_mm_i32gather_epi32(i32 *%a0, <2 x i64> %a1) {
+; X32-LABEL: test_mm_i32gather_epi32:
+; X32: ## BB#0:
+; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X32-NEXT: vpcmpeqd %xmm2, %xmm2, %xmm2
+; X32-NEXT: vpxor %xmm1, %xmm1, %xmm1
+; X32-NEXT: vpgatherdd %xmm2, (%eax,%xmm0,2), %xmm1
+; X32-NEXT: vmovdqa %xmm1, %xmm0
+; X32-NEXT: retl
+;
+; X64-LABEL: test_mm_i32gather_epi32:
+; X64: ## BB#0:
+; X64-NEXT: vpcmpeqd %xmm2, %xmm2, %xmm2
+; X64-NEXT: vpxor %xmm1, %xmm1, %xmm1
+; X64-NEXT: vpgatherdd %xmm2, (%rdi,%xmm0,2), %xmm1
+; X64-NEXT: vmovdqa %xmm1, %xmm0
+; X64-NEXT: retq
+ %arg0 = bitcast i32 *%a0 to i8*
+ %arg1 = bitcast <2 x i64> %a1 to <4 x i32>
+ %mask = bitcast <2 x i64> <i64 -1, i64 -1> to <4 x i32>
+ %call = call <4 x i32> @llvm.x86.avx2.gather.d.d(<4 x i32> zeroinitializer, i8* %arg0, <4 x i32> %arg1, <4 x i32> %mask, i8 2)
+ %bc = bitcast <4 x i32> %call to <2 x i64>
+ ret <2 x i64> %bc
+}
+declare <4 x i32> @llvm.x86.avx2.gather.d.d(<4 x i32>, i8*, <4 x i32>, <4 x i32>, i8) nounwind readonly
+
+define <2 x double> @test_mm_i32gather_pd(double *%a0, <2 x i64> %a1) {
+; X32-LABEL: test_mm_i32gather_pd:
+; X32: ## BB#0:
+; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X32-NEXT: vxorpd %xmm1, %xmm1, %xmm1
+; X32-NEXT: vpcmpeqd %xmm2, %xmm2, %xmm2
+; X32-NEXT: vgatherdpd %xmm2, (%eax,%xmm0,2), %xmm1
+; X32-NEXT: vmovapd %xmm1, %xmm0
+; X32-NEXT: retl
+;
+; X64-LABEL: test_mm_i32gather_pd:
+; X64: ## BB#0:
+; X64-NEXT: vxorpd %xmm1, %xmm1, %xmm1
+; X64-NEXT: vpcmpeqd %xmm2, %xmm2, %xmm2
+; X64-NEXT: vgatherdpd %xmm2, (%rdi,%xmm0,2), %xmm1
+; X64-NEXT: vmovapd %xmm1, %xmm0
+; X64-NEXT: retq
+ %arg0 = bitcast double *%a0 to i8*
+ %arg1 = bitcast <2 x i64> %a1 to <4 x i32>
+ %cmp = fcmp oeq <2 x double> zeroinitializer, zeroinitializer
+ %sext = sext <2 x i1> %cmp to <2 x i64>
+ %mask = bitcast <2 x i64> %sext to <2 x double>
+ %res = call <2 x double> @llvm.x86.avx2.gather.d.pd(<2 x double> zeroinitializer, i8* %arg0, <4 x i32> %arg1, <2 x double> %mask, i8 2)
+ ret <2 x double> %res
+}
More information about the llvm-commits
mailing list