[llvm] [Internalize] Preserve built-in functions (PR #69216)

via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 17 15:26:10 PDT 2023


DianQK wrote:

> Can you add some more description of the motivation? Specifically, why doesn't the earlier referenced patch ([e06bac4](https://github.com/llvm/llvm-project/commit/e06bac4796bffed2b80649497afaadfb67d767cf)) address this issue (for the existing list of runtime libcalls)?

This is because rust calls the `internalizeModule` method directly when implementing LTO. https://github.com/rust-lang/rust/blob/94ba57cef4987cfc1aee063ff459bcd2ff2f3fab/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp#L1146
So I think it's appropriate to add a similar rule here. In fact here are some similar rules I mentioned in the issue. For example `__ssp_canary_word`.

> Also, this patch seems to have 2 aspects, where the second is to expand the list of runtime libcalls. Can you give some more background on that aspect of the change?
Newly added built-in functions are also internalized as a result of participation in LTO.
I'm sorry I'm not really sure what additional impact the extended list will have.


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


More information about the llvm-commits mailing list