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

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 22 06:58:28 PDT 2026


================
@@ -3296,8 +3344,12 @@ static bool handleUncountableExitsWithSideEffects(
   auto Phis = ScalarPH->phis();
   // TODO: Handle more than one Phi; re-derive from IV.
   // TODO: Handle reductions.
-  if (range_size(Phis) != 1)
+  if (range_size(Phis) != 1) {
+    reportVectorizationFailure("Early exit loop with side effects contains "
+                               "unsupported reductions or recurrences.\n",
+                               "EarlyExitEffectsSideReductions", ORE, TheLoop);
----------------
fhahn wrote:


```suggestion
                               "EarlyExitSideEffectsReductions", ORE, TheLoop);
```

or maybe more general name, it may be multiple inductions or a first order recurrence

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


More information about the llvm-commits mailing list