[PATCH] Add new LLVM_OPTIMIZED_TABLEGEN build setting which configures, builds and uses a release tablegen build when LLVM is configured with assertions enabled.

Chris Bieneman beanz at apple.com
Mon Feb 2 14:12:33 PST 2015


I just did a test building libLLVMARMCodeGen.a. The process I followed was:

cbieneman at MacBook-Pro ~/d/o/llvm-build-dbg> rm -rf ./*
cbieneman at MacBook-Pro ~/d/o/llvm-build-dbg> cmake -G "Sublime Text 2 - Ninja" -DCMAKE_BUILD_TYPE=Debug -DLLVM_OPTIMIZED_TABLEGEN=On -DLLVM_TARGETS_TO_BUILD="ARM" ../llvm
...
cbieneman at MacBook-Pro ~/d/o/llvm-build-dbg> ninja native/bin/llvm-tblgen
...
cbieneman at MacBook-Pro ~/d/o/llvm-build-dbg> ninja llvm-tblgen
...
cbieneman at MacBook-Pro ~/d/o/llvm-build-dbg> time ninja lib/libLLVMARMCodeGen.a
[56/56] Linking CXX static library lib/libLLVMARMCodeGen.a

  31.50 real       101.88 user         7.93 sys

cbieneman at MacBook-Pro ~/d/o/llvm-build-dbg-2> rm -rf ./*
cbieneman at MacBook-Pro ~/d/o/llvm-build-dbg-2> cmake -G "Sublime Text 2 - Ninja" -DCMAKE_BUILD_TYPE=Debug -DLLVM_OPTIMIZED_TABLEGEN=Off -DLLVM_TARGETS_TO_BUILD="ARM" ../llvm
...
cbieneman at MacBook-Pro ~/d/o/llvm-build-dbg-2> ninja llvm-tblgen
...
cbieneman at MacBook-Pro ~/d/o/llvm-build-dbg-2> time ninja lib/libLLVMARMCodeGen.a
[56/56] Linking CXX static library lib/libLLVMARMCodeGen.a

  40.85 real       134.16 user         8.14 sys

Using a release tablegen shaved 9 seconds of the libLLVMARMCodeGen.a build time.

In my test you will notice the use of different build directories, and that I pre-built tablegen so that its build time wasn’t factored into the build. My changes do cause tablegen to be built twice, which can be a bit of a slowdown, but the savings on incremental builds, and when building all backends is substantial.

-Chris


http://reviews.llvm.org/D7349

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list