[llvm] Analyze constant stride (PR #160411)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 23 15:49:42 PDT 2025
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 origin/main HEAD --extensions cpp -- llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</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 9f0278d44..0f35a0557 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -2235,9 +2235,10 @@ public:
/// may not be necessary.
bool isLoadCombineCandidate(ArrayRef<Value *> Stores) const;
bool isStridedLoad(ArrayRef<Value *> PointerOps, Type *ScalarTy,
- Align Alignment, int64_t Diff, size_t VecSz) const;
+ Align Alignment, int64_t Diff, size_t VecSz) const;
- /// Given a set of pointers, check if they can be rearranged as follows (%s is a constant):
+ /// Given a set of pointers, check if they can be rearranged as follows (%s is
+ /// a constant):
/// %b + 0 * %s + 0
/// %b + 0 * %s + 1
/// %b + 0 * %s + 2
@@ -2256,7 +2257,8 @@ public:
bool analyzeConstantStrideCandidate(ArrayRef<Value *> PointerOps,
Type *ElemTy, Align CommonAlignment,
SmallVectorImpl<unsigned> &SortedIndices,
- int64_t Diff, Value *Ptr0, Value *PtrN, StridedPtrInfo &SPtrInfo) const;
+ int64_t Diff, Value *Ptr0, Value *PtrN,
+ StridedPtrInfo &SPtrInfo) const;
/// Checks if the given array of loads can be represented as a vectorized,
/// scatter or just simple gather.
@@ -6863,10 +6865,9 @@ bool BoUpSLP::isStridedLoad(ArrayRef<Value *> PointerOps, Type *ScalarTy,
}
bool BoUpSLP::analyzeConstantStrideCandidate(
-ArrayRef<Value *> PointerOps,
- Type *ElemTy, Align CommonAlignment,
- SmallVectorImpl<unsigned> &SortedIndices,
- int64_t Diff, Value *Ptr0, Value *PtrN, StridedPtrInfo &SPtrInfo) const {
+ ArrayRef<Value *> PointerOps, Type *ElemTy, Align CommonAlignment,
+ SmallVectorImpl<unsigned> &SortedIndices, int64_t Diff, Value *Ptr0,
+ Value *PtrN, StridedPtrInfo &SPtrInfo) const {
const unsigned Sz = PointerOps.size();
SmallVector<int64_t> SortedOffsetsFromBase;
SortedOffsetsFromBase.resize(Sz);
``````````
</details>
https://github.com/llvm/llvm-project/pull/160411
More information about the llvm-commits
mailing list