[llvm] [SLP]Improve vectorization of gathered loads. (PR #89129)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 17 12:49:01 PDT 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff d423d80e560d8bf7ca493596d9f34a9e1f0eede7 00d7fe551ea4ba71f572d2f8c211977df101a16a -- llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index 6730d0c4db..5a5dc76a79 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -5618,8 +5618,7 @@ void BoUpSLP::reorderBottomToTop(bool IgnoreReorder) {
if (CurrentEntry->getOpcode() == Instruction::Call) {
auto *CI = cast<CallInst>(CurrentEntry->getMainOp());
Intrinsic::ID ID = getVectorIntrinsicIDForCall(CI, TLI);
- if (I >= CI->arg_size() ||
- isVectorIntrinsicWithScalarOpAtArg(ID, I))
+ if (I >= CI->arg_size() || isVectorIntrinsicWithScalarOpAtArg(ID, I))
continue;
}
const TreeEntry *Op = getOperandEntry(CurrentEntry, I);
@@ -6066,9 +6065,10 @@ void BoUpSLP::tryToVectorizeGatheredLoads() {
return L1.second > L2.second;
};
- auto GetVectorizedRanges = [this](ArrayRef<LoadInst *> Loads,
- BoUpSLP::ValueSet &VectorizedLoads,
- SmallVectorImpl<LoadInst *> &NonVectorized) {
+ auto GetVectorizedRanges = [this](
+ ArrayRef<LoadInst *> Loads,
+ BoUpSLP::ValueSet &VectorizedLoads,
+ SmallVectorImpl<LoadInst *> &NonVectorized) {
SmallVector<std::pair<ArrayRef<Value *>, LoadsState>> Results;
unsigned StartIdx = 0;
SmallVector<int> CandidateVFs;
@@ -13634,9 +13634,9 @@ Value *BoUpSLP::vectorizeTree(
// gathered loads.
for (const std::unique_ptr<TreeEntry> &TE : VectorizableTree) {
if (GatheredLoadsEntriesFirst != NoGatheredLoads &&
- TE->Idx >= GatheredLoadsEntriesFirst &&
- (TE->State != TreeEntry::NeedToGather ||
- !TE->UserTreeIndices.empty())) {
+ TE->Idx >= GatheredLoadsEntriesFirst &&
+ (TE->State != TreeEntry::NeedToGather ||
+ !TE->UserTreeIndices.empty())) {
assert((!TE->UserTreeIndices.empty() ||
(TE->getOpcode() == Instruction::Load &&
TE->State != TreeEntry::NeedToGather)) &&
``````````
</details>
https://github.com/llvm/llvm-project/pull/89129
More information about the llvm-commits
mailing list