[llvm] Widen rt stride loads (PR #162336)

via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 8 12:47:32 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 fad5d7f30..5e3a3c4eb 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -6971,8 +6971,9 @@ bool BoUpSLP::analyzeRtStrideCandidate(ArrayRef<Value *> PointerOps,
                                        Type *ElemTy, Align CommonAlignment,
                                        SmallVectorImpl<unsigned> &SortedIndices,
                                        StridedPtrInfo &SPtrInfo) const {
-  // If each value in `PointerOps` is of the form `%x + Offset` where `Offset` is constant
-  // for each offset we record values from `PointerOps` and their indicies in `PointerOps`.
+  // If each value in `PointerOps` is of the form `%x + Offset` where `Offset`
+  // is constant for each offset we record values from `PointerOps` and their
+  // indicies in `PointerOps`.
   SmallDenseMap<int64_t, std::pair<SmallVector<Value *>, SmallVector<unsigned>>>
       OffsetToPointerOpIdxMap;
   for (auto [Idx, Ptr] : enumerate(PointerOps)) {
@@ -7027,8 +7028,11 @@ bool BoUpSLP::analyzeRtStrideCandidate(ArrayRef<Value *> PointerOps,
     }
   }
 
-  // For the set of pointers with the same offset check that the distance between adjacent pointers are all equal to the same value (stride).
-  // As we do that, also calculate SortedIndices. Since we should not modify `SortedIndices` unless we know that all the checks succeede, record the indicies into `SortedIndicesDraft`.
+  // For the set of pointers with the same offset check that the distance
+  // between adjacent pointers are all equal to the same value (stride). As we
+  // do that, also calculate SortedIndices. Since we should not modify
+  // `SortedIndices` unless we know that all the checks succeede, record the
+  // indicies into `SortedIndicesDraft`.
   int64_t LowestOffset = SortedOffsetsV[0];
   SmallVector<Value *> &PointerOps0 =
       OffsetToPointerOpIdxMap[LowestOffset].first;
@@ -7054,7 +7058,8 @@ bool BoUpSLP::analyzeRtStrideCandidate(ArrayRef<Value *> PointerOps,
           const int64_t OffsetNum) {
         if (SortedIndicesForOffset.empty()) {
           SortedIndicesForOffset.resize(IndicesInAllPointerOps.size());
-          std::iota(SortedIndicesForOffset.begin(), SortedIndicesForOffset.end(), 0);
+          std::iota(SortedIndicesForOffset.begin(),
+                    SortedIndicesForOffset.end(), 0);
         }
         for (const auto [Num, Idx] : enumerate(SortedIndicesForOffset)) {
           SortedIndicesDraft[Num * NumOffsets + OffsetNum] =

``````````

</details>


https://github.com/llvm/llvm-project/pull/162336


More information about the llvm-commits mailing list