[llvm] [SLPVectorizer][NFC] Refactor `canVectorizeLoads`. (PR #157911)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 16 10:52:36 PDT 2025


================
@@ -6956,18 +6980,9 @@ BoUpSLP::LoadsState BoUpSLP::canVectorizeLoads(
                                    cast<Instruction>(V), UserIgnoreList);
                              }))
       return LoadsState::CompressVectorize;
-    // Simple check if not a strided access - clear order.
-    bool IsPossibleStrided = *Diff % (Sz - 1) == 0;
-    // Try to generate strided load node.
-    auto IsAnyPointerUsedOutGraph =
-        IsPossibleStrided && any_of(PointerOps, [&](Value *V) {
-          return isa<Instruction>(V) && any_of(V->users(), [&](User *U) {
-                   return !isVectorized(U) && !MustGather.contains(U);
-                 });
-        });
-    if (IsPossibleStrided &&
-        isStridedLoad(VL, PointerOps, Order, *TTI, *DL, *SE,
-                      IsAnyPointerUsedOutGraph, *Diff, SPtrInfo))
----------------
alexey-bataev wrote:

Can you move this code (and other code movements) in separate NFC patch(es)?

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


More information about the llvm-commits mailing list