[llvm] [LoopInterchange] Hoist isComputableLoopNest() in the control flow (PR #124247)

Ryotaro Kasuga via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 28 22:47:22 PST 2025


================
@@ -1756,10 +1754,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 OptimizationRemark(DEBUG_TYPE, "Dependence",
----------------
kasuga-fj wrote:

I see, then I agree with using optimization remarks.

https://github.com/llvm/llvm-project/pull/124247


More information about the llvm-commits mailing list