Skip to content

[SLP] Use poison instead of undef in reorderScalars() #96619

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
Jun 25, 2024

Conversation

nikic
Copy link
Contributor

@nikic nikic commented Jun 25, 2024

-1 mask elements are specified to return poison rather than undef nowadays , so update the reorderScalars() implementation to match.

This doesn't cause any actual test changes. Putting up a PR for this just in case there is some SLP-specific divergence I'm not aware of.

-1 mask elements are specified to return poison rather than undef
nowadays , so update the reorderScalars() implementation to match.

Putting up a PR for this just in case there is some SLP-specific
divergence I'm not aware of.
@llvmbot
Copy link
Member

llvmbot commented Jun 25, 2024

@llvm/pr-subscribers-llvm-transforms

Author: Nikita Popov (nikic)

Changes

-1 mask elements are specified to return poison rather than undef nowadays , so update the reorderScalars() implementation to match.

This doesn't cause any actual test changes. Putting up a PR for this just in case there is some SLP-specific divergence I'm not aware of.


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

1 Files Affected:

  • (modified) llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp (+1-1)
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index 501f6afd60607..494db0493daca 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -999,7 +999,7 @@ static void reorderScalars(SmallVectorImpl<Value *> &Scalars,
                            ArrayRef<int> Mask) {
   assert(!Mask.empty() && "Expected non-empty mask.");
   SmallVector<Value *> Prev(Scalars.size(),
-                            UndefValue::get(Scalars.front()->getType()));
+                            PoisonValue::get(Scalars.front()->getType()));
   Prev.swap(Scalars);
   for (unsigned I = 0, E = Prev.size(); I < E; ++I)
     if (Mask[I] != PoisonMaskElem)

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

@nikic nikic merged commit 8263bec into llvm:main Jun 25, 2024
8 of 9 checks passed
@nikic nikic deleted the slp-reorder branch June 25, 2024 12:23
AlexisPerry pushed a commit to llvm-project-tlp/llvm-project that referenced this pull request Jul 9, 2024
-1 mask elements are specified to return poison rather than undef
nowadays , so update the reorderScalars() implementation to match.
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