[llvm] [LoopInfo] Derive Loop::contains(BlockT*) from the block-to-loop map (PR #207613)

via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 5 14:34:49 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,h -- llvm/include/llvm/Support/GenericLoopInfo.h llvm/include/llvm/Support/GenericLoopInfoImpl.h llvm/lib/Transforms/Scalar/LoopSimplifyCFG.cpp llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp llvm/lib/Transforms/Utils/FixIrreducible.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/include/llvm/Support/GenericLoopInfo.h b/llvm/include/llvm/Support/GenericLoopInfo.h
index 7b43eca8b..20e6e1d1b 100644
--- a/llvm/include/llvm/Support/GenericLoopInfo.h
+++ b/llvm/include/llvm/Support/GenericLoopInfo.h
@@ -482,9 +482,7 @@ protected:
   /// This creates an empty loop.
   LoopBase() : ParentLoop(nullptr) {}
 
-  explicit LoopBase(BlockT *BB) : ParentLoop(nullptr) {
-    Blocks.push_back(BB);
-  }
+  explicit LoopBase(BlockT *BB) : ParentLoop(nullptr) { Blocks.push_back(BB); }
 
   // Since loop passes like SCEV are allowed to key analysis results off of
   // `Loop` pointers, we cannot re-use pointers within a loop pass manager.

``````````

</details>


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


More information about the llvm-commits mailing list