[llvm] [LV] Add initial legality checks for loops with unbound loads. (PR #152422)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 2 22:44:33 PDT 2025


================
@@ -85,11 +85,13 @@ LLVM_ABI bool isDereferenceableAndAlignedInLoop(
     AssumptionCache *AC = nullptr,
     SmallVectorImpl<const SCEVPredicate *> *Predicates = nullptr);
 
-/// Return true if the loop \p L cannot fault on any iteration and only
-/// contains read-only memory accesses.
-LLVM_ABI bool isDereferenceableReadOnlyLoop(
-    Loop *L, ScalarEvolution *SE, DominatorTree *DT, AssumptionCache *AC,
-    SmallVectorImpl<const SCEVPredicate *> *Predicates = nullptr);
+/// Returns true if the loop contains read-only memory accesses and doesn't
+/// throw. Puts loads that may fault into \p NonDereferenceableAndAlignedLoads.
+LLVM_ABI bool
+isReadOnlyLoop(Loop *L, ScalarEvolution *SE, DominatorTree *DT,
+               AssumptionCache *AC,
+               SmallVectorImpl<LoadInst *> *NonDereferenceableAndAlignedLoads,
----------------
fhahn wrote:

Why pass this as pointer? Should be a reference, unless it is an optional argument

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


More information about the llvm-commits mailing list