[llvm] 3e6d566 - [SLP][NFC]Add a test with reused buildvector node, being resized after
Alexey Bataev via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 13 11:07:41 PDT 2024
Author: Alexey Bataev
Date: 2024-03-13T11:02:18-07:00
New Revision: 3e6d56617f43f86d65dba04c94277dc4a40c2a86
URL: https://github.com/llvm/llvm-project/commit/3e6d56617f43f86d65dba04c94277dc4a40c2a86
DIFF: https://github.com/llvm/llvm-project/commit/3e6d56617f43f86d65dba04c94277dc4a40c2a86.diff
LOG: [SLP][NFC]Add a test with reused buildvector node, being resized after
minbitwidth analysis.
Added:
llvm/test/Transforms/SLPVectorizer/AArch64/gather-with-minbith-user.ll
Modified:
Removed:
################################################################################
diff --git a/llvm/test/Transforms/SLPVectorizer/AArch64/gather-with-minbith-user.ll b/llvm/test/Transforms/SLPVectorizer/AArch64/gather-with-minbith-user.ll
new file mode 100644
index 00000000000000..9566c00dd63006
--- /dev/null
+++ b/llvm/test/Transforms/SLPVectorizer/AArch64/gather-with-minbith-user.ll
@@ -0,0 +1,89 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
+; RUN: opt -S --passes=slp-vectorizer -mtriple=aarch64-unknown-linux-gnu < %s | FileCheck %s
+
+define void @h() {
+; CHECK-LABEL: define void @h() {
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[ARRAYIDX2:%.*]] = getelementptr i8, ptr null, i64 16
+; CHECK-NEXT: [[TMP0:%.*]] = sub <8 x i32> zeroinitializer, zeroinitializer
+; CHECK-NEXT: [[TMP1:%.*]] = add <8 x i32> zeroinitializer, zeroinitializer
+; CHECK-NEXT: [[TMP2:%.*]] = shufflevector <8 x i32> [[TMP0]], <8 x i32> [[TMP1]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 12, i32 13, i32 14, i32 15>
+; CHECK-NEXT: [[TMP3:%.*]] = or <8 x i32> [[TMP2]], zeroinitializer
+; CHECK-NEXT: [[TMP4:%.*]] = trunc <8 x i32> [[TMP3]] to <8 x i16>
+; CHECK-NEXT: store <8 x i16> [[TMP4]], ptr [[ARRAYIDX2]], align 2
+; CHECK-NEXT: ret void
+;
+entry:
+ %conv9 = zext i16 0 to i32
+ %arrayidx2 = getelementptr i8, ptr null, i64 16
+ %conv310 = zext i16 0 to i32
+ %add4 = add i32 %conv310, %conv9
+ %sub = sub i32 0, %conv310
+ %conv15 = sext i16 0 to i32
+ %shr = ashr i32 0, 0
+ %arrayidx18 = getelementptr i8, ptr null, i64 24
+ %conv19 = sext i16 0 to i32
+ %sub20 = sub i32 %shr, %conv19
+ %shr29 = ashr i32 0, 0
+ %add30 = add i32 %shr29, %conv15
+ %sub39 = or i32 %sub, %sub20
+ %conv40 = trunc i32 %sub39 to i16
+ store i16 %conv40, ptr %arrayidx2, align 2
+ %sub44 = or i32 %add4, %add30
+ %conv45 = trunc i32 %sub44 to i16
+ store i16 %conv45, ptr %arrayidx18, align 2
+ %arrayidx2.1 = getelementptr i8, ptr null, i64 18
+ %conv3.112 = zext i16 0 to i32
+ %add4.1 = add i32 %conv3.112, 0
+ %sub.1 = sub i32 0, %conv3.112
+ %conv15.1 = sext i16 0 to i32
+ %shr.1 = ashr i32 0, 0
+ %arrayidx18.1 = getelementptr i8, ptr null, i64 26
+ %conv19.1 = sext i16 0 to i32
+ %sub20.1 = sub i32 %shr.1, %conv19.1
+ %shr29.1 = ashr i32 0, 0
+ %add30.1 = add i32 %shr29.1, %conv15.1
+ %sub39.1 = or i32 %sub.1, %sub20.1
+ %conv40.1 = trunc i32 %sub39.1 to i16
+ store i16 %conv40.1, ptr %arrayidx2.1, align 2
+ %sub44.1 = or i32 %add4.1, %add30.1
+ %conv45.1 = trunc i32 %sub44.1 to i16
+ store i16 %conv45.1, ptr %arrayidx18.1, align 2
+ %conv.213 = zext i16 0 to i32
+ %arrayidx2.2 = getelementptr i8, ptr null, i64 20
+ %conv3.214 = zext i16 0 to i32
+ %add4.2 = add i32 0, %conv.213
+ %sub.2 = sub i32 0, %conv3.214
+ %conv15.2 = sext i16 0 to i32
+ %shr.2 = ashr i32 0, 0
+ %arrayidx18.2 = getelementptr i8, ptr null, i64 28
+ %conv19.2 = sext i16 0 to i32
+ %sub20.2 = sub i32 %shr.2, %conv19.2
+ %shr29.2 = ashr i32 0, 0
+ %add30.2 = add i32 %shr29.2, %conv15.2
+ %sub39.2 = or i32 %sub.2, %sub20.2
+ %conv40.2 = trunc i32 %sub39.2 to i16
+ store i16 %conv40.2, ptr %arrayidx2.2, align 2
+ %sub44.2 = or i32 %add4.2, %add30.2
+ %conv45.2 = trunc i32 %sub44.2 to i16
+ store i16 %conv45.2, ptr %arrayidx18.2, align 2
+ %conv.315 = zext i16 0 to i32
+ %arrayidx2.3 = getelementptr i8, ptr null, i64 22
+ %conv3.316 = zext i16 0 to i32
+ %add4.3 = add i32 0, %conv.315
+ %sub.3 = sub i32 0, %conv3.316
+ %conv15.3 = sext i16 0 to i32
+ %shr.3 = ashr i32 0, 0
+ %arrayidx18.3 = getelementptr i8, ptr null, i64 30
+ %conv19.3 = sext i16 0 to i32
+ %sub20.3 = sub i32 %shr.3, %conv19.3
+ %shr29.3 = ashr i32 0, 0
+ %add30.3 = add i32 %shr29.3, %conv15.3
+ %sub39.3 = or i32 %sub.3, %sub20.3
+ %conv40.3 = trunc i32 %sub39.3 to i16
+ store i16 %conv40.3, ptr %arrayidx2.3, align 2
+ %sub44.3 = or i32 %add4.3, %add30.3
+ %conv45.3 = trunc i32 %sub44.3 to i16
+ store i16 %conv45.3, ptr %arrayidx18.3, align 2
+ ret void
+}
More information about the llvm-commits
mailing list