[llvm] 5db7568 - [SLP][NFC]Add a test for poison-free or reduction.
Alexey Bataev via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 26 14:06:28 PDT 2021
Author: Alexey Bataev
Date: 2021-10-26T14:04:05-07:00
New Revision: 5db7568a6a1fcb408eb8988abdaff2a225a8eb72
URL: https://github.com/llvm/llvm-project/commit/5db7568a6a1fcb408eb8988abdaff2a225a8eb72
DIFF: https://github.com/llvm/llvm-project/commit/5db7568a6a1fcb408eb8988abdaff2a225a8eb72.diff
LOG: [SLP][NFC]Add a test for poison-free or reduction.
Added:
Modified:
llvm/test/Transforms/SLPVectorizer/X86/reduction-logical.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/SLPVectorizer/X86/reduction-logical.ll b/llvm/test/Transforms/SLPVectorizer/X86/reduction-logical.ll
index 18c05390c4c9..b167cfdafb58 100644
--- a/llvm/test/Transforms/SLPVectorizer/X86/reduction-logical.ll
+++ b/llvm/test/Transforms/SLPVectorizer/X86/reduction-logical.ll
@@ -502,3 +502,32 @@ define i1 @logical_and_icmp_extra_op(<4 x i32> %x, <4 x i32> %y, i1 %c) {
%s7 = select i1 %s6, i1 %d3, i1 false
ret i1 %s7
}
+
+define i1 @logical_or_icmp_extra_op(<4 x i32> %x, <4 x i32> %y, i1 %c) {
+; CHECK-LABEL: @logical_or_icmp_extra_op(
+; CHECK-NEXT: [[TMP1:%.*]] = icmp slt <4 x i32> [[X:%.*]], [[Y:%.*]]
+; CHECK-NEXT: [[S3:%.*]] = select i1 [[C:%.*]], i1 true, i1 [[C]]
+; CHECK-NEXT: [[TMP2:%.*]] = freeze <4 x i1> [[TMP1]]
+; CHECK-NEXT: [[TMP3:%.*]] = call i1 @llvm.vector.reduce.or.v4i1(<4 x i1> [[TMP2]])
+; CHECK-NEXT: [[OP_EXTRA:%.*]] = or i1 [[TMP3]], [[S3]]
+; CHECK-NEXT: ret i1 [[OP_EXTRA]]
+;
+ %x0 = extractelement <4 x i32> %x, i32 0
+ %x1 = extractelement <4 x i32> %x, i32 1
+ %x2 = extractelement <4 x i32> %x, i32 2
+ %x3 = extractelement <4 x i32> %x, i32 3
+ %y0 = extractelement <4 x i32> %y, i32 0
+ %y1 = extractelement <4 x i32> %y, i32 1
+ %y2 = extractelement <4 x i32> %y, i32 2
+ %y3 = extractelement <4 x i32> %y, i32 3
+ %d0 = icmp slt i32 %x0, %y0
+ %d1 = icmp slt i32 %x1, %y1
+ %d2 = icmp slt i32 %x2, %y2
+ %d3 = icmp slt i32 %x3, %y3
+ %s3 = select i1 %c, i1 true, i1 %c
+ %s4 = select i1 %s3, i1 true, i1 %d0
+ %s5 = select i1 %s4, i1 true, i1 %d1
+ %s6 = select i1 %s5, i1 true, i1 %d2
+ %s7 = select i1 %s6, i1 true, i1 %d3
+ ret i1 %s7
+}
More information about the llvm-commits
mailing list