output optimization report if enable-profiling=1

This commit is contained in:
derselbst 2018-01-03 16:40:53 +01:00
parent dd2b78a842
commit df6fad7d83

View file

@ -265,6 +265,15 @@ endif ( enable-floats )
unset ( WITH_PROFILING CACHE )
if ( enable-profiling )
set ( WITH_PROFILING 1 )
if ( CMAKE_C_COMPILER_ID STREQUAL "Clang" )
set ( OPT_FLAGS "-Rpass=loop-vectorize -Rpass-analysis=loop-vectorize" )
elseif ( CMAKE_C_COMPILER_ID STREQUAL "Intel" )
set ( OPT_FLAGS "-qopt-report=3" )
endif ( )
set ( CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${OPT_FLAGS}" )
set ( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${OPT_FLAGS}" )
set ( CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${OPT_FLAGS}" )
endif ( enable-profiling )
unset ( ENABLE_TRAPONFPE CACHE )