[llvm] [LV][NFC] Emit remarks when failing to vectorise early exit loops (PR #225078)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 22 00:45:02 PDT 2026


================
@@ -3227,8 +3251,13 @@ static bool handleUncountableExitsWithSideEffects(
     if (!isDereferenceableAndAlignedInLoop(
             PtrSCEV, cast<LoadInst>(Load->getUnderlyingInstr())->getAlign(),
             PSE.getSE()->getConstant(EltSize), TheLoop, *PSE.getSE(), DT, AC,
-            &Predicates))
+            &Predicates)) {
+      reportVectorizationFailure("Early exit loop with side effects contains "
+                                 "critical load that may fault.\n",
----------------
david-arm wrote:

Yeah I couldn't think of a better term for it. I just wanted to distinguish between a random load in the loop and the critical one that's used for the exit condition, otherwise the remark probably isn't very useful. I'm happy to be more verbose here if others are happy.

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


More information about the llvm-commits mailing list