[llvm-branch-commits] [BOLT][NFC] Refactor function matching (PR #97502)
Shaw Young via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Jul 3 09:35:02 PDT 2024
================
@@ -73,13 +73,26 @@ class YAMLProfileReader : public ProfileReaderBase {
bool parseFunctionProfile(BinaryFunction &Function,
const yaml::bolt::BinaryFunctionProfile &YamlBF);
+ /// Returns block cnt equality if IgnoreHash is true, otherwise, hash equality
+ bool profileMatches(const yaml::bolt::BinaryFunctionProfile &Profile,
+ BinaryFunction &BF);
+
/// Infer function profile from stale data (collected on older binaries).
bool inferStaleProfile(BinaryFunction &Function,
const yaml::bolt::BinaryFunctionProfile &YamlBF);
/// Initialize maps for profile matching.
void buildNameMaps(BinaryContext &BC);
+ /// Matches functions using exact name.
+ size_t matchWithExactName();
----------------
shawbyoung wrote:
I'm moving the different matching techniques into separate functions because it'll be easier to understand and prevent the YAMLProfileReader::readProfile function from getting abhorrently large as I'll be adding call graph function matching to it in a subsequent PR. I'll add this explanation to the description.
https://github.com/llvm/llvm-project/pull/97502
More information about the llvm-branch-commits
mailing list