[clang] Correctly link and optimize device libraries with -mlink-builtin-bitcode (PR #69371)

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 19 09:40:59 PDT 2023


jhuber6 wrote:

> > You could potentially link in all the symbols and internalize them
> 
> That probably won't work. After they are internalized, they have internal linkage and cannot be used to resolve newly added call of the same function.
> 
> The purpose of internalization is to allow you to optimize those functions, e.g. changing their signatures. After internalization, there is no guarantee they behave like the original functions.

I meant this more in this particular case, if we internalize but keep all the symbols, then the functions will be preserved so we can call them inside of the module when the AMDGPU pass is run. This would then rely on some later pass to strip out the unused ones.

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


More information about the cfe-commits mailing list