[llvm-branch-commits] [llvm] d0b1a58 - Address comments
Alexis Engelke via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Aug 13 00:51:00 PDT 2024
Author: Alexis Engelke
Date: 2024-08-13T07:50:05Z
New Revision: d0b1a582fd33e8c3605c027883c6deb35757f560
URL: https://github.com/llvm/llvm-project/commit/d0b1a582fd33e8c3605c027883c6deb35757f560
DIFF: https://github.com/llvm/llvm-project/commit/d0b1a582fd33e8c3605c027883c6deb35757f560.diff
LOG: Address comments
Added:
Modified:
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index 91e180f9eea13c..edacb2fb33540f 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -5991,6 +5991,9 @@ BoUpSLP::collectUserStores(const BoUpSLP::TreeEntry *TE) const {
DenseMap<Value *, SmallVector<StoreInst *>> PtrToStoresMap;
for (unsigned Lane : seq<unsigned>(0, TE->Scalars.size())) {
Value *V = TE->Scalars[Lane];
+ // Don't iterate over the users of constant data.
+ if (isa<ConstantData>(V))
+ continue;
// To save compilation time we don't visit if we have too many users.
if (V->hasNUsesOrMore(UsesLimit))
break;
@@ -5998,8 +6001,8 @@ BoUpSLP::collectUserStores(const BoUpSLP::TreeEntry *TE) const {
// Collect stores per pointer object.
for (User *U : V->users()) {
auto *SI = dyn_cast<StoreInst>(U);
- // Test whether we can handle the store. If V is a constant, its users
- // might be in
diff erent functions.
+ // Test whether we can handle the store. V might be a global, which could
+ // be used in a
diff erent function.
if (SI == nullptr || !SI->isSimple() || SI->getFunction() != F ||
!isValidElementType(SI->getValueOperand()->getType()))
continue;
More information about the llvm-branch-commits
mailing list