From bc2b7b47c8ff5adfdb938facee4dcc46f690c806 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sat, 31 Aug 2024 11:04:16 +0800 Subject: [PATCH] build: cmake: add and use Scylla_CLANG_INLINE_THRESHOLD cmake parameter so that we can set this the parameter passed to `-inline-threshold` with `configure.py` when building with CMake. Signed-off-by: Kefu Chai Closes scylladb/scylladb#20364 --- cmake/mode.RelWithDebInfo.cmake | 5 +++-- configure.py | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cmake/mode.RelWithDebInfo.cmake b/cmake/mode.RelWithDebInfo.cmake index a16c7e091d..6144be4b87 100644 --- a/cmake/mode.RelWithDebInfo.cmake +++ b/cmake/mode.RelWithDebInfo.cmake @@ -16,10 +16,11 @@ set(scylla_build_mode_RelWithDebInfo "release") add_compile_definitions( $<$:SCYLLA_BUILD_MODE=${scylla_build_mode_RelWithDebInfo}>) -set(clang_inline_threshold 2500) +set(Scylla_CLANG_INLINE_THRESHOLD "2500" CACHE STRING + "LLVM-specific inline threshold compilation parameter") add_compile_options( "$<$,$>:--param;inline-unit-growth=300>" - "$<$,$>:-mllvm;-inline-threshold=${clang_inline_threshold}>") + "$<$,$>:-mllvm;-inline-threshold=${Scylla_CLANG_INLINE_THRESHOLD}>") # clang generates 16-byte loads that break store-to-load forwarding # gcc also has some trouble: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103554 check_cxx_compiler_flag("-fno-slp-vectorize" _slp_vectorize_supported) diff --git a/configure.py b/configure.py index 444215bd1e..3c433bfb71 100755 --- a/configure.py +++ b/configure.py @@ -2542,6 +2542,8 @@ def configure_using_cmake(args): settings['Scylla_DATE_STAMP'] = args.date_stamp if args.staticboost: settings['Boost_USE_STATIC_LIBS'] = 'ON' + if args.clang_inline_threshold != -1: + settings['Scylla_CLANG_INLINE_THRESHOLD'] = args.clang_inline_threshold source_dir = os.path.realpath(os.path.dirname(__file__)) build_dir = os.path.join(source_dir, 'build')