[clang] [llvm-profdata] Do not create numerical strings for MD5 function names read from a Sample Profile. (PR #66164)
William Junda Huang via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 5 11:50:09 PDT 2023
huangjd wrote:
> > There are two ways ProfileFuncRef can originate (ignoring copy constructions):
> > ...
>
> So you are saying there can be hashcode `ProfileFuncRef`s coming from the profile, but an `llvm::Function` would always produce a string `ProfileFuncRef`?
>
> > B - Whenever we lookup a ProflieFuncRef-keyed map, we need to make sure the key we query has the same representation as the keys in the map.
>
> But doesn't `SampleProfileReader::getSamplesFor(const Function &F)` create a string `ProfileFuncRef` and uses that for a lookup?
See "exception" in my comment, the profile map is a HashKeyMap, which was specifically made to work when looking up with either String or MD5 of the same function name, because both produce the same hash as key
https://github.com/llvm/llvm-project/pull/66164
More information about the cfe-commits
mailing list