[llvm] [LV] Compute SCEV for memcheck before unlinking (PR #160326)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 29 01:48:04 PDT 2025


================
@@ -575,10 +575,13 @@ LLVM_ABI Loop *cloneLoop(Loop *L, Loop *PL, ValueToValueMapTy &VM, LoopInfo *LI,
 
 /// Add code that checks at runtime if the accessed arrays in \p PointerChecks
 /// overlap. Returns the final comparator value or NULL if no check is needed.
+/// If \p HoistRuntimeChecks and \p TheLoop has a parent, sets \p
+/// AllChecksHoisted when all checks are outer-loop invariant (hoistable).
 LLVM_ABI Value *
 addRuntimeChecks(Instruction *Loc, Loop *TheLoop,
                  const SmallVectorImpl<RuntimePointerCheck> &PointerChecks,
-                 SCEVExpander &Expander, bool HoistRuntimeChecks = false);
+                 SCEVExpander &Expander, bool HoistRuntimeChecks,
+                 bool &AllChecksHoisted);
----------------
fhahn wrote:

Would it be possible/better to return this together with the runtime check using std::pair<> or somerhing like that?

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


More information about the llvm-commits mailing list