[llvm] [LoopFusion] Correction in the comments (NFC) (PR #184689)

Ehsan Amiri via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 4 13:58:31 PST 2026


https://github.com/amehsan created https://github.com/llvm/llvm-project/pull/184689

None

>From 700a50f81bcacc110358f9b5084be4c54788f27e Mon Sep 17 00:00:00 2001
From: Ehsan Amiri <ehsan.amiri at huawei.com>
Date: Wed, 4 Mar 2026 16:56:50 -0500
Subject: [PATCH] [LoopFusion] Correction in the comments (NFC)

---
 llvm/lib/Transforms/Scalar/LoopFuse.cpp | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/llvm/lib/Transforms/Scalar/LoopFuse.cpp b/llvm/lib/Transforms/Scalar/LoopFuse.cpp
index 01fe45a013a63..2f1e1f6095dd7 100644
--- a/llvm/lib/Transforms/Scalar/LoopFuse.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopFuse.cpp
@@ -545,15 +545,13 @@ struct LoopFuser {
 
         collectFusionCandidates(LV);
         Changed |= fuseCandidates();
+        // All loops in the candidate sets have a common parent (or not parent).
+        // Next loop vector, will include loops with a different parent. It is
+        // Safe to remove all the candidates currently in the set.
         FusionCandidates.clear();
       }
 
-      // Finished analyzing candidates at this level.
-      // Descend to the next level and clear all of the candidates currently
-      // collected. Note that it will not be possible to fuse any of the
-      // existing candidates with new candidates because the new candidates will
-      // be at a different nest level and thus not be control flow equivalent
-      // with all of the candidates collected so far.
+      // Finished analyzing candidates at this level. Descend to the next level.
       LLVM_DEBUG(dbgs() << "Descend one level!\n");
       LDT.descend();
     }



More information about the llvm-commits mailing list