[llvm] r254917 - Link declaration lazily.

Tobias Edler Von Koch via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 9 09:33:21 PST 2015


Hi Rafael,

On 12/08/2015 08:25 PM, Rafael EspĂ­ndola via llvm-commits wrote:
> Note that the behaviour was not "preserve all globals". We were
> already lazy linking declarations that can be dropped, like
> linkonce_odr and internal.

We're actually hitting an issue related to that. Our linker, during LTO, 
sometimes puts linkonce/linkonce_odr functions on the preserve list. 
However, this has currently no effect as they could be deleted a) during 
lazy IR linking if there are no uses to begin with, or b) during DCE if, 
say, they were inlined completely.

To handle case b) we can introduce a use through @llvm.compiler.used in 
LTOCodeGenerator::applyRestriction but for a) that doesn't work because 
IR linking happens earlier.

Any ideas?

Thanks,
Tobias

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.



More information about the llvm-commits mailing list