# HG changeset patch # User manc # Date 1552098112 28800 # Fri Mar 08 18:21:52 2019 -0800 # Node ID 8083ba97fe291c38be4dd17eda4dd6ef862562c8 # Parent 687e10fefa11b715d9f9cdf6ae6ddde954cf6b50 8220388: Increase -inlinehint-threshold for Clang to avoid G1 pause time regression Summary: Make Clang inline more aggressively for functions with inline keyword Reviewed-by: diff --git a/make/autoconf/flags-cflags.m4 b/make/autoconf/flags-cflags.m4 --- a/make/autoconf/flags-cflags.m4 +++ b/make/autoconf/flags-cflags.m4 @@ -535,6 +535,13 @@ # works for all platforms. TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -mno-omit-leaf-frame-pointer -mstack-alignment=16" + if test "x$DEBUG_LEVEL" = xrelease; then + # Clang does not inline as much as GCC does for functions with "inline" keyword by default. + # This causes noticeable slowdown in pause time for G1, and possibly in other areas. + # Increasing the inline hint threshold avoids the slowdown for Clang-built JVM. + TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -mllvm -inlinehint-threshold=100000" + fi + if test "x$OPENJDK_TARGET_OS" = xlinux; then TOOLCHAIN_CFLAGS_JDK="-pipe" TOOLCHAIN_CFLAGS_JDK_CONLY="-fno-strict-aliasing" # technically NOT for CXX