[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 07:05:38 PDT 2026


================
@@ -3192,8 +3212,12 @@ static bool handleUncountableExitsWithSideEffects(
   SmallVector<VPInstruction *, 8> ConditionRecipes;
 
   VPValue *Cond = getRecipesForUncountableExit(ConditionRecipes, LatchVPBB);
-  if (!Cond)
+  if (!Cond) {
+    reportVectorizationFailure("Unable to determine early exit condition for "
+                               "loop with side effects.\n",
+                               "EarlyExitSideEffectsCond", ORE, TheLoop);
----------------
david-arm wrote:

See:

```
static void debugVectorizationMessage(const StringRef Prefix,
                                      const StringRef DebugMsg,
                                      Instruction *I) {
  dbgs() << "LV: " << Prefix << DebugMsg;
  if (I != nullptr)
    dbgs() << " " << *I;
  else
    dbgs() << '.';
  dbgs() << '\n';
}
```

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


More information about the llvm-commits mailing list