================ @@ -374,15 +377,33 @@ Error YAMLProfileReader::readProfile(BinaryContext &BC) { // the profile. Function.setExecutionCount(BinaryFunction::COUNT_NO_PROFILE); - // Recompute hash once per function. - if (!opts::IgnoreHash) - Function.computeHash(YamlBP.Header.IsDFSOrder, - YamlBP.Header.HashFunction); - if (profileMatches(YamlBF, Function)) matchProfileToFunction(YamlBF, Function); } + // Uses the strict hash of profiled and binary functions to match functions + // that are not matched by name or common name. + if (!opts::IgnoreHash) { + std::unordered_map<size_t, BinaryFunction *> StrictHashToBF; + StrictHashToBF.reserve(BC.getBinaryFunctions().size()); + + for (auto &[_, BF] : BC.getBinaryFunctions()) { + StrictHashToBF[BF.getHash()] = &BF; + } + + for (auto YamlBF : YamlBP.Functions) { ---------------- ayermolo wrote:
Specify actual type. This can also hide copy since & is not used. https://github.com/llvm/llvm-project/pull/95821 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits