[PATCH] D99683: [HIP] Support ThinLTO

Teresa Johnson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 5 08:58:27 PDT 2021


tejohnson added a comment.

In D99683#2669047 <https://reviews.llvm.org/D99683#2669047>, @yaxunl wrote:

> In D99683#2664674 <https://reviews.llvm.org/D99683#2664674>, @tejohnson wrote:
>
>> I haven't looked extensively yet, but why import noinline functions? Also, please add a patch description.
>
> AMDGPU backend does not support linking of object files containing external symbols, i.e. one object file calling a function defined in another object file. Therefore the LLVM module passed to AMDGPU backend needs to contain definitions of all callees, even if a callee has noinline attribute. To support backends like this, the function importer needs to be able to import functions with noinline attribute. Therefore we add an LLVM option for allowing that, which is off by default. We have comments at line 70 of HIP.cpp about this.

How does a non-LTO build work, or is (full) LTO currently required? Because with ThinLTO we only import functions that are externally defined but referenced in the current module. Also, when ThinLTO imports functions it makes them available_externally, which means they are dropped and made external symbols again after inlining. So anything imported but not inlined will go back to being an external symbol.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99683/new/

https://reviews.llvm.org/D99683



More information about the cfe-commits mailing list