Skip to content

[SLP][NFC] Add a new test for store chains that mix different sizes of values #101979

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 5, 2024

Conversation

tcwzxx
Copy link
Member

@tcwzxx tcwzxx commented Aug 5, 2024

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Aug 5, 2024

@llvm/pr-subscribers-llvm-transforms

Author: tcwzxx (tcwzxx)

Changes

Add a new test case for PR #101810


Full diff: https://github.com/llvm/llvm-project/pull/101979.diff

1 Files Affected:

  • (added) llvm/test/Transforms/SLPVectorizer/X86/stores_mix_sizes.ll (+34)
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..c571372e40d16
--- /dev/null
+++ b/llvm/test/Transforms/SLPVectorizer/X86/stores_mix_sizes.ll
@@ -0,0 +1,34 @@
+; 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:    [[IDX_64_9:%.*]] = getelementptr i64, ptr [[P]], i64 9
+; CHECK-NEXT:    store i64 1, ptr [[IDX_64_9]], align 8
+; CHECK-NEXT:    store <8 x i8> zeroinitializer, ptr [[IDX1]], 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
+}

; CHECK-NEXT: [[IDX1:%.*]] = getelementptr i8, ptr [[P]], i64 1
; CHECK-NEXT: [[IDX_64_9:%.*]] = getelementptr i64, ptr [[P]], i64 9
; CHECK-NEXT: store i64 1, ptr [[IDX_64_9]], align 8
; CHECK-NEXT: store <8 x i8> zeroinitializer, ptr [[IDX1]], align 4
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The check must be formed with the current version of the compiler. If it is vectorized already, your patch does nothing.

Copy link
Member Author

@tcwzxx tcwzxx Aug 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check is generated after the patch, so is the correct process to add a current version of the compiler test case (NFC) and then update this test case in the patch?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@tcwzxx tcwzxx force-pushed the slp-new-test-case branch from 70e73af to 38bfcff Compare August 5, 2024 16:53
Copy link
Member

@alexey-bataev alexey-bataev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG

@tcwzxx
Copy link
Member Author

tcwzxx commented Aug 5, 2024

LG

Could you help me merge it?

@alexey-bataev alexey-bataev merged commit d6b5b98 into llvm:main Aug 5, 2024
4 of 6 checks passed
@tcwzxx tcwzxx deleted the slp-new-test-case branch August 17, 2024 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants