diff options
author | Teresa Johnson <tejohnson@google.com> | 2017-10-31 12:56:09 +0000 |
---|---|---|
committer | Teresa Johnson <tejohnson@google.com> | 2017-10-31 12:56:09 +0000 |
commit | 066071f53f9feedbaaa81fc47129e727135a42d1 (patch) | |
tree | 683059e55a188292a7588a0fbed725dba1712f67 /include | |
parent | 4f7d658ee00eb05abef86f1f99431dd49f2feaa4 (diff) |
[ThinLTO] Double bits of module hash used for renaming
Summary:
Use 64 instead of 32 bits of the module hash as the suffix when renaming
after promotion to reduce the likelihood of a collision (which we
observed in a binary when using 32 bits).
Reviewers: pcc
Subscribers: llvm-commits, inglorion
Differential Revision: https://reviews.llvm.org/D39443
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316996 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/IR/ModuleSummaryIndex.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/llvm/IR/ModuleSummaryIndex.h b/include/llvm/IR/ModuleSummaryIndex.h index 92dcebe48b0..2d664f41e3c 100644 --- a/include/llvm/IR/ModuleSummaryIndex.h +++ b/include/llvm/IR/ModuleSummaryIndex.h @@ -743,7 +743,8 @@ public: static std::string getGlobalNameForLocal(StringRef Name, ModuleHash ModHash) { SmallString<256> NewName(Name); NewName += ".llvm."; - NewName += utostr(ModHash[0]); // Take the first 32 bits + NewName += utostr((uint64_t(ModHash[0]) << 32) | + ModHash[1]); // Take the first 64 bits return NewName.str(); } |