From adcc745cc0f66a6a93bb281999c55cea0a10b7d2 Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Sat, 5 Oct 2024 18:01:49 -0400 Subject: [PATCH] More flags Signed-off-by: Juan Cruz Viotti --- vendor/noa/cmake/noa/compiler/options.cmake | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/vendor/noa/cmake/noa/compiler/options.cmake b/vendor/noa/cmake/noa/compiler/options.cmake index d496ebc65..be6145387 100644 --- a/vendor/noa/cmake/noa/compiler/options.cmake +++ b/vendor/noa/cmake/noa/compiler/options.cmake @@ -44,6 +44,9 @@ function(noa_add_default_options visibility target) -fstrict-aliasing -ftree-vectorize + # To improve how much GCC/Clang will vectorize + -fno-math-errno + # Assume that signed arithmetic overflow of addition, subtraction and # multiplication wraps around using twos-complement representation # See https://users.cs.utah.edu/~regehr/papers/overflow12.pdf @@ -79,10 +82,12 @@ function(noa_add_default_options visibility target) -fslp-vectorize) elseif(NOA_COMPILER_GCC) target_compile_options("${target}" ${visibility} - # To improve how much GCC will vectorize - -fno-math-errno -fno-trapping-math + # More aggressive vectoring (GCC >= 8) + -mprefer-vector + -width=512 + # Newer versions of GCC (i.e. 14) seem to print a lot of false-positives here -Wno-dangling-reference @@ -95,13 +100,16 @@ endfunction() # - On Clang , seems to only take effect on release shared builds # - On GCC, seems to only take effect on release shared builds function(noa_add_vectorization_diagnostics target) - # See https://llvm.org/docs/Vectorizers.html#id6 - if(NOA_COMPILER_LLVM) + if(NOA_COMPILER_MSVC) + target_compile_options("${target}" PRIVATE "-Qvec-report:[1,2]") + elseif(NOA_COMPILER_LLVM) + # See https://llvm.org/docs/Vectorizers.html#id6 target_compile_options("${target}" PRIVATE -Rpass-analysis=loop-vectorize -Rpass-missed=loop-vectorize) elseif(NOA_COMPILER_GCC) target_compile_options("${target}" PRIVATE - -fopt-info-vec-missed) + -fopt-info-vec-missed + -fopt-info-loop-missed) endif() endfunction()