[llvm] 8ba8cf2 - [SLP][NFC]Add a test for logical reduction with extra op.
Alexey Bataev via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 26 10:14:47 PDT 2021
Author: Alexey Bataev
Date: 2021-10-26T10:14:20-07:00
New Revision: 8ba8cf24f77f9b16002e5088d834981d569daeaa
URL: https://github.com/llvm/llvm-project/commit/8ba8cf24f77f9b16002e5088d834981d569daeaa
DIFF: https://github.com/llvm/llvm-project/commit/8ba8cf24f77f9b16002e5088d834981d569daeaa.diff
LOG: [SLP][NFC]Add a test for logical reduction with extra op.
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 3e794b452ff03..18c05390c4c98 100644
--- a/llvm/test/Transforms/SLPVectorizer/X86/reduction-logical.ll
+++ b/llvm/test/Transforms/SLPVectorizer/X86/reduction-logical.ll
@@ -473,3 +473,32 @@ define i1 @logical_and_icmp_clamp_pred_
diff (<4 x i32> %x) {
%s7 = select i1 %s6, i1 %d3, i1 false
ret i1 %s7
}
+
+define i1 @logical_and_icmp_extra_op(<4 x i32> %x, <4 x i32> %y, i1 %c) {
+; CHECK-LABEL: @logical_and_icmp_extra_op(
+; CHECK-NEXT: [[TMP1:%.*]] = icmp slt <4 x i32> [[X:%.*]], [[Y:%.*]]
+; CHECK-NEXT: [[S3:%.*]] = select i1 [[C:%.*]], i1 [[C]], i1 false
+; CHECK-NEXT: [[TMP2:%.*]] = freeze <4 x i1> [[TMP1]]
+; CHECK-NEXT: [[TMP3:%.*]] = call i1 @llvm.vector.reduce.and.v4i1(<4 x i1> [[TMP2]])
+; CHECK-NEXT: [[OP_EXTRA:%.*]] = and 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 %c, i1 false
+ %s4 = select i1 %s3, i1 %d0, i1 false
+ %s5 = select i1 %s4, i1 %d1, i1 false
+ %s6 = select i1 %s5, i1 %d2, i1 false
+ %s7 = select i1 %s6, i1 %d3, i1 false
+ ret i1 %s7
+}
More information about the llvm-commits
mailing list