summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2018-01-27 23:49:11 +0000
committerCraig Topper <craig.topper@intel.com>2018-01-27 23:49:11 +0000
commit540daee124df778764e7a610d3b38fac85e12efb (patch)
treeff3252fc90406987e901e017097cfc3f3b372c4c
parent6e36f8250c1768016befb1ea81464b121290a254 (diff)
downloadbcm5719-llvm-540daee124df778764e7a610d3b38fac85e12efb.tar.gz
bcm5719-llvm-540daee124df778764e7a610d3b38fac85e12efb.zip
[X86] Add test to demonstrate missed opportunity to merge kand into testnm when using 512-bit instruction due to lack of VLX.
llvm-svn: 323609
-rw-r--r--llvm/test/CodeGen/X86/avx512vl-vec-cmp.ll27
1 files changed, 27 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/avx512vl-vec-cmp.ll b/llvm/test/CodeGen/X86/avx512vl-vec-cmp.ll
index ee95e1ea46d..82c1054a980 100644
--- a/llvm/test/CodeGen/X86/avx512vl-vec-cmp.ll
+++ b/llvm/test/CodeGen/X86/avx512vl-vec-cmp.ll
@@ -1119,3 +1119,30 @@ define <4 x i32> @test128_20(<4 x i32> %x, <4 x i32> %x1, <4 x i32>* %y.ptr) nou
%max = select <4 x i1> %mask, <4 x i32> %x, <4 x i32> %x1
ret <4 x i32> %max
}
+
+define <8 x i32> @testnm_and(<8 x i32> %a, <8 x i32> %b, <8 x i32> %x, <8 x i32> %y) {
+; VLX-LABEL: testnm_and:
+; VLX: # %bb.0:
+; VLX-NEXT: vpor %ymm1, %ymm0, %ymm0
+; VLX-NEXT: vptestnmd %ymm0, %ymm0, %k1
+; VLX-NEXT: vpblendmd %ymm2, %ymm3, %ymm0 {%k1}
+; VLX-NEXT: retq
+;
+; NoVLX-LABEL: testnm_and:
+; NoVLX: # %bb.0:
+; NoVLX-NEXT: # kill: def %ymm3 killed %ymm3 def %zmm3
+; NoVLX-NEXT: # kill: def %ymm2 killed %ymm2 def %zmm2
+; NoVLX-NEXT: # kill: def %ymm1 killed %ymm1 def %zmm1
+; NoVLX-NEXT: # kill: def %ymm0 killed %ymm0 def %zmm0
+; NoVLX-NEXT: vptestnmd %zmm0, %zmm0, %k0
+; NoVLX-NEXT: vptestnmd %zmm1, %zmm1, %k1
+; NoVLX-NEXT: kandw %k1, %k0, %k1
+; NoVLX-NEXT: vpblendmd %zmm2, %zmm3, %zmm0 {%k1}
+; NoVLX-NEXT: # kill: def %ymm0 killed %ymm0 killed %zmm0
+; NoVLX-NEXT: retq
+ %c = icmp eq <8 x i32> %a, zeroinitializer
+ %d = icmp eq <8 x i32> %b, zeroinitializer
+ %e = and <8 x i1> %c, %d
+ %z = select <8 x i1> %e, <8 x i32> %x, <8 x i32> %y
+ ret <8 x i32> %z
+}
OpenPOWER on IntegriCloud