[llvm] [memprof] Use BLAKE for FrameId (PR #109501)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 23 23:53:48 PDT 2024


kazutakahirata wrote:

> Thanks for the pointer @asl . Since the impact to runtime is minor, I'm fine with using Blake3. What do you think @kazutakahirata ?

I'm inclined to go ahead with this patch for now because:

- the runtime impact is only on `llvm-profdata`, not the compilation, and
- the new hash function is a drop-in replacement.

In the longer term, I'm thinking about:

- removing the older memprof profile formats (version 0, 1, and 2) and
- removing the hash-based `FrameId` completely in favor of some sort of a deduplication hash table -- something like `MapVector<Frame, unsigned>` mapping `Frame` to a linear integer ID.

Note that once we remove the older memprof profile formats, `FrameID` will stay completely within `llvm-profdata` and never get serialized.  At that point, we will be able to use any data structure that suits our needs.



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


More information about the llvm-commits mailing list