< prev index next >

make/autoconf/flags-cflags.m4

Print this page
rev 54058 : 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:


 518 
 519   if test "x$TOOLCHAIN_TYPE" = xgcc; then
 520     TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -fcheck-new -fstack-protector"
 521     TOOLCHAIN_CFLAGS_JDK="-pipe -fstack-protector"
 522     # technically NOT for CXX (but since this gives *worse* performance, use
 523     # no-strict-aliasing everywhere!)
 524     TOOLCHAIN_CFLAGS_JDK_CONLY="-fno-strict-aliasing"
 525 
 526   elif test "x$TOOLCHAIN_TYPE" = xclang; then
 527     # Restrict the debug information created by Clang to avoid
 528     # too big object files and speed the build up a little bit
 529     # (see http://llvm.org/bugs/show_bug.cgi?id=7554)
 530     TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -flimit-debug-info"
 531 
 532     # In principle the stack alignment below is cpu- and ABI-dependent and
 533     # should agree with values of StackAlignmentInBytes in various
 534     # src/hotspot/cpu/*/globalDefinitions_*.hpp files, but this value currently
 535     # works for all platforms.
 536     TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -mno-omit-leaf-frame-pointer -mstack-alignment=16"
 537 







 538     if test "x$OPENJDK_TARGET_OS" = xlinux; then
 539       TOOLCHAIN_CFLAGS_JDK="-pipe"
 540       TOOLCHAIN_CFLAGS_JDK_CONLY="-fno-strict-aliasing" # technically NOT for CXX
 541     fi
 542   elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
 543     TOOLCHAIN_FLAGS="-errtags -errfmt"
 544     TOOLCHAIN_CFLAGS="-errshort=tags"
 545 
 546     TOOLCHAIN_CFLAGS_JDK="-mt $TOOLCHAIN_FLAGS"
 547     TOOLCHAIN_CFLAGS_JDK_CONLY="-xCC -Xa -W0,-noglobal $TOOLCHAIN_CFLAGS" # C only
 548     TOOLCHAIN_CFLAGS_JDK_CXXONLY="-features=no%except -norunpath -xnolib" # CXX only
 549     TOOLCHAIN_CFLAGS_JVM="-template=no%extdef -features=no%split_init \
 550         -library=stlport4 -mt -features=no%except $TOOLCHAIN_FLAGS"
 551     if test "x$DEBUG_LEVEL" = xslowdebug; then
 552       # Previously -g was used instead of -g0 for slowdebug; this is equivalent
 553       # to setting +d.
 554       TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM +d"
 555     fi
 556 
 557   elif test "x$TOOLCHAIN_TYPE" = xxlc; then




 518 
 519   if test "x$TOOLCHAIN_TYPE" = xgcc; then
 520     TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -fcheck-new -fstack-protector"
 521     TOOLCHAIN_CFLAGS_JDK="-pipe -fstack-protector"
 522     # technically NOT for CXX (but since this gives *worse* performance, use
 523     # no-strict-aliasing everywhere!)
 524     TOOLCHAIN_CFLAGS_JDK_CONLY="-fno-strict-aliasing"
 525 
 526   elif test "x$TOOLCHAIN_TYPE" = xclang; then
 527     # Restrict the debug information created by Clang to avoid
 528     # too big object files and speed the build up a little bit
 529     # (see http://llvm.org/bugs/show_bug.cgi?id=7554)
 530     TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -flimit-debug-info"
 531 
 532     # In principle the stack alignment below is cpu- and ABI-dependent and
 533     # should agree with values of StackAlignmentInBytes in various
 534     # src/hotspot/cpu/*/globalDefinitions_*.hpp files, but this value currently
 535     # works for all platforms.
 536     TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -mno-omit-leaf-frame-pointer -mstack-alignment=16"
 537 
 538     if test "x$DEBUG_LEVEL" = xrelease; then
 539       # Clang does not inline as much as GCC does for functions with "inline" keyword by default.
 540       # This causes noticeable slowdown in pause time for G1, and possibly in other areas.
 541       # Increasing the inline hint threshold avoids the slowdown for Clang-built JVM.
 542       TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -mllvm -inlinehint-threshold=100000"
 543     fi
 544 
 545     if test "x$OPENJDK_TARGET_OS" = xlinux; then
 546       TOOLCHAIN_CFLAGS_JDK="-pipe"
 547       TOOLCHAIN_CFLAGS_JDK_CONLY="-fno-strict-aliasing" # technically NOT for CXX
 548     fi
 549   elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
 550     TOOLCHAIN_FLAGS="-errtags -errfmt"
 551     TOOLCHAIN_CFLAGS="-errshort=tags"
 552 
 553     TOOLCHAIN_CFLAGS_JDK="-mt $TOOLCHAIN_FLAGS"
 554     TOOLCHAIN_CFLAGS_JDK_CONLY="-xCC -Xa -W0,-noglobal $TOOLCHAIN_CFLAGS" # C only
 555     TOOLCHAIN_CFLAGS_JDK_CXXONLY="-features=no%except -norunpath -xnolib" # CXX only
 556     TOOLCHAIN_CFLAGS_JVM="-template=no%extdef -features=no%split_init \
 557         -library=stlport4 -mt -features=no%except $TOOLCHAIN_FLAGS"
 558     if test "x$DEBUG_LEVEL" = xslowdebug; then
 559       # Previously -g was used instead of -g0 for slowdebug; this is equivalent
 560       # to setting +d.
 561       TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM +d"
 562     fi
 563 
 564   elif test "x$TOOLCHAIN_TYPE" = xxlc; then


< prev index next >