diff options
| author | Teresa Johnson <tejohnson@google.com> | 2016-02-10 21:55:02 +0000 |
|---|---|---|
| committer | Teresa Johnson <tejohnson@google.com> | 2016-02-10 21:55:02 +0000 |
| commit | e1164de5d0c9ae28a943d07eaf8e75f24bfb2d4a (patch) | |
| tree | 7b7037f3104679a3f051dd24575543e75180b572 /llvm/lib/IR | |
| parent | 3e58a6a7b2b6f6af9ac2b091909e829fe5a21a99 (diff) | |
| download | bcm5719-llvm-e1164de5d0c9ae28a943d07eaf8e75f24bfb2d4a.tar.gz bcm5719-llvm-e1164de5d0c9ae28a943d07eaf8e75f24bfb2d4a.zip | |
Restore "[ThinLTO] Use MD5 hash in function index." with fix
This restores commit r260408, along with a fix for a bot failure.
The bot failure was caused by dereferencing a unique_ptr in the same
call instruction parameter list where it was passed via std::move.
Apparently due to luck this was not exposed when I built the compiler
with clang, only with gcc.
llvm-svn: 260442
Diffstat (limited to 'llvm/lib/IR')
| -rw-r--r-- | llvm/lib/IR/FunctionInfo.cpp | 17 | ||||
| -rw-r--r-- | llvm/lib/IR/Module.cpp | 2 |
2 files changed, 4 insertions, 15 deletions
diff --git a/llvm/lib/IR/FunctionInfo.cpp b/llvm/lib/IR/FunctionInfo.cpp index e5f3dbbdb74..246023907f9 100644 --- a/llvm/lib/IR/FunctionInfo.cpp +++ b/llvm/lib/IR/FunctionInfo.cpp @@ -23,7 +23,7 @@ void FunctionInfoIndex::mergeFrom(std::unique_ptr<FunctionInfoIndex> Other, StringRef ModPath; for (auto &OtherFuncInfoLists : *Other) { - std::string FuncName = OtherFuncInfoLists.getKey(); + uint64_t FuncGUID = OtherFuncInfoLists.first; FunctionInfoList &List = OtherFuncInfoLists.second; // Assert that the func info list only has one entry, since we shouldn't @@ -49,20 +49,9 @@ void FunctionInfoIndex::mergeFrom(std::unique_ptr<FunctionInfoIndex> Other, // string reference owned by the combined index. Info->functionSummary()->setModulePath(ModPath); - // If it is a local function, rename it. - if (GlobalValue::isLocalLinkage( - Info->functionSummary()->getFunctionLinkage())) { - // Any local functions are virtually renamed when being added to the - // combined index map, to disambiguate from other functions with - // the same name. The symbol table created for the combined index - // file should contain the renamed symbols. - FuncName = - FunctionInfoIndex::getGlobalNameForLocal(FuncName, NextModuleId); - } - // Add new function info to existing list. There may be duplicates when // combining FunctionMap entries, due to COMDAT functions. Any local - // functions were virtually renamed above. - addFunctionInfo(FuncName, std::move(Info)); + // functions were given unique global IDs. + addFunctionInfo(FuncGUID, std::move(Info)); } } diff --git a/llvm/lib/IR/Module.cpp b/llvm/lib/IR/Module.cpp index ac578d6dba0..fc3f9d073fc 100644 --- a/llvm/lib/IR/Module.cpp +++ b/llvm/lib/IR/Module.cpp @@ -47,7 +47,7 @@ template class llvm::SymbolTableListTraits<GlobalAlias>; // Module::Module(StringRef MID, LLVMContext &C) - : Context(C), Materializer(), ModuleID(MID), DL("") { + : Context(C), Materializer(), ModuleID(MID), SourceFileName(MID), DL("") { ValSymTab = new ValueSymbolTable(); NamedMDSymTab = new StringMap<NamedMDNode *>(); Context.addModule(this); |

