IR: an option to automatically select the number of lowering threads

This commit is contained in:
Georgy Bronnikov
2020-11-06 13:56:48 +03:00
parent 52b3cb362b
commit 103f82c95c
5 changed files with 13 additions and 9 deletions
@@ -292,7 +292,9 @@ fun CompilerConfiguration.configureAdvancedJvmOptions(arguments: K2JVMCompilerAr
arguments.declarationsOutputPath?.let { put(JVMConfigurationKeys.DECLARATIONS_JSON_PATH, it) }
put(CommonConfigurationKeys.THREADS_FOR_FILE_LOWERINGS, arguments.threadsForFileLowerings.toIntOrNull() ?: 1)
val nThreadsRaw = arguments.parallelBackendThreads.toIntOrNull() ?: 1
val nThreads = if (nThreadsRaw == 0) Runtime.getRuntime().availableProcessors() else nThreadsRaw
put(CommonConfigurationKeys.PARALLEL_BACKEND_THREADS, nThreads)
}
fun CompilerConfiguration.configureKlibPaths(arguments: K2JVMCompilerArguments) {