[llvm] [LoopVectorize] Perform loop versioning for some early exit loops (PR #120603)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 13 12:28:09 PST 2025


================
@@ -1609,6 +1609,43 @@ bool LoopVectorizationLegality::canVectorizeLoopNestCFG(
   return Result;
 }
 
+bool LoopVectorizationLegality::analyzePotentiallyFaultingLoads(
+    SmallVectorImpl<LoadInst *> *Loads) {
+  LLVM_DEBUG(dbgs() << "LV: Looking for potentially faulting loads in loop "
+                       "with uncountable early exit:\n");
+  for (LoadInst *LI : *Loads) {
+    LLVM_DEBUG(dbgs() << "LV:   Load: " << *LI << '\n');
+    Value *Ptr = LI->getPointerOperand();
+    if (!Ptr)
+      return false;
----------------
fhahn wrote:

It should always return a valid value.

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


More information about the llvm-commits mailing list