[llvm] r256003 - [ThinLTO/LTO] Don't link in unneeded metadata

Ahmed Bougacha via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 5 16:24:13 PST 2016


On Fri, Dec 18, 2015 at 9:51 AM, Teresa Johnson via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> Author: tejohnson
> Date: Fri Dec 18 11:51:37 2015
> New Revision: 256003
>
> URL: http://llvm.org/viewvc/llvm-project?rev=256003&view=rev
> Log:
> [ThinLTO/LTO] Don't link in unneeded metadata
>
> Summary:
> Third patch split out from http://reviews.llvm.org/D14752.
>
> Only map in needed DISubroutine metadata (imported or otherwise linked
> in functions and other DISubroutine referenced by inlined instructions).
> This is supported for ThinLTO, LTO and llvm-link --only-needed, with
> associated tests for each one.
>
> Depends on D14838.
>
> Reviewers: dexonsmith, joker.eph
>
> Subscribers: davidxl, llvm-commits, joker.eph
>
> Differential Revision: http://reviews.llvm.org/D14843
>
> Added:
>     llvm/trunk/test/Linker/Inputs/only-needed-debug-metadata.ll
>     llvm/trunk/test/Linker/only-needed-debug-metadata.ll
> Modified:
>     llvm/trunk/include/llvm/Transforms/Utils/ValueMapper.h
>     llvm/trunk/lib/Linker/IRMover.cpp
>     llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp
>     llvm/trunk/test/Linker/thinlto_funcimport_debug.ll
>     llvm/trunk/test/tools/gold/X86/Inputs/linkonce-weak.ll
>     llvm/trunk/test/tools/gold/X86/linkonce-weak.ll
>
> Modified: llvm/trunk/lib/Linker/IRMover.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Linker/IRMover.cpp?rev=256003&r1=256002&r2=256003&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Linker/IRMover.cpp (original)
> +++ llvm/trunk/lib/Linker/IRMover.cpp Fri Dec 18 11:51:37 2015
> @@ -487,6 +495,16 @@ class IRLinker {
>
>    void linkNamedMDNodes();
>
> +  /// Populate the UnneededSubprograms set with the DISubprogram metadata
> +  /// from the source module that we don't need to link into the dest module,
> +  /// because the functions were not imported directly or via an inlined body
> +  /// in an imported function.
> +  void findNeededSubprograms(ValueToValueMapTy &ValueMap);

Hey Teresa,

This has been causing bootstrap assertion failures, I think because a
DISubprogram referenced by DIImportedEntity should also be considered
needed.

I filed PR26037, could you please have a look?

Thanks!
-Ahmed


More information about the llvm-commits mailing list