[llvm] [LoopInterchange] Bail out early if minimum loop nest is not met (PR #115128)

via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 7 05:54:09 PST 2024


================
@@ -416,11 +424,11 @@ struct LoopInterchange {
 
   bool processLoopList(SmallVectorImpl<Loop *> &LoopList) {
     bool Changed = false;
-    unsigned LoopNestDepth = LoopList.size();
-    if (LoopNestDepth < 2) {
-      LLVM_DEBUG(dbgs() << "Loop doesn't contain minimum nesting level.\n");
+
+    if (!hasMinimumLoopDepth(LoopList))
----------------
CongzheUalberta wrote:

If `LoopNestDepth` is smaller than 2 then we should already have returned from `if (!hasMinimumLoopDepth(LoopList))` on line 1727, which indicates the check on line 428 can be deleted?

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


More information about the llvm-commits mailing list