[clang] [llvm] [dwarf] make dwarf fission compatible with RISCV relaxations (PR #164128)

via cfe-commits cfe-commits at lists.llvm.org
Sat Oct 18 15:06:39 PDT 2025


dlav-sc wrote:

Out of curiosity, I decided to compare the linking time and final binary size with and without DWARF fission in riscv with `-mrelax` option. Since relaxations force us to use the least optimal DWARF form (`StartxEndx`), we expect the improvements of split-dwarf to be less than usual.

For measurements, I used `clang` as a test program and collected results for debug builds (CMAKE_BUILD_TYPE=Debug) on my machine with the following configurations:

**With options:**
LLVM_USE_SPLIT_DWARF=ON and CMAKE_C_FLAGS, CMAKE_CXX_FLAGS with -gsplit-dwarf
Size: 1.15 GB
Linking time: 12m11s

**Without options:**
Size: 1.82 GB
Linking time: 13m26s

The results show that linking with the `-gsplit-dwarf` option takes approximately 10% less time than linking without fission, and the size of the resulting binary with dwarf fission is around 40% smaller.

Honestly, I'm not sure how well this benchmark reflects real-world scenarios. I might have missed some significant options when configuring the clang debug build and I only ran these builds on my local machine, so the results might differ on other platforms. However, I believe the results still reflect the general trend.

https://github.com/llvm/llvm-project/pull/164128


More information about the cfe-commits mailing list