[llvm] [LV] Vectorize bounded (i % 2^N) loads in read only loops w/o RT checks. (PR #207279)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 17 05:01:25 PDT 2026


================
@@ -1706,6 +1706,38 @@ llvm::getPtrStride(PredicatedScalarEvolution &PSE, Type *AccessTy, Value *Ptr,
   return Stride;
 }
 
+std::optional<uint64_t> llvm::getBoundedAccessBound(const SCEV *PtrSCEV,
+                                                    Type *AccessTy,
+                                                    const Loop *L,
+                                                    ScalarEvolution &SE) {
+  if (AccessTy->isScalableTy())
+    return std::nullopt;
+
+  // `A[i % 2^N]` is `Base + ElemSize * zext({0,+,1}<iN>)`. For a byte
----------------
artagnon wrote:

Could clarify that N is IVBW in all places?

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


More information about the llvm-commits mailing list