[libcxx-commits] [libcxx] [libc++] Fix broke unique and unique_copy benchmarks (PR #158287)

via libcxx-commits libcxx-commits at lists.llvm.org
Fri Sep 12 05:57:02 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

Author: Louis Dionne (ldionne)

<details>
<summary>Changes</summary>

These benchmarks have an assumption that the container size is divisible by 4 because of how we populate their content, which wasn't satisfied.

---
Full diff: https://github.com/llvm/llvm-project/pull/158287.diff


2 Files Affected:

- (modified) libcxx/test/benchmarks/algorithms/modifying/unique.bench.cpp (+2-2) 
- (modified) libcxx/test/benchmarks/algorithms/modifying/unique_copy.bench.cpp (+2-1) 


``````````diff
diff --git a/libcxx/test/benchmarks/algorithms/modifying/unique.bench.cpp b/libcxx/test/benchmarks/algorithms/modifying/unique.bench.cpp
index c0aee942eef64..e3ac50187ef4b 100644
--- a/libcxx/test/benchmarks/algorithms/modifying/unique.bench.cpp
+++ b/libcxx/test/benchmarks/algorithms/modifying/unique.bench.cpp
@@ -76,7 +76,7 @@ int main(int argc, char** argv) {
             }
           })
           ->Arg(32)
-          ->Arg(50) // non power-of-two
+          ->Arg(52) // non power-of-two
           ->Arg(1024)
           ->Arg(8192);
     };
@@ -143,7 +143,7 @@ int main(int argc, char** argv) {
             }
           })
           ->Arg(32)
-          ->Arg(50) // non power-of-two
+          ->Arg(52) // non power-of-two
           ->Arg(1024)
           ->Arg(8192);
     };
diff --git a/libcxx/test/benchmarks/algorithms/modifying/unique_copy.bench.cpp b/libcxx/test/benchmarks/algorithms/modifying/unique_copy.bench.cpp
index 45b52dd23b695..1885b53e51413 100644
--- a/libcxx/test/benchmarks/algorithms/modifying/unique_copy.bench.cpp
+++ b/libcxx/test/benchmarks/algorithms/modifying/unique_copy.bench.cpp
@@ -61,6 +61,7 @@ int main(int argc, char** argv) {
             }
           })
           ->Arg(32)
+          ->Arg(52) // non power-of-two
           ->Arg(1024)
           ->Arg(8192);
     };
@@ -115,7 +116,7 @@ int main(int argc, char** argv) {
             }
           })
           ->Arg(32)
-          ->Arg(50) // non power-of-two
+          ->Arg(52) // non power-of-two
           ->Arg(1024)
           ->Arg(8192);
     };

``````````

</details>


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


More information about the libcxx-commits mailing list