[llvm] [dwarf] make dwarf fission compatible with RISCV relaxations 1/2 (PR #166597)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 6 13:52:37 PST 2025
dlav-sc wrote:
> Doesn't seem so different? It computes the difference between two labels if it can be known at compile time - so... if there is no compile-time answer, that means it's relaxable & so can't use a label difference range encoding.
Well, perhaps not entirely different, but as I understand, one of the conditions for `absoluteSymbolDiff` to return true is that the `Hi` and `Lo` symbols must be in the same fragment. I'm not sure there are no scenarios where function boundaries reside in different fragments but the function remains non-relaxable. In contrast, `isRangeRelaxable` collects all fragments between two labels and ensures there are no relaxable fragments between them.
Therefore, `absoluteSymbolDiff` imposes a stricter condition than `isRangeRelaxable`, which could result in less optimal DWARF information. However, I believe this trade-off is acceptable, and we can proceed with generating slightly less optimal DWARF.
I attempted to use `absoluteSymbolDiff` but observed some degradation for x86 in the second part of the patch (see `llvm/test/DebugInfo/X86/fission-ranges.ll` in https://github.com/llvm/llvm-project/pull/164813) . Rather than using the addr+offset form for low/high PC description, it now uses addrx/addrx for some functions. If this is acceptable, we can keep the current version of the patch.
https://github.com/llvm/llvm-project/pull/166597
More information about the llvm-commits
mailing list