[clang] Workaround for MSVC ARM64 build performance regression (PR #65215)
Tobias Hieta via cfe-commits
cfe-commits at lists.llvm.org
Sun Sep 3 02:18:14 PDT 2023
================
@@ -30,6 +30,15 @@ set(LLVM_LINK_COMPONENTS
TransformUtils
)
+# Workaround for MSVC ARM64 performance regression: disable all optimizations (/Od)
+# and then enable back all /O2 options except one.
+if(NOT CMAKE_BUILD_TYPE MATCHES Debug
+ AND MSVC
+ AND MSVC_VERSION VERSION_GREATER_EQUAL 1932
+ AND CMAKE_SYSTEM_PROCESSOR MATCHES "ARM64")
+ set_source_files_properties(CGBuiltin.cpp PROPERTIES COMPILE_FLAGS "/Od /Gw /Oi /Oy /Gy /Ob2 /Ot /GF")
----------------
tru wrote:
You are setting these settings for all configurations and erasing the other flags set for these files. I don't think that's the right solution. I would rather you grab the current compile_flags and then substitute the optimization flags only.
https://github.com/llvm/llvm-project/pull/65215
More information about the cfe-commits
mailing list