[llvm] [LoopVectorize] Add metadata to distinguish vectorized loop body from scalar remainder (PR #190258)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 3 08:35:53 PDT 2026
================
@@ -25,13 +25,25 @@ static void warnAboutLeftoverTransformations(Loop *L,
OptimizationRemarkEmitter *ORE) {
if (hasUnrollTransformation(L) == TM_ForcedByUser) {
LLVM_DEBUG(dbgs() << "Leftover unroll transformation\n");
- ORE->emit(
- DiagnosticInfoOptimizationFailure(DEBUG_TYPE,
- "FailedRequestedUnrolling",
- L->getStartLoc(), L->getHeader())
- << "loop not unrolled: the optimizer was unable to perform the "
- "requested transformation; the transformation might be disabled or "
- "specified as part of an unsupported transformation ordering");
+ bool IsVectorBody =
+ getBooleanLoopAttribute(L, "llvm.loop.vectorize.vector_body");
+ bool IsScalarRemainder =
+ getBooleanLoopAttribute(L, "llvm.loop.vectorize.scalar_remainder");
+ const char *LoopKind = (IsVectorBody && IsScalarRemainder)
+ ? "epilogue vectorized remainder loop"
+ : IsScalarRemainder
+ ? "scalar remainder loop after vectorization"
+ : IsVectorBody ? "vectorized loop"
+ : "loop";
----------------
arsenm wrote:
Can you express this as single word substitution?
https://github.com/llvm/llvm-project/pull/190258
More information about the llvm-commits
mailing list