[PATCH] D23739: [LTO] Handles commons in monolithic LTO

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 20 18:09:50 PDT 2016


That's one thing I mentioned yesterday, I found that gold does only mark
the first one prevailing, so the handling in the plugin ensured that once
one was prevailing, all were kept when creating the merged common.

On Sat, Aug 20, 2016, 4:48 PM Mehdi Amini <mehdi.amini at apple.com> wrote:

> Right now for the common the implementation will merge only the commons
> that are marked as prevailing.
> Can you dump the resolution.txt file? I suspect the resolution is not as
> expected and Gold is marking only the first one as prevailing.
>
>
> > On Aug 20, 2016, at 4:45 PM, Teresa Johnson <tejohnson at google.com>
> wrote:
> >
> > tejohnson added a comment.
> >
> > I fixed a couple of unused variables, diff shown below. But I am getting
> a test failure, see further below.
> >
> > diff --git a/tools/gold/gold-plugin.cpp b/tools/gold/gold-plugin.cpp
> > index e5d2f2a..ee2f3f3 100644
> >
> > - a/tools/gold/gold-plugin.cpp
> >
> > +++ b/tools/gold/gold-plugin.cpp
> > @@ -564,12 +564,10 @@ static void addModule(LTO &Lto, claimed_file &F,
> const void *View) {
> >
> >            toString(ObjOrErr.takeError()).c_str());
> >
> >  InputFile &Obj = **ObjOrErr;
> >
> > - bool HasThinLTOSummary =
> > - hasGlobalValueSummary(Obj.getMemoryBufferRef(), diagnosticHandler);
> >
> >  unsigned SymNum = 0; std::vector<SymbolResolution>
> Resols(F.syms.size());
> > - for (auto &ObjSym : Obj.symbols()) {
> >
> > +  for (LLVM_ATTRIBUTE_UNUSED auto &ObjSym : Obj.symbols()) {
> >
> >  ld_plugin_symbol &Sym = F.syms[SymNum];
> >  SymbolResolution &R = Resols[SymNum];
> >  ++SymNum;
> >
> > I am getting a failure in the gold common test:
> >
> > llvm_13/test/tools/gold/X86/common.ll:14:6: error: expected string not
> found in input
> > ; A: @a = common global [4 x i8] zeroinitializer, align 8
> >
> >  ^
> >
> > <stdin>:4:1: note: possible intended match here
> > @a = common global [2 x i8] zeroinitializer, align 8
> > ^
> >
> > I'll need to dig unless you can figure out what might be going on. Will
> try to look tonight if I have time.
> >
> >
> > https://reviews.llvm.org/D23739
> >
> >
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160821/594c740d/attachment.html>


More information about the llvm-commits mailing list