diff options
author | Craig Topper <craig.topper@intel.com> | 2019-08-19 00:39:18 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@intel.com> | 2019-08-19 00:39:18 +0000 |
commit | c9ee4c7c2207e48c5afaf4de7e2cb241a6837681 (patch) | |
tree | c5dca58c4a7ebcc51a6bc9b28b024fc407dd0f13 | |
parent | 2ee46c7c4be1be5fa48af39232f62cf26d742efa (diff) | |
download | bcm5719-llvm-c9ee4c7c2207e48c5afaf4de7e2cb241a6837681.tar.gz bcm5719-llvm-c9ee4c7c2207e48c5afaf4de7e2cb241a6837681.zip |
[X86] Add test case for missed opportunity to recognize a vXi1 shuffle as an insert into a zero vector.
We are currently missing this because shuffle canonicalization
puts the zero vector as V1 and the subvector as V2. Our current
code doesn't recognize this case.
llvm-svn: 369225
-rw-r--r-- | llvm/test/CodeGen/X86/avx512-skx-insert-subvec.ll | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/avx512-skx-insert-subvec.ll b/llvm/test/CodeGen/X86/avx512-skx-insert-subvec.ll index 5ed2ef5fa50..76c983e6708 100644 --- a/llvm/test/CodeGen/X86/avx512-skx-insert-subvec.ll +++ b/llvm/test/CodeGen/X86/avx512-skx-insert-subvec.ll @@ -199,3 +199,21 @@ define <64 x i1> @test14(<2 x i1> %a) { %res = shufflevector <2 x i1> %a, <2 x i1> zeroinitializer, <64 x i32> <i32 2, i32 3, i32 2, i32 3, i32 2, i32 3, i32 2, i32 3, i32 2, i32 3, i32 0, i32 1, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef> ret <64 x i1> %res } + +; Make sure we can recognize this shuffle as an insertion in to a zero vector. +define i8 @test15(<2 x i64> %x) { +; CHECK-LABEL: test15: +; CHECK: # %bb.0: +; CHECK-NEXT: vptestnmq %xmm0, %xmm0, %k0 +; CHECK-NEXT: vpmovm2d %k0, %ymm0 +; CHECK-NEXT: vmovq {{.*#+}} xmm0 = xmm0[0],zero +; CHECK-NEXT: vpmovd2m %ymm0, %k0 +; CHECK-NEXT: kmovd %k0, %eax +; CHECK-NEXT: # kill: def $al killed $al killed $eax +; CHECK-NEXT: vzeroupper +; CHECK-NEXT: retq + %a = icmp eq <2 x i64> %x, zeroinitializer + %b = shufflevector <2 x i1> %a, <2 x i1> <i1 false, i1 undef>, <8 x i32> <i32 0, i32 1, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2> + %c = bitcast <8 x i1> %b to i8 + ret i8 %c +} |