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

via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 24 01:56:07 PST 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 df3bc54eff3baaa0ad2492b858029bcbf258a5d7 889bbf61ac94b39d8da97daad5f1cc0f117f0e72 --extensions cpp -- llvm/lib/Transforms/Scalar/LoopInterchange.cpp
``````````

</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 e995db1f5c..2557dbe53b 100644
--- a/llvm/lib/Transforms/Scalar/LoopInterchange.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopInterchange.cpp
@@ -272,7 +272,8 @@ static bool hasSupportedLoopDepth(SmallVectorImpl<Loop *> &LoopList,
   return true;
 }
 
-static bool isComputableLoopNest(ScalarEvolution *SE, ArrayRef<Loop *> LoopList) {
+static bool isComputableLoopNest(ScalarEvolution *SE,
+                                 ArrayRef<Loop *> LoopList) {
   for (Loop *L : LoopList) {
     const SCEV *ExitCountOuter = SE->getBackedgeTakenCount(L);
     if (isa<SCEVCouldNotCompute>(ExitCountOuter)) {
@@ -1752,11 +1753,11 @@ 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();
+    LLVM_DEBUG(dbgs() << "Not valid loop candidate for interchange\n");
+    return PreservedAnalyses::all();
   }
 
   DependenceInfo DI(&F, &AR.AA, &AR.SE, &AR.LI);

``````````

</details>


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


More information about the llvm-commits mailing list