[llvm] [ADT,CodeGen] Remove stable_hash_combine_string (PR #100668)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 25 23:19:44 PDT 2024


MaskRay wrote:

> Seems unfortunate to have direct calls to specific hash implementations littered around the codebase next time we want to replace them with something better...
> 
> I guess `stable` is intended to be stable across LLVM versions, etc? So it can't ever be changed? Could we add some sort of generation parameter to it and use that to pick the implementation, so that some clients can pick a newer generation? Or add an API that matches the needs of these updated callers? What sort of determinism-but-not-stability do they need? Just something that's stable witihn a version, rather than an eternal stability that `stable` offers?

The argument is whether we should have a desgination "stable hashing", which is deterministic but might evolve (to better algorithms).

I think the answer is yes but I believe that the implementation should be polished first.
It should be efficient, and the interface should be what we are comfortable to support.

Currently, the API `stable_hash_combine` would be useful, but it should move away from the extremely slow byte-wise FNV.
I am not certain the name `stable_hash_combine_string` should be used for a stable string hash API, which may unify with StringMap.
I am inclined to remove it.


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


More information about the llvm-commits mailing list