From 7d8360f38b858a232621663ca6f91bc65623183a Mon Sep 17 00:00:00 2001 From: Sergey Bogolepov Date: Wed, 28 Jul 2021 18:42:33 +0700 Subject: [PATCH] [K/N] Set target-features for host targets Benchmarks on CI show that there are some performance regressions after LLVM update due to worse inliner results. Explicit specification of target-features fixes the problem. Interestingly, it seems that this is not required for Darwin AArch64 target. --- kotlin-native/konan/konan.properties | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kotlin-native/konan/konan.properties b/kotlin-native/konan/konan.properties index c92289b9fdd..3339a53272e 100644 --- a/kotlin-native/konan/konan.properties +++ b/kotlin-native/konan/konan.properties @@ -108,6 +108,7 @@ targetToolchain.macos_arm64-macos_x64 = target-toolchain-xcode_12_5 targetTriple.macos_x64 = x86_64-apple-macos targetSysRoot.macos_x64 = target-sysroot-xcode_12_5-macosx targetCpu.macos_x64 = core2 +targetCpuFeatures.macos_x64=+cx16,+cx8,+fxsr,+mmx,+sahf,+sse,+sse2,+sse3,+sse4.1,+ssse3,+x87 clangFlags.macos_x64 = -cc1 -emit-obj -disable-llvm-passes -x ir clangNooptFlags.macos_x64 = -O1 clangOptFlags.macos_x64 = -O3 @@ -522,6 +523,7 @@ targetSysRoot.linux_x64 = $gccToolchain.linux_x64/x86_64-unknown-linux-gnu/sysro # targetSysroot-relative. libGcc.linux_x64 = ../../lib/gcc/x86_64-unknown-linux-gnu/8.3.0 targetCpu.linux_x64 = x86-64 +targetCpuFeatures.linux_x64 = +cx8,+fxsr,+mmx,+sse,+sse2,+x87 clangFlags.linux_x64 = -cc1 -target-cpu $targetCpu.linux_x64 -emit-obj -disable-llvm-optzns -x ir \ -ffunction-sections -fdata-sections clangNooptFlags.linux_x64 = -O1 @@ -894,6 +896,7 @@ dependencies.mingw_x64 = \ targetTriple.mingw_x64 = x86_64-pc-windows-gnu targetSysRoot.mingw_x64 = msys2-mingw-w64-x86_64-clang-llvm-lld-compiler_rt-8.0.1 targetCpu.mingw_x64 = x86-64 +targetCpuFeatures.mingw_x64 = +cx8,+fxsr,+mmx,+sse,+sse2,+x87 # For using with Universal Windows Platform (UWP) we need to use this slower option. # See https://youtrack.jetbrains.com/issue/KT-27654. # TODO: remove, once fixed in mingw, check with the bug testcase.