[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
Wed Sep 23 00:53:46 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:

Yeah, that makes sense but we need to update the existing interfaces to add that feature first. Presumably there is a way to get the debug location from the metadata attached to an instruction and print that out, rather than printing out the IR instruction (what happens currently) which has little value to the user. Having said that, the remark generated already uses the debug location for the lop so we'd have to override it somehow. It sounds like what you'd like to see is the location being refined to a specific line of code inside the loop, rather than the start of the loop?

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


More information about the llvm-commits mailing list