[llvm] [LoopInterchange] Add metadata to control loop-interchange (PR #127474)
Ryotaro Kasuga via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 10 04:08:39 PDT 2025
================
@@ -80,6 +80,17 @@ static void warnAboutLeftoverTransformations(Loop *L,
"requested transformation; the transformation might be disabled or "
"specified as part of an unsupported transformation ordering");
}
+
+ if (hasInterchangeTransformation(L) == TM_ForcedByUser) {
+ LLVM_DEBUG(dbgs() << "Leftover interchange transformation\n");
+ ORE->emit(
+ DiagnosticInfoOptimizationFailure(DEBUG_TYPE,
+ "FailedRequestedInterchange",
+ L->getStartLoc(), L->getHeader())
+ << "loop not interchanged: the optimizer was unable to perform the "
+ "requested transformation; the transformation might be disabled or "
+ "specified as part of an unsupported transformation ordering");
+ }
----------------
kasuga-fj wrote:
> Consider adding the loop interchange metadata to https://github.com/llvm/llvm-project/blob/main/llvm/lib/Transforms/Scalar/WarnMissedTransforms.cpp, such that for whatever reason there is still interchange instructions on some loops, the user gets a warning.
Is this what you intended?
https://github.com/llvm/llvm-project/pull/127474
More information about the llvm-commits
mailing list