[llvm-commits] [PATCH] CMake option for enabling optimization for utilities in debug build

Erik Olofsson Erik.Olofsson at hansoft.se
Sun Mar 20 21:25:46 PDT 2011


On 20 mar 2011, at 23.20, Óscar Fuentes wrote:

> Hello Erik.
> 
> I need to know something before we enter a deeper discussion about this
> issue: apart from tblgen, do we really benefit from using the other
> utilities compiled on release mode while working with a debug build? We
> know that using an optimized tblgen makes a difference, but I'll like to
> know about the other utils. Your attached benchmark does not show a
> significant gain for `make check-all' on OSX (only 7 seconds). OTOH, it
> improves 18 seconds the OSX build, which IMHO is not worthwhile. The
> real improvement is on VC++, but there you don't show the statistics for
> `check-all'. The speedup on build time are due to tblgen, which leaves
> us to...

No, actually on Windows it turned out to make no difference at all on test time.

[snip]

> 200+ lines of code for that feature? No way! :-)
> 
> I think we can implement what you want with a simple modification to
> cmake/modules/CrossCompiling.cmake and configuring with
> 
> cmake -DLLVM_TABLEGEN=buildit ...
> 
> in that case it will act as if CMAKE_CROSSCOMPILING where active, build
> the external tblgen and set LLVM_TABLEGEN_EXE.
> 
> I don't expect more than 15 lines for those tasks. If I had a decent
> Windows machine instead of a virtual one, it would already be
> done. Seeing that you really want to speedup the VC++ debug build, I'll
> reserve an hour this week to implement the feature :-)

So i tried this solution and it turned out that all kinds of dependencies
were broken when doing this on Visual Studio. When you set
LLVM_TABLEGEN_EXE to something else CMake will omit adding
dependencies to tblgen on all projects that should have it as dependency.
I added those manually.

Many of the changes to CrossCompileLLVM.cmake was needed to make
it not compile and compile again creating a new tblgen.exe that caused
all Tablegenning to be run each build.

I also had to add the source files as dependencies so it would actually
run again when something in tblgen changed. This could probably be
fixed by changing the dependency on tblgen to NativeTableGen on 
all projects, then reverse the dependencies between tblgen and 
NativeTableGen. Then you just needs a DEPENDS on the output of
tblgen to get the correct dependency checking for when NativeTableGen
is supposed to rebuild.

See attached patches and new benchmarks. All in all the patch is almost
as large as the last one and touches more files :)

Regards,
Erik
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: benchmarks.txt
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110321/c0ff8a60/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: llvm-release-tblgen.patch.txt
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110321/c0ff8a60/attachment-0001.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: clang-release-tblgen.patch.txt
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110321/c0ff8a60/attachment-0002.txt>


More information about the llvm-commits mailing list