[llvm-commits] [PATCH] Add MSVC multi processor compilation to build system

Óscar Fuentes ofv at wanadoo.es
Tue Mar 1 19:13:27 PST 2011


Erik Olofsson <Erik.Olofsson at hansoft.se> writes:

>> -----Original Message-----
>> From: Óscar Fuentes [mailto:ofv at wanadoo.es]
>>
>> if( MSVC_IDE )
>>   set(LLVM_COMPILER_JOBS "0" CACHE STRING
>>     "Number of parallel compiler jobs. 0 means use all processors. Default is
>> 0.")
>>   if( NOT LLVM_COMPILER_JOBS STREQUAL "1" )
>>     if( LLVM_COMPILER_JOBS STREQUAL "0" )
>>       add_llvm_definitions( /MP )
>>     else
>>       add_llvm_definitions( /MP${LLVM_COMPILER_JOBS} )
>>   endif()
>> endif()
>
> Yes, this is even better. Would you like that code in
> HandleLLVMOptions.cmake or CMakeLists.txt or both with option
> definition split from logic?

Put everything in HandleLLVMOptions.cmake, so it can be used when Clang
is built using LLVM as an external library.

> I will start working on a patch which is split.

[snip]

Looks quite worthwhile.

> Generally it seems that there are a lot of dependencies specified
> between static libraries that are not needed. This prevents parallel
> project compilation for a large part of the project. This could be
> looked into later for almost another halving of compile time if we
> also fix tblgen.

Certainly, there are superfluous tblgen dependencies, but accurately
determining them is tricky. About the dependencies between libraries,
there are some among LLVM targets and its subsidiaries (e.g. LLVMX86 and
LLVMX86AsmParser) and sometimes a dependency is declared from a library
into another when, actually, it should be on its tablegenned products
(e.g. LLVMX86 depending on LLVMTarget). In general, those cases can be
easily fixed, although I've seen cases of linker errors on Linux due to
missing vtables while linking the LLVM tools. If you know more instances
of unnecessary inter-library dependencies, please mention them.

Parallel builds work fine on Linux with make -jN, there is little room
to improve, but it seems that tablegenning on Windows is slow (in
release mode, if you are building on debug mode it can take a very long
time. I thought about always building tblgen.exe on release mode for
avoiding such excruciating build times.)




More information about the llvm-commits mailing list