From 4c8b65db085fb20924d911ae69280bd3fc733f72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 19 Sep 2022 12:29:16 +0300 Subject: Cleanup: Remove INNODB_COMPILER_HINTS There should be no point to disable branch prediction hints or prefetch. --- storage/innobase/include/univ.i | 15 +++++---------- storage/innobase/innodb.cmake | 8 -------- 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i index 8de24b1faa0..e5ad408424f 100644 --- a/storage/innobase/include/univ.i +++ b/storage/innobase/include/univ.i @@ -504,7 +504,7 @@ contains the sum of the following flag and the locally stored len. */ #endif /* CHECK FOR GCC VER_GT_2 */ /* Some macros to improve branch prediction and reduce cache misses */ -#if defined(COMPILER_HINTS) && defined(__GNUC__) +#ifdef __GNUC__ /* Tell the compiler that 'expr' probably evaluates to 'constant'. */ # define UNIV_EXPECT(expr,constant) __builtin_expect(expr, constant) /* Tell the compiler that a pointer is likely to be NULL */ @@ -524,16 +524,11 @@ it is read or written. */ # define UNIV_EXPECT(expr,value) (expr) # define UNIV_LIKELY_NULL(expr) (expr) -# if defined(COMPILER_HINTS) //# define UNIV_PREFETCH_R(addr) sun_prefetch_read_many((void*) addr) -# define UNIV_PREFETCH_R(addr) ((void) 0) -# define UNIV_PREFETCH_RW(addr) sun_prefetch_write_many(addr) -# else -# define UNIV_PREFETCH_R(addr) ((void) 0) -# define UNIV_PREFETCH_RW(addr) ((void) 0) -# endif /* COMPILER_HINTS */ - -# elif defined __WIN__ && defined COMPILER_HINTS +# define UNIV_PREFETCH_R(addr) ((void) 0) +# define UNIV_PREFETCH_RW(addr) sun_prefetch_write_many(addr) + +# elif defined __WIN__ # include # define UNIV_EXPECT(expr,value) (expr) # define UNIV_LIKELY_NULL(expr) (expr) diff --git a/storage/innobase/innodb.cmake b/storage/innobase/innodb.cmake index d219977daff..736c2b812f4 100644 --- a/storage/innobase/innodb.cmake +++ b/storage/innobase/innodb.cmake @@ -70,14 +70,6 @@ IF(UNIX) ENDIF() ENDIF() -OPTION(INNODB_COMPILER_HINTS "Compile InnoDB with compiler hints" ON) -MARK_AS_ADVANCED(INNODB_COMPILER_HINTS) - -IF(INNODB_COMPILER_HINTS) - ADD_DEFINITIONS("-DCOMPILER_HINTS") -ENDIF() -ADD_FEATURE_INFO(INNODB_COMPILER_HINTS INNODB_COMPILER_HINTS "InnoDB compiled with compiler hints") - SET(MUTEXTYPE "event" CACHE STRING "Mutex type: event, sys or futex") IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU") -- cgit v1.2.1