[PATCH] D84803: [ThinLTO][Legacy] Compute PreservedGUID based on IRName in Symtab

Steven Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 28 14:33:21 PDT 2020


steven_wu added a comment.

In D84803#2245283 <https://reviews.llvm.org/D84803#2245283>, @dmajor wrote:

> Yeah, I wish I could give a nice test case, but it's a huge build and the affected configuration needs a lot of setup so I can't even replicate it locally at the moment.
>
> If you have proposed patches I could send them off for a dry run relatively easily though.

Maybe try this?

  diff --git a/llvm/lib/LTO/ThinLTOCodeGenerator.cpp b/llvm/lib/LTO/ThinLTOCodeGenerator.cpp
  index 4adc9a22a7b2..91a76a4f4539 100644
  --- a/llvm/lib/LTO/ThinLTOCodeGenerator.cpp
  +++ b/llvm/lib/LTO/ThinLTOCodeGenerator.cpp
  @@ -276,9 +276,12 @@ static void computeGUIDPreservedSymbols(const lto::InputFile &File,
     // Iterate the symbols in the input file and if the input has preserved symbol
     // compute the GUID for the symbol.
     for (const auto &Sym : File.symbols()) {
  -    if (PreservedSymbols.count(Sym.getName()))
  +    if (PreservedSymbols.count(Sym.getName())) {
  +      if (Sym.getIRName().empty())
  +        continue;
         GUIDs.insert(GlobalValue::getGUID(GlobalValue::getGlobalIdentifier(
             Sym.getIRName(), GlobalValue::ExternalLinkage, "")));
  +    }
     }
   }

Note IRName should really not be empty. Even this fixes the problem, the root cause might be somewhere else.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84803/new/

https://reviews.llvm.org/D84803



More information about the llvm-commits mailing list