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

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 1 21:44:24 PDT 2025


================
@@ -85,10 +85,11 @@ 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(
+/// Returns true if the only potentially faulting operations in loop are loads.
+/// Also collect loads that are not guaranteed to be dereferenceable.
----------------
lukel97 wrote:

Nit just on wording, to make it clearer that the loads may or may not fault.

```suggestion
/// Returns true if the loop contains read-only memory accesses and doesn't throw. Puts loads that may fault into \p NonDereferenceableAndAlignedLoads.
```

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


More information about the llvm-commits mailing list