[PATCH] D10674: Value profiling - patchset 3
Betul Buyukkurt via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 13 22:17:10 PDT 2015
betulb marked 4 inline comments as done.
================
Comment at: include/llvm/ProfileData/InstrProf.h:60
@@ +59,3 @@
+ // Get a pointer to internal storage of a string in set
+ const char* getStringData(StringRef Str) {
+ auto Result = StringValueSet.find(Str);
----------------
I've modified the data structure, however I've chosen to use an std::list over a linked list. I understand the presence of the cost for sites with no value data. I may revisit if the implementation is not preferred. I think usage of list makes it easier to access, sort, be iterable, and merge. The list of pairs implementation also allows sorting either by target values or numtaken. Please inform is the code is not agreeable.
================
Comment at: include/llvm/ProfileData/InstrProf.h:65
@@ +64,3 @@
+ // Insert a string to StringTable
+ const char* insertString(StringRef Str) {
+ auto Result = StringValueSet.insert(Str);
----------------
I'm storing a const char* to the entry in the string table in the value portion of the std::pair.
At the time of the indexed profile file writing, I'm converting the const char* entries to hash values of the strings pointed to by the value field. At the time of writing the hash values are represented back as const char* into the contents of the string table.
http://reviews.llvm.org/D10674
More information about the llvm-commits
mailing list