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

Mehdi Amini via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 20 16:48:57 PDT 2016


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
> 
> 
> 



More information about the llvm-commits mailing list