[PATCH] D60227: [Remarks] Add string deduplication using a string table

Francis Visoiu Mistrih via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 3 20:30:46 PDT 2019


thegameg added a comment.

In D60227#1454110 <https://reviews.llvm.org/D60227#1454110>, @hfinkel wrote:

> Is this transparent to tools that use LLVM's YAML library? Other tools?
>
> If not, we'll need to update the llvm-opt-report tool and the opt-viewer tool.


This is disabled by default, and enabled under `-mllvm -remarks-yaml-string-table` so tools like llvm-opt-report and the opt-viewer won't need any changes yet.

On the parsing side, this will expect the usage of a string table in the YAML  only if the constructor with an actual string table buffer is provided. The tools don't know how to do this yet since they operate on the YAML files alone (the string table is in a section in the object file), but anyone using libRemarks.dylib/.so could use this to parse these files. I plan on making all these tools use this library at some point.



================
Comment at: llvm/include/llvm/Remarks/RemarkStringTable.h:40
+  /// Total size of the string table when serialized.
+  size_t SerializedSize = 0;
+
----------------
JDevlieghere wrote:
> Can we not use the size of the StringMap?
This is the total size of the string table that is going to be written to disk. It's the sum of the sizes of every string in the map. I can recompute this in `serialize()` if you think it's a nicer way to do this.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60227/new/

https://reviews.llvm.org/D60227





More information about the llvm-commits mailing list