Issue 140386
Summary Clang/Clang++ 20.1.5 major performance regression comparing to 20.1.3
Labels clang
Assignees
Reporter T-Maxxx
    I have noticed major performance regression during even CMake configure stage (where some tests are compiled and run to get compiler capabilities).
### Stage 1. Compile LLVM 20.1.5 using system gcc.

Get LLVM 20.1.5 sources:
```bash
cd /tmp/projects/
wget -O llvm-project.src.tar.xz https://github.com/llvm/llvm-project/releases/download/llvmorg-20.1.5/llvm-project-20.1.5.src.tar.xz
tar -xf llvm-project.src.tar.xz
mv llvm-project*.src llvm_src
```
Configure (CMake version may be of your choice):
```bash
/tmp/programs/cmake/3.31.5/bin/cmake \
      -S /tmp/projects/llvm_src/llvm/ \
      -B /tmp/projects/llvm_build/ \
 -G "Ninja" \
      -DCMAKE_INSTALL_PREFIX=/tmp/programs/clang/20.1.5-gcc \
      -DCMAKE_BUILD_TYPE=Release \
 -DLLVM_ENABLE_PROJECTS="clang;lld;clang-tools-extra" \
 -DLLVM_ENABLE_RUNTIMES="compiler-rt;libcxx;libcxxabi;libunwind"
```
Notice CMake configure time (for me is about **8.8** seconds).
Build:
```
/tmp/programs/cmake/3.31.5/bin/cmake \
 --build /tmp/projects/llvm_build/ \
      --target install -- -j $(nproc)
```
Now we have unoptimized (kinda) installation of LLVM 20.1.5.

#### Stage 2. Compile LLVM 20.1.5 using just built LLVM 20.1.5 with GCC

Configure:
```bash
rm -rf llvm_build/
/tmp/programs/cmake/3.31.5/bin/cmake \
      -S /tmp/projects/llvm_src/llvm/ \
      -B /tmp/projects/llvm_build/ \
 -G "Ninja" \
      -DCMAKE_INSTALL_PREFIX=/tmp/programs/clang/20.1.5 \
 -DCMAKE_BUILD_TYPE=Release \
 -DLLVM_ENABLE_PROJECTS="clang;lld;clang-tools-extra" \
 -DLLVM_ENABLE_RUNTIMES="compiler-rt;libcxx;libcxxabi;libunwind" \
 -DCMAKE_C_COMPILER=/tmp/programs/clang/20.1.5-gcc/bin/clang \
 -DCMAKE_CXX_COMPILER=/tmp/programs/clang/20.1.5-gcc/bin/clang++ \
 -DLLVM_ENABLE_LLD=On
```
Notice CMake configure time significantly increased (for me is about **44** seconds now).

After LLVM is built, I tried to use it to build our project. Well, it failed even to build gRPC dependency for 1.5 hours utilizing 100% of CPU. 

TODO: I'll add 20.1.4 and 20.1.3 comparisons a bit later.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to