[llvm] [LoopVectorize] Add support for vectorisation of more early exit loops (PR #88385)

Kiran Chandramohan via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 24 04:19:32 PDT 2024


================
@@ -2514,14 +2545,20 @@ bool LoopAccessInfo::analyzeLoop(AAResults *AA, LoopInfo *LI,
 
   // Check if we see any stores. If there are no stores, then we don't
   // care if the pointers are *restrict*.
+  bool CanVecMem = false;
   if (!Stores.size()) {
     LLVM_DEBUG(dbgs() << "LAA: Found a read-only loop!\n");
-    return true;
+    // Don't return yet if there are uncountable exits because we also need to
+    // record all of the underlying objects for memory fault analysis.
+    if (!UncountableExitingBlocks.size())
+      return true;
+    else
+      CanVecMem = true;
----------------
kiranchandramohan wrote:

Nit: else after return.

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


More information about the llvm-commits mailing list