[llvm] [LoopInterchange] Hoist isComputableLoopNest() in the control flow (PR #124247)
Ryotaro Kasuga via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 30 03:06:03 PST 2025
================
@@ -1761,10 +1759,23 @@ PreservedAnalyses LoopInterchangePass::run(LoopNest &LN,
// Ensure minimum depth of the loop nest to do the interchange.
if (!hasSupportedLoopDepth(LoopList, ORE))
return PreservedAnalyses::all();
+ // Ensure computable loop nest.
+ if (!isComputableLoopNest(&AR.SE, LoopList)) {
+ LLVM_DEBUG(dbgs() << "Not valid loop candidate for interchange\n");
+ return PreservedAnalyses::all();
+ }
+
+ ORE.emit([&]() {
+ return OptimizationRemarkAnalysis(DEBUG_TYPE, "Dependence",
+ LN.getOutermostLoop().getStartLoc(),
+ LN.getOutermostLoop().getHeader())
+ << "Computed dependence info, invoking the transform.";
----------------
kasuga-fj wrote:
As discussed above, I think this message is just for testing that the process exits **before** computing dependence info if the loop is not computable. To achieve this, inserting a new message here seems to be reasonable to me.
However, in terms of messages to users, I think this is a bit excessive or noisy. Replacing it with `dbgs()` would be one option. It depends on which what we want to prioritize: test coverage or having useful "technical" messages for users.
https://github.com/llvm/llvm-project/pull/124247
More information about the llvm-commits
mailing list