[libcxx-commits] [libcxx] [libc++] Optimize vector::__move_range for trivially copyable types (PR #207384)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Wed Aug 5 18:53:59 PDT 2026


================
@@ -35,6 +35,9 @@ void DoNotOptimizeData(Container& c) {
   }
 }
 
+// Align benchmark functions and never inline them to reduce changes in performance in unrelated benchmarks
+#define BENCHMARK_ATTRS [[gnu::aligned(128), gnu::noinline]]
----------------
frederick-vs-ja wrote:

Let's suppress the warning, although I'm not sure whether the benchmark tests are only compiled with Clang.
```suggestion
#if defined(TEST_COMPILER_CLANG)
#  define BENCHMARK_ATTRS                                                                                              \
    _Pragma("clang diagnostic push") _Pragma("clang diagnostic ignored \"-Wc++23-lambda-attributes\"")                 \
        [[gnu::aligned(128), gnu::noinline]] _Pragma("clang diagnostic pop")
#else
#  define BENCHMARK_ATTRS [[gnu::aligned(128), gnu::noinline]]
#endif
```

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


More information about the libcxx-commits mailing list