[llvm-dev] ThinLTO Problem

David Blaikie via llvm-dev llvm-dev at lists.llvm.org
Wed Nov 27 07:36:01 PST 2019


On Wed, Nov 27, 2019 at 6:29 AM chenmindong via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Hi,
>
> I'm working on enabling thinLTO for our custom backend on LLVM-8 with lld
> to get code size benefits from dead symbol elimination.


If you only want this - is -ffunction-sections -fdata-sections
-Wl,-gc-sections sufficient?


> The code in LTO::run() of LTO.cpp confuses me that, even though thinLTO is
> specified, runRegularLTO() will be run first and its return value
> determines whether runThinLTO() will be executed.
>
> My question is if it's clearly known that thinLTO is used, is it still
> necessary to execute runRegularLTO()?If it is, what's the reason behind?
> For now our custom backend, where distributed thinLTO is adopted, it works
> fine as I removed the line executing runRegularLTO(). But if I preserve it,
> the code fails the `if (Conf.PostInternalizeModuleHook
> &&!Conf.PostInternalizeModuleHook(0, *RegularLTO.CombinedModule))`, which I
> also don't understand, and fall through to backend() and abort there. I
> believe something is missed during adding the target support but cannot
> figure it out. Could anyone help?
>
> Regards,
> Mindong Chen
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20191127/c61c7362/attachment.html>


More information about the llvm-dev mailing list