[llvm] [ADT] Use isEqual for ImmutableSet/Map tree canonicalization (PR #207596)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 5 09:18:40 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/benchmarks/ImmutableSetIteratorBM.cpp llvm/include/llvm/ADT/ImmutableSet.h --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/benchmarks/ImmutableSetIteratorBM.cpp b/llvm/benchmarks/ImmutableSetIteratorBM.cpp
index a1918467c..bb68e0154 100644
--- a/llvm/benchmarks/ImmutableSetIteratorBM.cpp
+++ b/llvm/benchmarks/ImmutableSetIteratorBM.cpp
@@ -124,7 +124,8 @@ static void BM_CompareSamePosition(benchmark::State &State) {
// paths are canonicalized against ones already cached. Adding then removing an
// absent (largest) key rebuilds only the right spine while sharing the rest of
// Base's subtrees, so getCanonicalTree confirms equality against a structurally
-// shared equal tree -- exactly where isEqual's subtree pointer skipping matters.
+// shared equal tree -- exactly where isEqual's subtree pointer skipping
+// matters.
static void BM_CanonicalizeSharedEqual(benchmark::State &State) {
const size_t N = State.range(0);
ImmutableSet<int>::Factory F(/*canonicalize=*/true);
@@ -152,6 +153,8 @@ static void BM_CanonicalizeSharedEqual(benchmark::State &State) {
BENCHMARK(BM_Iterate)->Name("Iterate")->ITER_SIZES;
BENCHMARK(BM_IterateWithSkips)->Name("Skip")->ITER_SIZES;
BENCHMARK(BM_CompareSamePosition)->Name("CompareSamePos")->ITER_SIZES;
-BENCHMARK(BM_CanonicalizeSharedEqual)->Name("CanonicalizeSharedEqual")->ITER_SIZES;
+BENCHMARK(BM_CanonicalizeSharedEqual)
+ ->Name("CanonicalizeSharedEqual")
+ ->ITER_SIZES;
BENCHMARK_MAIN();
``````````
</details>
https://github.com/llvm/llvm-project/pull/207596
More information about the llvm-commits
mailing list