[llvm] [LV][NFC] Clean up tail-folding check for early-exit loops (PR #133931)

Shih-Po Hung via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 3 08:26:07 PDT 2025


================
@@ -1924,6 +1924,16 @@ bool LoopVectorizationLegality::canFoldTailByMasking() const {
     }
   }
 
+  // The only loops we can vectorize without a scalar epilogue, are loops with
+  // a bottom-test and a single exiting block. We'd have to handle the fact
+  // that not every instruction executes on the last iteration.  This will
+  // require a lane mask which varies through the vector loop body.  (TODO)
+  if (TheLoop->getExitingBlock() != TheLoop->getLoopLatch()) {
----------------
arcbbb wrote:

Fixed. Thanks!

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


More information about the llvm-commits mailing list