[llvm] 19a625a - [SLP][NFC]Add a test with incorrect size of the external user detection.

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 22 08:21:28 PDT 2024


Author: Alexey Bataev
Date: 2024-04-22T08:16:43-07:00
New Revision: 19a625a0a7798da030e8d2174a5a243aa565f644

URL: https://github.com/llvm/llvm-project/commit/19a625a0a7798da030e8d2174a5a243aa565f644
DIFF: https://github.com/llvm/llvm-project/commit/19a625a0a7798da030e8d2174a5a243aa565f644.diff

LOG: [SLP][NFC]Add a test with incorrect size of the external user detection.

Added: 
    llvm/test/Transforms/SLPVectorizer/AArch64/external-use-icmp.ll

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/SLPVectorizer/AArch64/external-use-icmp.ll b/llvm/test/Transforms/SLPVectorizer/AArch64/external-use-icmp.ll
new file mode 100644
index 00000000000000..19ef99e2b8402d
--- /dev/null
+++ b/llvm/test/Transforms/SLPVectorizer/AArch64/external-use-icmp.ll
@@ -0,0 +1,56 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
+; RUN: opt -S --passes=slp-vectorizer -mtriple=aarch64 -slp-threshold=-20 -slp-vectorize-hor=0 < %s | FileCheck %s
+
+define i16 @foo(i16 %in1, i16 %in2) {
+; CHECK-LABEL: define i16 @foo(
+; CHECK-SAME: i16 [[IN1:%.*]], i16 [[IN2:%.*]]) {
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    [[TMP0:%.*]] = insertelement <2 x i16> poison, i16 [[IN1]], i32 0
+; CHECK-NEXT:    [[TMP1:%.*]] = shufflevector <2 x i16> [[TMP0]], <2 x i16> poison, <2 x i32> zeroinitializer
+; CHECK-NEXT:    [[TMP2:%.*]] = insertelement <2 x i16> poison, i16 [[IN2]], i32 0
+; CHECK-NEXT:    [[TMP3:%.*]] = shufflevector <2 x i16> [[TMP2]], <2 x i16> poison, <2 x i32> zeroinitializer
+; CHECK-NEXT:    [[TMP4:%.*]] = mul <2 x i16> [[TMP3]], [[TMP1]]
+; CHECK-NEXT:    [[TMP5:%.*]] = and <2 x i16> [[TMP4]], <i16 -1, i16 -1>
+; CHECK-NEXT:    [[TMP6:%.*]] = zext <2 x i16> [[TMP5]] to <2 x i64>
+; CHECK-NEXT:    [[TMP7:%.*]] = icmp ne <2 x i64> [[TMP6]], <i64 65533, i64 65533>
+; CHECK-NEXT:    [[TMP8:%.*]] = extractelement <2 x i1> [[TMP7]], i32 1
+; CHECK-NEXT:    [[ZEXT3_1:%.*]] = zext i1 [[TMP8]] to i16
+; CHECK-NEXT:    [[TMP9:%.*]] = extractelement <2 x i16> [[TMP4]], i32 1
+; CHECK-NEXT:    [[TMP10:%.*]] = zext i16 [[TMP9]] to i64
+; CHECK-NEXT:    [[CMP2_1:%.*]] = icmp ne i64 [[TMP10]], 196605
+; CHECK-NEXT:    [[ZEXT4_1:%.*]] = zext i1 [[CMP2_1]] to i16
+; CHECK-NEXT:    [[ADD1:%.*]] = add nuw nsw i16 [[ZEXT3_1]], [[ZEXT4_1]]
+; CHECK-NEXT:    [[TMP11:%.*]] = extractelement <2 x i1> [[TMP7]], i32 0
+; CHECK-NEXT:    [[ZEXT3_2:%.*]] = zext i1 [[TMP11]] to i16
+; CHECK-NEXT:    [[TMP12:%.*]] = extractelement <2 x i16> [[TMP4]], i32 0
+; CHECK-NEXT:    [[TMP13:%.*]] = zext i16 [[TMP12]] to i64
+; CHECK-NEXT:    [[CMP2_2:%.*]] = icmp ne i64 [[TMP13]], 196605
+; CHECK-NEXT:    [[ZEXT4_2:%.*]] = zext i1 [[CMP2_2]] to i16
+; CHECK-NEXT:    [[ADD2:%.*]] = add nuw nsw i16 [[ADD1]], [[ZEXT4_2]]
+; CHECK-NEXT:    [[ADD3:%.*]] = add nuw nsw i16 [[ADD2]], [[ZEXT3_2]]
+; CHECK-NEXT:    ret i16 [[ADD3]]
+;
+entry:
+  %zext1_1 = zext i16 %in1 to i64
+  %zext2_1 = zext i16 %in2 to i64
+  %mul1 = mul nuw nsw i64 %zext2_1, %zext1_1
+  %and1 = and i64 %mul1, 65535
+  %cmp1_1 = icmp ne i64 %and1, 65533
+  %zext3_1 = zext i1 %cmp1_1 to i16
+  %cmp2_1 = icmp ne i64 %mul1, 196605
+  %zext4_1 = zext i1 %cmp2_1 to i16
+  %add1 = add nuw nsw i16 %zext3_1, %zext4_1
+  %zext1_2 = zext i16 %in1 to i64
+  %zext2_2 = zext i16 %in2 to i64
+  %mul2 = mul nuw nsw i64 %zext2_2, %zext1_2
+  %and2 = and i64 %mul2, 65535
+  %cmp1_2 = icmp ne i64 %and2, 65533
+  %zext3_2 = zext i1 %cmp1_2 to i16
+  %cmp2_2 = icmp ne i64 %mul2, 196605
+  %zext4_2 = zext i1 %cmp2_2 to i16
+  %add2 = add nuw nsw i16 %add1, %zext4_2
+  %add3 = add nuw nsw i16 %add2, %zext3_2
+  ret i16 %add3
+}
+
+


        


More information about the llvm-commits mailing list