================ @@ -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:
Yeah I think this is what we want. We don't want to assume what the current flags are. Does it only happen in Release and RelWithDebInfo configurations? In that case you can maybe use generator expressions to only happen for those configurations? Btw I noticed that COMPILE_FLAGS is deprecated and COMPILE_OPTIONS should be used instead, so maybe look into that as well? https://github.com/llvm/llvm-project/pull/65215 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits