[llvm] d6b5b98 - [SLP][NFC] Add a new test for store chains that mix different sizes of values (#101979)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 5 10:11:41 PDT 2024
Author: tcwzxx
Date: 2024-08-05T13:11:38-04:00
New Revision: d6b5b98f5568f90950020af577fc1fb48b775b74
URL: https://github.com/llvm/llvm-project/commit/d6b5b98f5568f90950020af577fc1fb48b775b74
DIFF: https://github.com/llvm/llvm-project/commit/d6b5b98f5568f90950020af577fc1fb48b775b74.diff
LOG: [SLP][NFC] Add a new test for store chains that mix different sizes of values (#101979)
Added:
llvm/test/Transforms/SLPVectorizer/X86/stores_mix_sizes.ll
Modified:
Removed:
################################################################################
diff --git a/llvm/test/Transforms/SLPVectorizer/X86/stores_mix_sizes.ll b/llvm/test/Transforms/SLPVectorizer/X86/stores_mix_sizes.ll
new file mode 100644
index 0000000000000..1e2a87b12807c
--- /dev/null
+++ b/llvm/test/Transforms/SLPVectorizer/X86/stores_mix_sizes.ll
@@ -0,0 +1,41 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
+; RUN: opt -S --passes=slp-vectorizer -mtriple=x86_64-unknown-linux < %s | FileCheck %s
+define void @test(ptr %p) {
+; CHECK-LABEL: define void @test(
+; CHECK-SAME: ptr [[P:%.*]]) {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: [[IDX1:%.*]] = getelementptr i8, ptr [[P]], i64 1
+; CHECK-NEXT: store i8 0, ptr [[IDX1]], align 4
+; CHECK-NEXT: [[IDX_64_9:%.*]] = getelementptr i64, ptr [[P]], i64 9
+; CHECK-NEXT: store i64 1, ptr [[IDX_64_9]], align 8
+; CHECK-NEXT: [[IDX2:%.*]] = getelementptr i8, ptr [[P]], i64 2
+; CHECK-NEXT: store <4 x i8> zeroinitializer, ptr [[IDX2]], align 4
+; CHECK-NEXT: [[IDX6:%.*]] = getelementptr i8, ptr [[P]], i64 6
+; CHECK-NEXT: store i8 0, ptr [[IDX6]], align 4
+; CHECK-NEXT: [[IDX7:%.*]] = getelementptr i8, ptr [[P]], i64 7
+; CHECK-NEXT: store i8 0, ptr [[IDX7]], align 4
+; CHECK-NEXT: [[IDX8:%.*]] = getelementptr i8, ptr [[P]], i64 8
+; CHECK-NEXT: store i8 0, ptr [[IDX8]], align 4
+; CHECK-NEXT: ret void
+;
+ entry:
+ %idx1 = getelementptr i8, ptr %p, i64 1
+ store i8 0, ptr %idx1, align 4
+ %idx.64.9 = getelementptr i64, ptr %p, i64 9
+ store i64 1, ptr %idx.64.9, align 8
+ %idx2 = getelementptr i8, ptr %p, i64 2
+ store i8 0, ptr %idx2, align 4
+ %idx3 = getelementptr i8, ptr %p, i64 3
+ store i8 0, ptr %idx3, align 4
+ %idx4 = getelementptr i8, ptr %p, i64 4
+ store i8 0, ptr %idx4, align 4
+ %idx5 = getelementptr i8, ptr %p, i64 5
+ store i8 0, ptr %idx5, align 4
+ %idx6 = getelementptr i8, ptr %p, i64 6
+ store i8 0, ptr %idx6, align 4
+ %idx7 = getelementptr i8, ptr %p, i64 7
+ store i8 0, ptr %idx7, align 4
+ %idx8 = getelementptr i8, ptr %p, i64 8
+ store i8 0, ptr %idx8, align 4
+ ret void
+}
More information about the llvm-commits
mailing list