From ef9c2d80de3e6135f5a7050811ec90a31ece178d Mon Sep 17 00:00:00 2001 From: Mark Fedorov Date: Wed, 21 Dec 2022 00:08:18 +0300 Subject: [PATCH] Introduce an -fpeel-loops flag for GCC build. This improves performance of scalar-optimized code by 1.5 times as well as fixes #433. --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cae27c3b..d8d2f029 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,14 +26,14 @@ include_directories(${OPENSSL_INCLUDE_DIR}) set(OPENSSL_MODULES_DIR ${CMAKE_INSTALL_LIBDIR}/ossl-modules) if (CMAKE_C_COMPILER_ID MATCHES "Clang") - set(CMAKE_C_FLAGS_RELEASE -O2) + set(CMAKE_C_FLAGS_RELEASE "-O2") set(CMAKE_C_FLAGS_DEBUG "-O0 -ggdb") set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -ggdb") add_compile_options(-Werror -Wall -Wno-unused-parameter -Wno-unused-function -Wno-missing-braces -Qunused-arguments -Wno-deprecated-declarations) elseif(CMAKE_C_COMPILER_ID MATCHES "GNU") - set(CMAKE_C_FLAGS_RELEASE -O2) + set(CMAKE_C_FLAGS_RELEASE "-O2 -fpeel-loops") set(CMAKE_C_FLAGS_DEBUG "-O0 -ggdb") - set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -ggdb") + set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -fpeel-loops -ggdb") add_compile_options(-Werror -Wall -Wno-unused-parameter -Wno-unused-function -Wno-missing-braces -Wno-error=unknown-pragmas -Wno-error=pragmas -Wno-deprecated-declarations) elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC") add_definitions(-D_CRT_SECURE_NO_WARNINGS)