[llvm] [LV] Emit better debug and opt-report messages when vectorization is disallowed in the LoopVectorizer (PR #158513)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 26 20:03:44 PDT 2025
================
@@ -182,14 +182,40 @@ void LoopVectorizeHints::setAlreadyVectorized() {
bool LoopVectorizeHints::allowVectorization(
Function *F, Loop *L, bool VectorizeOnlyWhenForced) const {
if (getForce() == LoopVectorizeHints::FK_Disabled) {
- LLVM_DEBUG(dbgs() << "LV: Not vectorizing: #pragma vectorize disable.\n");
- emitRemarkWithHints();
+ if (Force.Value == LoopVectorizeHints::FK_Disabled) {
+ LLVM_DEBUG(dbgs() << "LV: Not vectorizing: #pragma vectorize disable.\n");
+ ORE.emit(OptimizationRemarkMissed(LV_NAME, "MissedExplicitlyDisabled",
+ TheLoop->getStartLoc(),
+ TheLoop->getHeader())
+ << "loop not vectorized: vectorization is explicitly disabled");
----------------
fhahn wrote:
could this use `reportVectorizationFailure`?
https://github.com/llvm/llvm-project/pull/158513
More information about the llvm-commits
mailing list