[llvm] [LoopInterchange] Also look at lcssa phis in outer loop latch block (PR #160889)

via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 26 07:13:25 PDT 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp -- llvm/lib/Transforms/Scalar/LoopInterchange.cpp
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/lib/Transforms/Scalar/LoopInterchange.cpp b/llvm/lib/Transforms/Scalar/LoopInterchange.cpp
index e42d82d15..ad63214f0 100644
--- a/llvm/lib/Transforms/Scalar/LoopInterchange.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopInterchange.cpp
@@ -43,8 +43,8 @@
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/Transforms/Scalar/LoopPassManager.h"
 #include "llvm/Transforms/Utils/BasicBlockUtils.h"
-#include "llvm/Transforms/Utils/LoopUtils.h"
 #include "llvm/Transforms/Utils/Local.h"
+#include "llvm/Transforms/Utils/LoopUtils.h"
 #include <cassert>
 #include <utility>
 #include <vector>
@@ -1867,8 +1867,8 @@ static void moveLCSSAPhis(BasicBlock *InnerExit, BasicBlock *InnerHeader,
   SmallVector<PHINode *, 8> LcssaOuterLatch(
       llvm::make_pointer_range(OuterLatch->phis()));
   for (PHINode *P : LcssaOuterLatch)
-     if (isInstructionTriviallyDead(P))
-       P->eraseFromParent();
+    if (isInstructionTriviallyDead(P))
+      P->eraseFromParent();
 
   // Deal with LCSSA PHI nodes in the loop nest exit block. For PHIs that have
   // incoming values defined in the outer loop, we have to add a new PHI

``````````

</details>


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


More information about the llvm-commits mailing list