[llvm] [SLPVectorizer] Move size checks (NFC). (PR #161867)

Mikhail Gudim via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 7 09:57:02 PDT 2025


================
@@ -6875,6 +6880,26 @@ bool BoUpSLP::isStridedLoad(ArrayRef<Value *> PointerOps, Type *ScalarTy,
   return false;
 }
 
+bool BoUpSLP::analyzeRtStrideCandidate(ArrayRef<Value *> PointerOps,
+                                       Type *ScalarTy, Align CommonAlignment,
+                                       SmallVectorImpl<unsigned> &SortedIndices,
+                                       StridedPtrInfo &SPtrInfo) const {
+  const unsigned Sz = PointerOps.size();
+  // TODO: VecSz may change if we widen the strided load.
+  unsigned VecSz = Sz;
+  FixedVectorType *StridedLoadTy = getWidenedType(ScalarTy, VecSz);
+  if (!(Sz > MinProfitableStridedLoads && TTI->isTypeLegal(StridedLoadTy) &&
+        TTI->isLegalStridedLoadStore(StridedLoadTy, CommonAlignment)))
----------------
mgudim wrote:

done

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


More information about the llvm-commits mailing list