[PATCH] D94713: Do not traverse ConstantData use-list in SLPVectorizer
Anton Rapetov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 18 17:31:34 PST 2021
willir updated this revision to Diff 317441.
willir added a comment.
Ignore all Constants, not just ConstantData
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D94713/new/
https://reviews.llvm.org/D94713
Files:
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
Index: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
===================================================================
--- llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -986,6 +986,14 @@
std::array<std::pair<Value *, int>, 2> Values = {{LHS, RHS}};
for (int Idx = 0, IdxE = Values.size(); Idx != IdxE; ++Idx) {
Value *V = Values[Idx].first;
+ if (isa<Constant>(V)) {
+ // Since this is a function pass, it doesn't make semantic sense to
+ // walk the users of a subclass of Constant. The users could be in
+ // another function, or even another module that happens to be in
+ // the same LLVMContext.
+ continue;
+ }
+
// Calculate the absolute lane, using the minimum relative lane of LHS
// and RHS as base and Idx as the offset.
int Ln = std::min(LHS.second, RHS.second) + Idx;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94713.317441.patch
Type: text/x-patch
Size: 951 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210119/2f062092/attachment.bin>
More information about the llvm-commits
mailing list