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 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits