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

Erik Olofsson Erik.Olofsson at hansoft.se
Tue Mar 1 18:05:20 PST 2011


> -----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? I will start working on a patch which is split.

Some benchmarks on 8 core machine:
Without /MP
Full build time: 749 s
Change Lexer.h: 122 s

With /MP
Full build time: 461 s, and here 33% of the time is spent sequentially by tblgen.
Change Lexer.h: 51 s

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.

Regards,
Erik




More information about the llvm-commits mailing list