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

Paul Walker via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 11 09:15:14 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;
----------------
paulwalker-arm wrote:

Is it possible for a `LoadInst` pointer operand to not exist?

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


More information about the llvm-commits mailing list