The source code for the compiler time tracker is available at nikic/llvm-compile-time-tracker. The raw data is available at nikic/llvm-compile-time-data.
If you are an LLVM contributor who regularly does compile-time sensitive work and would like to test the compile-time impact of your patches before they land, contact me at llvm@npopov.com with a link to your GitHub fork of llvm-project. Once your fork is added, any branches starting with `perf/` will get measured.
The compile time tracker tests the CTMark portion of the LLVM test-suite against specific cached CMake configurations. You can set up a test-suite build as follows:
git clone https://github.com/llvm/llvm-test-suite.git mkdir build cd build cmake .. -G Ninja \ -C ../cmake/caches/$CONFIG.cmake \ -DCMAKE_C_COMPILER=$PATH_TO_CLANG
The $CONFIGs used by the tracker are O3, ReleaseThinLTO, ReleaseLTO-g and O0-g.
Next, you will want to pick out a single file with a particularly large regression by enabling the "Per-file details" checkbox on the comparison page. Let's assume we pick CMakeFiles/lencod.dir/rdopt.c.o. The compiler invocation can be obtained using `ninja -v lencod`, after which it can be modified to prepend your favorite profiling tool. For example:
valgrind --tool=callgrind $PATH_TO_CLANG -DNDEBUG -O3 -w -Werror=date-time -fcommon -D__USE_LARGEFILE64 -D_FILE_OFFSET_BITS=64 -MD -MT MultiSource/Applications/JM/lencod/CMakeFiles/lencod.dir/rdopt_coding_state.c.o -MF MultiSource/Applications/JM/lencod/CMakeFiles/lencod.dir/rdopt_coding_state.c.o.d -o MultiSource/Applications/JM/lencod/CMakeFiles/lencod.dir/rdopt_coding_state.c.o -c ../MultiSource/Applications/JM/lencod/rdopt_coding_state.c