|
| 1 | +diff --git a/llvm/include/llvm/ProfileData/InstrProf.h b/llvm/include/llvm/ProfileData/InstrProf.h |
| 2 | +index a786aadce6de..eeea25e25fe8 100644 |
| 3 | +--- a/llvm/include/llvm/ProfileData/InstrProf.h |
| 4 | ++++ b/llvm/include/llvm/ProfileData/InstrProf.h |
| 5 | +@@ -40,6 +40,7 @@ |
| 6 | + #include <cassert> |
| 7 | + #include <cstddef> |
| 8 | + #include <cstdint> |
| 9 | ++#include <cstdio> |
| 10 | + #include <cstring> |
| 11 | + #include <list> |
| 12 | + #include <memory> |
| 13 | +@@ -643,7 +644,10 @@ public: |
| 14 | + |
| 15 | + // Insert into NameTab so that MD5NameMap (a vector that will be sorted) |
| 16 | + // won't have duplicated entries in the first place. |
| 17 | +- auto Ins = NameTab.insert(SymbolName); |
| 18 | ++ uint64_t HashValue = IndexedInstrProf::ComputeHash(SymbolName); |
| 19 | ++ printf("Hash Value for %.*s: %" PRIu64 "\n", static_cast<int>(SymbolName.size()), SymbolName.data(), HashValue); |
| 20 | ++ auto Ins = NameTab.insert(FuncName); |
| 21 | ++ printf("mapped value for %" PRIu64 " hash: %.*s\n", HashValue, static_cast<int>(Ins.first->getKey().size()), Ins.first->getKey().data()); |
| 22 | + if (Ins.second) { |
| 23 | + MD5NameMap.push_back(std::make_pair( |
| 24 | + IndexedInstrProf::ComputeHash(SymbolName), Ins.first->getKey())); |
| 25 | +diff --git a/llvm/include/llvm/ProfileData/InstrProfReader.h b/llvm/include/llvm/ProfileData/InstrProfReader.h |
| 26 | +index b92253a81502..7bd1bed6b74f 100644 |
| 27 | +--- a/llvm/include/llvm/ProfileData/InstrProfReader.h |
| 28 | ++++ b/llvm/include/llvm/ProfileData/InstrProfReader.h |
| 29 | +@@ -356,7 +356,8 @@ private: |
| 30 | + uint64_t CountersDelta; |
| 31 | + uint64_t BitmapDelta; |
| 32 | + uint64_t NamesDelta; |
| 33 | +- const RawInstrProf::ProfileData<IntPtrT> *Data; |
| 34 | ++ const RawInstrProf::ProfileData<IntPtrT> *cccccbveifehbfkeciugkvlcugkcgbdhkkkvdtrfbgkn |
| 35 | ++ Data; |
| 36 | + const RawInstrProf::ProfileData<IntPtrT> *DataEnd; |
| 37 | + const RawInstrProf::VTableProfileData<IntPtrT> *VTableBegin = nullptr; |
| 38 | + const RawInstrProf::VTableProfileData<IntPtrT> *VTableEnd = nullptr; |
| 39 | +diff --git a/llvm/lib/ProfileData/InstrProf.cpp b/llvm/lib/ProfileData/InstrProf.cpp |
| 40 | +index 16d4877f3ccc..ea9e0ea2e129 100644 |
| 41 | +--- a/llvm/lib/ProfileData/InstrProf.cpp |
| 42 | ++++ b/llvm/lib/ProfileData/InstrProf.cpp |
| 43 | +@@ -555,7 +555,6 @@ Error InstrProfSymtab::addVTableWithName(GlobalVariable &VTable, |
| 44 | + auto NameToGUIDMap = [&](StringRef Name) -> Error { |
| 45 | + if (Error E = addSymbolName(Name)) |
| 46 | + return E; |
| 47 | +- |
| 48 | + bool Inserted = true; |
| 49 | + std::tie(std::ignore, Inserted) = MD5VTableMap.try_emplace( |
| 50 | + GlobalValue::getGUIDAssumingExternalLinkage(Name), &VTable); |
| 51 | +@@ -607,10 +606,18 @@ Error readAndDecodeStrings(StringRef NameStrings, |
| 52 | + SmallVector<StringRef, 0> Names; |
| 53 | + StringRef ArchRef(Architecture); |
| 54 | + NameStrings.split(Names, getInstrProfNameSeparator()); |
| 55 | +- for (StringRef &Name : Names) |
| 56 | +- if (Error E = NameCallback(Name.str()+ ":" + ArchRef.str())) |
| 57 | +- return E; |
| 58 | +- |
| 59 | ++ printf("=====================READER DATA===================="); |
| 60 | ++ for (StringRef &Name : Names){ |
| 61 | ++ std::string ConcHashString = Name.str() + ":" + ArchRef.str(); |
| 62 | ++ printf("The string %s will get hashed and mapped to %s\n", ConcHashString.c_str(), Name.str().c_str()); |
| 63 | ++ if(ArchRef.empty()){ |
| 64 | ++ if (Error E = NameCallback(Name)) |
| 65 | ++ return E; |
| 66 | ++ }else{ |
| 67 | ++ if (Error E = NameCallback(Name.str() + ":" + ArchRef.str())) |
| 68 | ++ return E; |
| 69 | ++ } |
| 70 | ++ } |
| 71 | + while (P < EndP && *P == 0) |
| 72 | + P++; |
| 73 | + } |
| 74 | +@@ -653,7 +660,6 @@ Error readAndDecodeStrings(StringRef NameStrings, |
| 75 | + for (StringRef &Name : Names) |
| 76 | + if (Error E = NameCallback(Name)) |
| 77 | + return E; |
| 78 | +- |
| 79 | + while (P < EndP && *P == 0) |
| 80 | + P++; |
| 81 | + } |
0 commit comments