From df6fad7d836044095cdad9ac8b295c65da07f06d Mon Sep 17 00:00:00 2001 From: derselbst Date: Wed, 3 Jan 2018 16:40:53 +0100 Subject: [PATCH] output optimization report if enable-profiling=1 --- CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 15a2b2dc..a6c97c77 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 )