[llvm] [LoopInterchange] Swap preheader contents before rebuilding LCSSA (PR #218468)

via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 26 05:14:04 PDT 2026


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 --diff_from_common_commit
``````````

: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 7e8547f95..031b03619 100644
--- a/llvm/lib/Transforms/Scalar/LoopInterchange.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopInterchange.cpp
@@ -2640,9 +2640,9 @@ void LoopInterchangeTransform::adjustLoopBranches() {
   InnerLoopHeader->replacePhiUsesWith(OuterLoopLatch, InnerLoopLatch);
 
   // Swap the preheader contents so each definition sits in the preheader of the
-  // loop it now belongs to. This runs before the LCSSA rebuild below so that any
-  // definition referenced across the interchanged levels dominates its uses when
-  // formLCSSAForInstructions runs.
+  // loop it now belongs to. This runs before the LCSSA rebuild below so that
+  // any definition referenced across the interchanged levels dominates its uses
+  // when formLCSSAForInstructions runs.
   swapBBContents(OuterLoop->getLoopPreheader(), InnerLoop->getLoopPreheader());
 
   // Values defined in the outer loop header could be used in the inner loop

``````````

</details>


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


More information about the llvm-commits mailing list