summaryrefslogtreecommitdiffhomepage
path: root/cmake/mingw-w64.cmake
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-06-06 10:43:36 +0200
committerStanislaw Halik <sthalik@misaki.pl>2015-06-06 10:43:36 +0200
commitc52bb357b551e8a4490be2863bee19934ed7ef12 (patch)
tree564d5d4dda38035f9d9c3fdad9159b88a56250e8 /cmake/mingw-w64.cmake
parent3d4522d60683ed5a3ddb2873f8623ed13306d265 (diff)
cmake: apply more optimizations to release builds
This MAY break support on hardware like AMD or older Intel CPUs. In this case revert this commit.
Diffstat (limited to 'cmake/mingw-w64.cmake')
-rw-r--r--cmake/mingw-w64.cmake10
1 files changed, 8 insertions, 2 deletions
diff --git a/cmake/mingw-w64.cmake b/cmake/mingw-w64.cmake
index b2999520..7be20cff 100644
--- a/cmake/mingw-w64.cmake
+++ b/cmake/mingw-w64.cmake
@@ -20,8 +20,14 @@ SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
-set(CMAKE_C_FLAGS_RELEASE "-O3 -ffast-math -flto -fno-use-linker-plugin -march=i686 -mtune=corei7-avx -mfpmath=both -msse -msse2 -mno-sse3 -mno-avx -frename-registers" CACHE STRING "" FORCE)
-set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "-msse -msse2 -mno-sse3 -mno-avx -fno-use-linker-plugin -flto" CACHE STRING "" FORCE)
+set(lto "-flto -flto-partition=none -fno-use-linker-plugin")
+set(rice2 "-ftree-vectorize -fivopts -fweb")
+set(rice3 "-ffast-math -mfpmath=both -frename-registers -funsafe-loop-optimizations")
+set(rice4 "-fgcse-sm -fgcse-las -fgcse-after-reload")
+set(rice5 "-fmodulo-sched -fmodulo-sched-allow-regmoves")
+set(rice "${rice2} ${rice3} ${rice4} ${rice5}")
+set(CMAKE_C_FLAGS_RELEASE "-O3 ${lto} ${rice} -march=i686 -mtune=corei7-avx -msse -msse2 -mno-sse3 -mno-avx" CACHE STRING "" FORCE)
+set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "-msse -msse2 -mno-sse3 -mno-avx ${lto}" CACHE STRING "" FORCE)
set(CMAKE_EXE_LINKER_FLAGS_RELEASE ${CMAKE_SHARED_LINKER_FLAGS_RELEASE})
set(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE} CACHE STRING "" FORCE)
set(CMAKE_BUILD_TYPE "RELEASE" CACHE STRING "" FORCE)