User:Gso321/Benchmarks
These are my custom benchmarks that I run on my gentoo linux.
LLVM and Clang with BOLT-PGO.cmake
Building LLVM took more than 4 hours with 8 jobs for my machine. Uname -a was Linux tux 6.6.67-gentoo-gentoo-dist #1 SMP PREEMPT_DYNAMIC Wed Jan 8 20:53:16 EST 2025 x86_64 Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz GenuineIntel GNU/Linux.
Install LLVM:
user $
git clone https://github.com/llvm/llvm-project.git
user $
cd llvm-project
user $
mkdir build
user $
cd build
Run the commands to build LLVM:
cmake -S ../llvm -G Ninja -C ../clang/cmake/caches/BOLT-PGO.cmake \ -DBOOTSTRAP_LLVM_ENABLE_LLD=ON \ -DBOOTSTRAP_BOOTSTRAP_LLVM_ENABLE_LLD=ON \ -DPGO_INSTRUMENT_LTO=Thin \ -DCMAKE_INSTALL_PREFIX="/home/kael/llvm-project/bin" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_ENABLE_ASSERTIONS=OFF -DLLVM_ENABLE_PROJECTS="bolt;clang;lld;polly" -DCMAKE_C_FLAGS="-O3 -march=native -pipe -fmerge-all-constants -fpointer-tbaa" -DCMAKE_CXX_FLAGS="-O3 -march=native -pipe -fmerge-all-constants -fpointer-tbaa" -DCMAKE_C_COMPILER="clang" -DCMAKE_CXX_COMPILER="clang++" -DLLVM_ENABLE_LTO="Thin" -DLLVM_ENABLE_LLD="true"
ninja -j8
Both were clean and run with the commands:
user $
make clean
user $
time make LLVM=1
Original LLVM is llvm-core/llvm 19.1.4 build with -O2 -march=native -pipe First when building the 6.6.67-gentoo kernel, the time command showed:
real 53m3.855s user 55m38.382s sys 2m34.281s
Building the kernel using LLVM 20.0.0git 14b44179cb61dd551c911dea54de57b588621005 showed:
real 48m18.362s user 50m38.903s
This new LLVM saves about 9% real time.