[lld] [llvm] [NFCI][LTO][lld] Optimize away symbol copies within LTO global resolution in ELF (PR #106193)

Mingming Liu via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 30 11:17:28 PDT 2024


minglotus-6 wrote:

When a bitcode file is parsed lazily [1], undefined symbols in a module won't [get saved](https://github.com/llvm/llvm-project/blob/2c7e1b8893061fdf487f2d9945d2d1eecd59a604/lld/ELF/InputFiles.cpp#L1799-L1802). In a LTO unit, a symbol is saved as long as one module defines it.

I'll add some logs in LTO class to see how undefined symbols are resolved. If LTO cannot rely on string savers' copies for undefined symbols, it needs to keep copies of undefined symbols itself (still a subset).

[1] https://github.com/llvm/llvm-project/blob/2c7e1b8893061fdf487f2d9945d2d1eecd59a604/lld/ELF/InputFiles.h#L142-L144

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


More information about the llvm-commits mailing list