aboutsummaryrefslogtreecommitdiff
path: root/benchtests/bench-hash-funcs-kernel.h
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2024-12-23 05:11:58 +0800
committerH.J. Lu <hjl.tools@gmail.com>2024-12-23 06:28:55 +0800
commita2b0ff98a0d44259cc5f6bd7d3a3676ae9f8996a (patch)
tree7816983cdeea6e6c32dd005c76da785811ea3047 /benchtests/bench-hash-funcs-kernel.h
parent3fb895ac88e99201573352b1abc18db4340ecede (diff)
downloadglibc-a2b0ff98a0d44259cc5f6bd7d3a3676ae9f8996a.tar.xz
glibc-a2b0ff98a0d44259cc5f6bd7d3a3676ae9f8996a.zip
include/sys/cdefs.h: Add __attribute_optimization_barrier__
Add __attribute_optimization_barrier__ to disable inlining and cloning on a function. For Clang, expand it to __attribute__ ((optnone)) Otherwise, expand it to __attribute__ ((noinline, clone)) Co-Authored-By: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'benchtests/bench-hash-funcs-kernel.h')
-rw-r--r--benchtests/bench-hash-funcs-kernel.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/benchtests/bench-hash-funcs-kernel.h b/benchtests/bench-hash-funcs-kernel.h
index 7eaa3665b6..3e58fde084 100644
--- a/benchtests/bench-hash-funcs-kernel.h
+++ b/benchtests/bench-hash-funcs-kernel.h
@@ -35,7 +35,7 @@
#define PRIMITIVE_CAT(x, y) x ## y
#define CAT(x, y) PRIMITIVE_CAT (x, y)
-static double __attribute__ ((noinline, noclone))
+static double __attribute_optimization_barrier__
CAT (do_one_test_kernel, POSTFIX) (const char *s, size_t len)
{
@@ -58,7 +58,7 @@ CAT (do_one_test_kernel, POSTFIX) (const char *s, size_t len)
return (double) cur / (double) NFIXED_ITERS;
}
-static double __attribute__ ((noinline, noclone))
+static double __attribute_optimization_barrier__
CAT (do_rand_test_kernel, POSTFIX) (char const *bufs,
unsigned int const *sizes)
{