[llvm] [docs][TypeProf]Update instrumentation file format document (PR #83309)

David Li via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 28 12:00:34 PST 2024


================
@@ -333,6 +342,37 @@ Function names serve as keys in the PGO data hash table when raw profiles are
 converted into indexed profiles. They are also crucial for ``llvm-profdata`` to
 show the profiles in a human-readable way.
 
+Virtual Table Profile Data
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+This section is used for `type profiling`_. Each entry corresponds to one virtual
+table and could be illustrated with the following C++ struct
+
+.. code-block:: c++
+
+  struct VTableProfileInfo {
+    // The start address of the vtable, collected at runtime.
+    uint64_t StartAddress;
+    // The byte size of the vtable. `StartAddress` and `ByteSize` specifies an address range to look up.
+    uint32_t ByteSize;
+    // The hash of vtable's (PGO) name
+    uint64_t MD5HashOfName;
+  };
+
+At profile use time, compiler looks up a profiled address in the sorted vtable
+address ranges and maps the address to a specific vtable through hashed name.
+
+Virtual Table Names
+^^^^^^^^^^^^^^^^^^^^
+
+This section is similar to `function names`_ section above, except it contains the PGO
+names of profiled virtual tables. It's a standalone section such that raw profile
+readers could directly find each name set by accessing the corresponding profile
+data seciton (i.e., no join across sections to tell vtable from functions).
----------------
david-xl wrote:

seciton -> section

https://github.com/llvm/llvm-project/pull/83309


More information about the llvm-commits mailing list