[llvm] r316996 - [ThinLTO] Double bits of module hash used for renaming

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 31 05:56:10 PDT 2017


Author: tejohnson
Date: Tue Oct 31 05:56:09 2017
New Revision: 316996

URL: http://llvm.org/viewvc/llvm-project?rev=316996&view=rev
Log:
[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

Modified:
    llvm/trunk/include/llvm/IR/ModuleSummaryIndex.h

Modified: llvm/trunk/include/llvm/IR/ModuleSummaryIndex.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/ModuleSummaryIndex.h?rev=316996&r1=316995&r2=316996&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/ModuleSummaryIndex.h (original)
+++ llvm/trunk/include/llvm/IR/ModuleSummaryIndex.h Tue Oct 31 05:56:09 2017
@@ -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();
   }
 




More information about the llvm-commits mailing list