[llvm] d34d2ec - [X86][SSE] Add original PR38522 test case
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Sat Mar 28 04:54:13 PDT 2020
Author: Simon Pilgrim
Date: 2020-03-28T10:56:57Z
New Revision: d34d2ec28be1e80adb4e033f44b88acb289817cd
URL: https://github.com/llvm/llvm-project/commit/d34d2ec28be1e80adb4e033f44b88acb289817cd
DIFF: https://github.com/llvm/llvm-project/commit/d34d2ec28be1e80adb4e033f44b88acb289817cd.diff
LOG: [X86][SSE] Add original PR38522 test case
Added:
Modified:
llvm/test/CodeGen/X86/combine-ptest.ll
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/X86/combine-ptest.ll b/llvm/test/CodeGen/X86/combine-ptest.ll
index 30950448007f..d27e179da689 100644
--- a/llvm/test/CodeGen/X86/combine-ptest.ll
+++ b/llvm/test/CodeGen/X86/combine-ptest.ll
@@ -103,6 +103,27 @@ define i32 @ptestnzc_256_invert(<4 x i64> %c, i32 %a, i32 %b) {
ret i32 %t4
}
+define zeroext i1 @PR38522(<16 x i8>* %x, <16 x i8>* %y) {
+; CHECK-LABEL: PR38522:
+; CHECK: # %bb.0: # %start
+; CHECK-NEXT: vmovdqa (%rdi), %xmm0
+; CHECK-NEXT: vpcmpgtb (%rsi), %xmm0, %xmm0
+; CHECK-NEXT: vpcmpeqd %xmm1, %xmm1, %xmm1
+; CHECK-NEXT: vpxor %xmm1, %xmm0, %xmm0
+; CHECK-NEXT: vptest %xmm1, %xmm0
+; CHECK-NEXT: setb %al
+; CHECK-NEXT: retq
+start:
+ %0 = load <16 x i8>, <16 x i8>* %x, align 16
+ %1 = load <16 x i8>, <16 x i8>* %y, align 16
+ %2 = icmp sle <16 x i8> %0, %1
+ %3 = sext <16 x i1> %2 to <16 x i8>
+ %4 = bitcast <16 x i8> %3 to <2 x i64>
+ %5 = tail call i32 @llvm.x86.sse41.ptestc(<2 x i64> %4, <2 x i64> <i64 -1, i64 -1>)
+ %6 = icmp eq i32 %5, 1
+ ret i1 %6
+}
+
declare i32 @llvm.x86.sse41.ptestz(<2 x i64>, <2 x i64>) nounwind readnone
declare i32 @llvm.x86.sse41.ptestc(<2 x i64>, <2 x i64>) nounwind readnone
declare i32 @llvm.x86.sse41.ptestnzc(<2 x i64>, <2 x i64>) nounwind readnone
More information about the llvm-commits
mailing list