[llvm-branch-commits] [llvm] [BOLT] Add pseudo probe inline tree to YAML profile (PR #107137)

Amir Ayupov via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Sep 11 19:31:54 PDT 2024


================
@@ -246,10 +270,32 @@ template <> struct MappingTraits<bolt::BinaryProfileHeader> {
   }
 };
 
+namespace bolt {
+struct PseudoProbeDesc {
+  std::vector<Hex64> GUID;
+  std::vector<Hex64> Hash;
+  std::vector<uint32_t> GUIDHash; // Index of hash for that GUID in Hash
----------------
aaupov wrote:

> > // Index of hash for that GUID in Hash
> 
> I don't fully get this, does this mean we have different Hashes for the same GUID, is this a global index or just the index for different Hash but the same GUID.

No, there can only be one Hash for the same GUID. 

But different GUIDs can have the same hash (functions with 1 block will share 0x10000FFFFFFFF if I understand correctly). Thus Hash vector can be smaller, and two GUIDs with different indices in GUID vector can have the same index into Hash vector.

By the way, the most frequent hashes are, in my working example:
```
hs:              [ 0x10000FFFFFFFF, 0xFFFFFFFF, 0x20000FFFFFFFF, 0x30000FFFFFFFF, 0x40000FFFFFFFF, 0x50000FFFFFFFF, 0x60000FFFFFFFF, ...
```

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


More information about the llvm-branch-commits mailing list