Skip to content

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
@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