[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 07:49:57 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);
----------------
fhahn wrote:
The debug location is what gets used for the remarks (when printed via YAML). `reportVectorizationInfo` allows passing the debug location, and defaults to the instruction when it is not passed I think. Looks like `reportVectorizationFailure` doesn't do it yet, but probably should.
Without it, the remark will be less useful, with the debug location the tools consuming the remarks can correlate it with the source code and display the message at the source line where the condition is defined
https://github.com/llvm/llvm-project/pull/225078
More information about the llvm-commits
mailing list