[llvm] r256047 - [PGO] Simplify computehash interface (NFC)

Xinliang David Li via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 18 14:22:12 PST 2015


Author: davidxl
Date: Fri Dec 18 16:22:12 2015
New Revision: 256047

URL: http://llvm.org/viewvc/llvm-project?rev=256047&view=rev
Log:
[PGO] Simplify computehash interface (NFC)

Modified:
    llvm/trunk/include/llvm/ProfileData/InstrProf.h
    llvm/trunk/lib/ProfileData/InstrProf.cpp
    llvm/trunk/lib/ProfileData/InstrProfWriter.cpp

Modified: llvm/trunk/include/llvm/ProfileData/InstrProf.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ProfileData/InstrProf.h?rev=256047&r1=256046&r2=256047&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ProfileData/InstrProf.h (original)
+++ llvm/trunk/include/llvm/ProfileData/InstrProf.h Fri Dec 18 16:22:12 2015
@@ -575,6 +575,10 @@ const uint64_t Magic = 0x8169666f72706cf
 const uint64_t Version = INSTR_PROF_INDEX_VERSION;
 const HashT HashType = HashT::MD5;
 
+static inline uint64_t ComputeHash(StringRef K) {
+  return ComputeHash(HashType, K);
+}
+
 // This structure defines the file header of the LLVM profile
 // data file in indexed-format.
 struct Header {

Modified: llvm/trunk/lib/ProfileData/InstrProf.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ProfileData/InstrProf.cpp?rev=256047&r1=256046&r2=256047&view=diff
==============================================================================
--- llvm/trunk/lib/ProfileData/InstrProf.cpp (original)
+++ llvm/trunk/lib/ProfileData/InstrProf.cpp Fri Dec 18 16:22:12 2015
@@ -201,8 +201,7 @@ void getValueForSiteInstrProf(const void
 uint64_t stringToHash(uint32_t ValueKind, uint64_t Value) {
   switch (ValueKind) {
   case IPVK_IndirectCallTarget:
-    return IndexedInstrProf::ComputeHash(IndexedInstrProf::HashType,
-                                         (const char *)Value);
+    return IndexedInstrProf::ComputeHash((const char *)Value);
     break;
   default:
     llvm_unreachable("value kind not handled !");

Modified: llvm/trunk/lib/ProfileData/InstrProfWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ProfileData/InstrProfWriter.cpp?rev=256047&r1=256046&r2=256047&view=diff
==============================================================================
--- llvm/trunk/lib/ProfileData/InstrProfWriter.cpp (original)
+++ llvm/trunk/lib/ProfileData/InstrProfWriter.cpp Fri Dec 18 16:22:12 2015
@@ -35,7 +35,7 @@ public:
   typedef uint64_t offset_type;
 
   static hash_value_type ComputeHash(key_type_ref K) {
-    return IndexedInstrProf::ComputeHash(IndexedInstrProf::HashType, K);
+    return IndexedInstrProf::ComputeHash(K);
   }
 
   static std::pair<offset_type, offset_type>




More information about the llvm-commits mailing list