-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[SLP][REVEC] Fix false assumption of the source for castToScalarTyElem. #99424
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
Conversation
@llvm/pr-subscribers-llvm-transforms Author: Han-Kuan Chen (HanKuanChen) ChangesThe argument V may come from adjustExtracts, which is the vector operand of ExtractElementInst. In addition, it is not existed in getTreeEntry. The vector operand of ExtractElementInst may have a type of <1 x Ty>, ensuring that the number of elements in ScalarTy and VecTy are equal. reference: #99411 Full diff: https://github.com/llvm/llvm-project/pull/99424.diff 1 Files Affected:
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index ccb6734d5618c..a09bb00f3419e 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -11850,7 +11850,7 @@ class BoUpSLP::ShuffleInstructionBuilder final : public BaseShuffleAnalysis {
Value *castToScalarTyElem(Value *V,
std::optional<bool> IsSigned = std::nullopt) {
auto *VecTy = cast<VectorType>(V->getType());
- assert(getNumElements(ScalarTy) < getNumElements(VecTy) &&
+ assert(getNumElements(ScalarTy) <= getNumElements(VecTy) &&
(getNumElements(VecTy) % getNumElements(ScalarTy) == 0));
if (VecTy->getElementType() == ScalarTy->getScalarType())
return V;
|
20d17f5
to
049e1cc
Compare
Should we add either or both of the crashing examples as tests? |
The argument V may come from adjustExtracts, which is the vector operand of ExtractElementInst. In addition, it is not existed in getTreeEntry. The vector operand of ExtractElementInst may have a type of <1 x Ty>, ensuring that the number of elements in ScalarTy and VecTy are equal. reference: llvm#99411
049e1cc
to
79d1708
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LG
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/190/builds/2111 Here is the relevant piece of the build log for the reference:
|
@HanKuanChen the test you added is failing on at least one buildbot, see the message above (I happen to manage that build bot). Can you take a look so that I don't have to revert your change? |
looks good for me, aside from the test issue |
…m. (#99424) Summary: The argument V may come from adjustExtracts, which is the vector operand of ExtractElementInst. In addition, it is not existed in getTreeEntry. The vector operand of ExtractElementInst may have a type of <1 x Ty>, ensuring that the number of elements in ScalarTy and VecTy are equal. reference: #99411 Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: https://phabricator.intern.facebook.com/D60250836
The argument V may come from adjustExtracts, which is the vector operand of ExtractElementInst. In addition, it is not existed in getTreeEntry.
The vector operand of ExtractElementInst may have a type of <1 x Ty>, ensuring that the number of elements in ScalarTy and VecTy are equal.
reference: #99411