[llvm] [SLP] Create SLP trees starting from constant stride stores (PR #185964)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 8 13:01:12 PDT 2026


================
@@ -10696,11 +10715,16 @@ BoUpSLP::TreeEntry::EntryState BoUpSLP::getScalarsVectorizationState(
         Ptr0 = PointerOps[CurrentOrder.front()];
         PtrN = PointerOps[CurrentOrder.back()];
       }
+      Align CommonAlignment = computeCommonAlignment<StoreInst>(VL0);
       std::optional<int64_t> Dist =
           getPointersDiff(ScalarTy, Ptr0, ScalarTy, PtrN, *DL, *SE);
       // Check that the sorted pointer operands are consecutive.
       if (static_cast<uint64_t>(*Dist) == VL.size() - 1)
         return TreeEntry::Vectorize;
+      if (analyzeConstantStrideCandidate(PointerOps, ScalarTy, CommonAlignment,
+                                         CurrentOrder, *Dist, Ptr0, PtrN,
+                                         SPtrInfo))
+        return TreeEntry::StridedVectorize;
----------------
alexey-bataev wrote:

```suggestion
      if (EnableStridedStores && analyzeConstantStrideCandidate(PointerOps, ScalarTy, CommonAlignment,
                                         CurrentOrder, *Dist, Ptr0, PtrN,
                                         SPtrInfo))
        return TreeEntry::StridedVectorize;
```

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


More information about the llvm-commits mailing list