[libcxx-commits] [libcxx] [libc++] Align and avoid inlining benchmark functions (PR #213938)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Thu Aug 13 06:07:54 PDT 2026


================
@@ -574,4 +574,7 @@ inline Tp const& DoNotOptimize(Tp const& value) {
 #  define TEST_LONG_DOUBLE_IS_80_BIT
 #endif
 
+// Align benchmark functions and never inline them to reduce changes in performance in unrelated benchmarks
+#define TEST_ALIGN_BENCHMARK __attribute__((aligned(128), noinline))
----------------
philnik777 wrote:

IMO this is very silly. Instead of using a standard feature from a future version, this instead uses a completely non-standard feature that is known to be less portable. We could instead just disable the warning for anything in `test/benchmarks`.

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


More information about the libcxx-commits mailing list