[llvm-branch-commits] [llvm] [BOLT] Eliminate dead jump tables (PR #91666)

2024-05-22 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov converted_to_draft https://github.com/llvm/llvm-project/pull/91666 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [BOLT] Eliminate dead jump tables (PR #91666)

2024-05-22 Thread Amir Ayupov via llvm-branch-commits
aaupov wrote: > Looks like this is dangerous and crashes binaries in our tests? Do you still > want to move forward with this stack? Or are you working on it? If this stack > is work in progress, maybe mark it as "changes planned" or the equivalent in > github. Yes, we'll need to discuss how

[llvm-branch-commits] [BOLT][NFC] Simplify analyzeIndirectBranch (PR #91662)

2024-05-22 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/91662 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [BOLT][NFCI] Use heuristic for matching split global functions (PR #90429)

2024-05-24 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/90429 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [BOLT] Detect .warm split functions as cold fragments (PR #93759)

2024-05-29 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov created https://github.com/llvm/llvm-project/pull/93759 CDSplit splits functions up to three ways: main fragment with no suffix, and fragments with .cold and .warm suffixes. Add .warm suffix to the regex used to recognize split fragments. Test Plan: updated register-f

[llvm-branch-commits] [BOLT][BAT] Add support for three-way split functions (PR #93760)

2024-05-29 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov created https://github.com/llvm/llvm-project/pull/93760 In three-way split functions, if only .warm fragment is present, BAT incorrectly overwrites the map for .warm fragment by empty .cold fragment. Test Plan: updated register-fragments-bolt-symbols.s _

[llvm-branch-commits] [llvm] [BOLT] Detect .warm split functions as cold fragments (PR #93759)

2024-05-30 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov updated https://github.com/llvm/llvm-project/pull/93759 >From 9ac7c047c6d15082f05e7494b764d50150e3fd27 Mon Sep 17 00:00:00 2001 From: Amir Ayupov Date: Thu, 30 May 2024 14:52:45 -0700 Subject: [PATCH] s/ColdFragment/FunctionFragmentTemplate/ Created using spr 1.3.4 --

[llvm-branch-commits] [llvm] [BOLT] Detect .warm split functions as cold fragments (PR #93759)

2024-05-30 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov closed https://github.com/llvm/llvm-project/pull/93759 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [BOLT][BAT] Add support for three-way split functions (PR #93760)

2024-05-31 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/93760 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [BOLT][BAT] Add support for three-way split functions (PR #93760)

2024-06-04 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov updated https://github.com/llvm/llvm-project/pull/93760 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [BOLT][BAT] Add support for three-way split functions (PR #93760)

2024-06-04 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov updated https://github.com/llvm/llvm-project/pull/93760 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [BOLT] Drop high discrepancy profiles in matching (PR #95156)

2024-06-12 Thread Amir Ayupov via llvm-branch-commits
@@ -592,10 +599,15 @@ void preprocessUnreachableBlocks(FlowFunction &Func) { /// Decide if stale profile matching can be applied for a given function. /// Currently we skip inference for (very) large instances and for instances /// having "unexpected" control flow (e.g., having

[llvm-branch-commits] [llvm] [BOLT] Drop high discrepancy profiles in matching (PR #95156)

2024-06-16 Thread Amir Ayupov via llvm-branch-commits
@@ -575,10 +583,16 @@ void preprocessUnreachableBlocks(FlowFunction &Func) { /// Decide if stale profile matching can be applied for a given function. /// Currently we skip inference for (very) large instances and for instances /// having "unexpected" control flow (e.g., having

[llvm-branch-commits] [llvm] [BOLT] Drop high discrepancy profiles in matching (PR #95156)

2024-06-16 Thread Amir Ayupov via llvm-branch-commits
@@ -394,7 +400,7 @@ createFlowFunction(const BinaryFunction::BasicBlockOrderType &BlockOrder) { void matchWeightsByHashes(BinaryContext &BC, const BinaryFunction::BasicBlockOrderType &BlockOrder, const yaml::bolt::BinaryFunc

[llvm-branch-commits] [llvm] [BOLT] Drop high discrepancy profiles in matching (PR #95156)

2024-06-16 Thread Amir Ayupov via llvm-branch-commits
@@ -394,7 +400,7 @@ createFlowFunction(const BinaryFunction::BasicBlockOrderType &BlockOrder) { void matchWeightsByHashes(BinaryContext &BC, const BinaryFunction::BasicBlockOrderType &BlockOrder, const yaml::bolt::BinaryFunc

[llvm-branch-commits] [llvm] [BOLT] Drop high discrepancy profiles in matching (PR #95156)

2024-06-17 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov approved this pull request. LGTM with one nit https://github.com/llvm/llvm-project/pull/95156 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-

[llvm-branch-commits] [llvm] [BOLT] Drop high discrepancy profiles in matching (PR #95156)

2024-06-17 Thread Amir Ayupov via llvm-branch-commits
@@ -391,10 +397,9 @@ createFlowFunction(const BinaryFunction::BasicBlockOrderType &BlockOrder) { /// of the basic blocks in the binary, the count is "matched" to the block. /// Similarly, if both the source and the target of a count in the profile are /// matched to a jump in

[llvm-branch-commits] [llvm] [BOLT] Drop high discrepancy profiles in matching (PR #95156)

2024-06-17 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/95156 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [BOLT] Hash-based function matching (PR #95821)

2024-06-18 Thread Amir Ayupov via llvm-branch-commits
@@ -420,6 +442,7 @@ Error YAMLProfileReader::readProfile(BinaryContext &BC) { errs() << "BOLT-WARNING: profile ignored for function " << YamlBF.Name << '\n'; + aaupov wrote: nit: please drop https://github.com/llvm/llvm-project/pull/95821

[llvm-branch-commits] [llvm] [BOLT] Hash-based function matching (PR #95821)

2024-06-18 Thread Amir Ayupov via llvm-branch-commits
@@ -0,0 +1,67 @@ +## Test YAMLProfileReader support for pass-through blocks in non-matching edges: +## match the profile edge A -> C to the CFG with blocks A -> B -> C. + +# REQUIRES: system-linux +# RUN: split-file %s %t +# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unkno

[llvm-branch-commits] [llvm] [BOLT] Hash-based function matching (PR #95821)

2024-06-18 Thread Amir Ayupov via llvm-branch-commits
@@ -383,6 +381,30 @@ Error YAMLProfileReader::readProfile(BinaryContext &BC) { matchProfileToFunction(YamlBF, Function); } + // Uses the strict hash of profiled and binary functions to match functions aaupov wrote: Let's put this under `if (!opts::Ig

[llvm-branch-commits] [llvm] [BOLT] Hash-based function matching (PR #95821)

2024-06-18 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov edited 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

[llvm-branch-commits] [llvm] [BOLT] Hash-based function matching (PR #95821)

2024-06-18 Thread Amir Ayupov via llvm-branch-commits
@@ -383,6 +381,30 @@ Error YAMLProfileReader::readProfile(BinaryContext &BC) { matchProfileToFunction(YamlBF, Function); } + // Uses the strict hash of profiled and binary functions to match functions + // that are not matched by name or common name. + std::unordere

[llvm-branch-commits] [llvm] [BOLT] Hash-based function matching (PR #95821)

2024-06-18 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov commented: Looks very good, but please address some minor issues. 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/l

[llvm-branch-commits] [llvm] [BOLT] Hash-based function matching (PR #95821)

2024-06-18 Thread Amir Ayupov via llvm-branch-commits
@@ -383,6 +381,30 @@ Error YAMLProfileReader::readProfile(BinaryContext &BC) { matchProfileToFunction(YamlBF, Function); } + // Uses the strict hash of profiled and binary functions to match functions + // that are not matched by name or common name. + std::unordere

[llvm-branch-commits] [llvm] [BOLT] Name similarity function matching (PR #95884)

2024-06-21 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov commented: Can you please also note the runtime of the namespace-filtered pairwise checks? This would guide us in whether to add a BB count filtering. https://github.com/llvm/llvm-project/pull/95884 ___ llvm-branch-commits ma

[llvm-branch-commits] [llvm] [BOLT] Name similarity function matching (PR #95884)

2024-06-21 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/95884 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [BOLT] Name similarity function matching (PR #95884)

2024-06-21 Thread Amir Ayupov via llvm-branch-commits
@@ -415,6 +422,75 @@ Error YAMLProfileReader::readProfile(BinaryContext &BC) { if (!YamlBF.Used && BF && !ProfiledFunctions.count(BF)) matchProfileToFunction(YamlBF, *BF); + // Uses name similarity to match functions that were not matched by name. + uint64_t Matche

[llvm-branch-commits] [llvm] [BOLT] Name similarity function matching (PR #95884)

2024-06-21 Thread Amir Ayupov via llvm-branch-commits
@@ -415,6 +422,75 @@ Error YAMLProfileReader::readProfile(BinaryContext &BC) { if (!YamlBF.Used && BF && !ProfiledFunctions.count(BF)) matchProfileToFunction(YamlBF, *BF); + // Uses name similarity to match functions that were not matched by name. + uint64_t Matche

[llvm-branch-commits] [llvm] [BOLT] Name similarity function matching (PR #95884)

2024-06-21 Thread Amir Ayupov via llvm-branch-commits
@@ -415,6 +422,75 @@ Error YAMLProfileReader::readProfile(BinaryContext &BC) { if (!YamlBF.Used && BF && !ProfiledFunctions.count(BF)) matchProfileToFunction(YamlBF, *BF); + // Uses name similarity to match functions that were not matched by name. + uint64_t Matche

[llvm-branch-commits] [llvm] [BOLT] Hash-based function matching (PR #95821)

2024-06-21 Thread Amir Ayupov via llvm-branch-commits
@@ -128,6 +128,11 @@ cl::opt cl::desc("instrument code to generate accurate profile data"), cl::cat(BoltOptCategory)); +cl::opt +MatchingFunctionsWithHash("stale-matching-matching-functions-with-hash", + cl::desc("

[llvm-branch-commits] [llvm] [BOLT] Hash-based function matching (PR #95821)

2024-06-21 Thread Amir Ayupov via llvm-branch-commits
@@ -2982,6 +2983,9 @@ void RewriteInstance::selectFunctionsToProcess() { if (mustSkip(Function)) return false; +if (opts::MatchingFunctionsWithHash) + return true; aaupov wrote: Since we're forcing the processing of all functions here to co

[llvm-branch-commits] [llvm] [BOLT] Hash-based function matching (PR #95821)

2024-06-21 Thread Amir Ayupov via llvm-branch-commits
@@ -363,9 +364,27 @@ Error YAMLProfileReader::readProfile(BinaryContext &BC) { return Profile.Hash == static_cast(BF.getHash()); }; - // We have to do 2 passes since LTO introduces an ambiguity in function - // names. The first pass assigns profiles that match 100% by

[llvm-branch-commits] [llvm] [BOLT] Hash-based function matching (PR #95821)

2024-06-21 Thread Amir Ayupov via llvm-branch-commits
@@ -1161,4 +1165,4 @@ - `--print-options` - Print non-default options after command line parsing aaupov wrote: nit: please avoid unrelated changes https://github.com/llvm/llvm-project/pull/95821 ___ llvm-branch-c

[llvm-branch-commits] [llvm] [BOLT] Hash-based function matching (PR #95821)

2024-06-22 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov edited 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

[llvm-branch-commits] [llvm] [BOLT] Hash-based function matching (PR #95821)

2024-06-22 Thread Amir Ayupov via llvm-branch-commits
@@ -439,6 +482,11 @@ Error YAMLProfileReader::readProfile(BinaryContext &BC) { BC.setNumUnusedProfiledObjects(NumUnused); + if (opts::Lite) +for (BinaryFunction *BF : BC.getAllBinaryFunctions()) + if (ProfiledFunctions.find(BF) == ProfiledFunctions.end())

[llvm-branch-commits] [llvm] [BOLT] Hash-based function matching (PR #95821)

2024-06-22 Thread Amir Ayupov via llvm-branch-commits
@@ -0,0 +1,65 @@ +## Test YAMLProfileReader support for pass-through blocks in non-matching edges: +## match the profile edge A -> C to the CFG with blocks A -> B -> C. aaupov wrote: Please update the test description. https://github.com/llvm/llvm-project/pull/

[llvm-branch-commits] [llvm] [BOLT] Hash-based function matching (PR #95821)

2024-06-22 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov approved this pull request. LG overall, with a couple of nits. 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/lis

[llvm-branch-commits] [llvm] [BOLT] Hash-based function matching (PR #95821)

2024-06-22 Thread Amir Ayupov via llvm-branch-commits
@@ -374,15 +386,34 @@ 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

[llvm-branch-commits] [llvm] [BOLT] Name similarity function matching (PR #95884)

2024-06-25 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov requested changes to this pull request. Thank you for checking the runtime, and it's quite high. We'll need extra filtering by block count to keep runtime low - please add it as we discussed. https://github.com/llvm/llvm-project/pull/95884 _

[llvm-branch-commits] [llvm] [BOLT] Name similarity function matching (PR #95884)

2024-06-25 Thread Amir Ayupov via llvm-branch-commits
@@ -23,6 +26,10 @@ extern cl::opt Verbosity; extern cl::OptionCategory BoltOptCategory; extern cl::opt InferStaleProfile; +cl::opt NameSimilarityFunctionMatchingThreshold( +"name-similarity-function-matching-threshold", cl::desc("edit distance."), aaupov w

[llvm-branch-commits] [llvm] [BOLT] Name similarity function matching (PR #95884)

2024-06-25 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/95884 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [BOLT] Name similarity function matching (PR #95884)

2024-06-25 Thread Amir Ayupov via llvm-branch-commits
@@ -415,11 +422,87 @@ Error YAMLProfileReader::readProfile(BinaryContext &BC) { if (!YamlBF.Used && BF && !ProfiledFunctions.count(BF)) matchProfileToFunction(YamlBF, *BF); + // Uses name similarity to match functions that were not matched by name. + uint64_t Match

[llvm-branch-commits] [llvm] [BOLT] Name similarity function matching (PR #95884)

2024-06-25 Thread Amir Ayupov via llvm-branch-commits
aaupov wrote: Please expand the summary of the PR as well. https://github.com/llvm/llvm-project/pull/95884 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [BOLT] Function matching with function calls as anchors (PR #96596)

2024-06-25 Thread Amir Ayupov via llvm-branch-commits
@@ -415,11 +495,20 @@ Error YAMLProfileReader::readProfile(BinaryContext &BC) { if (!YamlBF.Used && BF && !ProfiledFunctions.count(BF)) matchProfileToFunction(YamlBF, *BF); + uint64_t MatchedWithCallsAsAnchors = 0; + if (opts::MatchWithCallsAsAnchors) +matchWit

[llvm-branch-commits] [llvm] [BOLT] Function matching with function calls as anchors (PR #96596)

2024-06-25 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/96596 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [BOLT][NFC] Refactoring CallGraph (PR #96922)

2024-06-27 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov commented: Please build with shared libraries mode to ensure cross-component dependencies are satisfied. https://github.com/llvm/llvm-project/pull/96922 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org

[llvm-branch-commits] [BOLT][NFC] Refactoring CallGraph (PR #96922)

2024-06-27 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/96922 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [BOLT][NFC] Refactoring CallGraph (PR #96922)

2024-06-27 Thread Amir Ayupov via llvm-branch-commits
@@ -10,7 +10,7 @@ // //===--===// -#include "bolt/Passes/CallGraph.h" +#include "bolt/Core/CallGraph.h" aaupov wrote: Please also update file headers (first line) https://github.com/llvm/ll

[llvm-branch-commits] [llvm] [BOLT][NFC] Refactoring CallGraph (PR #96922)

2024-06-27 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov approved this pull request. LGTM but please ensure that the diff passes NFC checks and shared build work. https://github.com/llvm/llvm-project/pull/96922 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org

[llvm-branch-commits] [llvm] [BOLT][NFC] Refactoring CallGraph (PR #96922)

2024-06-27 Thread Amir Ayupov via llvm-branch-commits
aaupov wrote: Please also retitle as an imperative statement, e.g. "Move CallGraph from Passes to Core" https://github.com/llvm/llvm-project/pull/96922 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-

[llvm-branch-commits] [BOLT] Drop macro-fusion alignment (PR #97358)

2024-07-01 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov created https://github.com/llvm/llvm-project/pull/97358 9d0754ada5dbbc0c009bcc2f7824488419cc5530 dropped MC support required for macro-fusion alignment in BOLT. Remove the support in BOLT. Test Plan: macro-fusion alignment was never upstreamed, so no upstream tests are

[llvm-branch-commits] [BOLT] Drop macro-fusion alignment (PR #97358)

2024-07-01 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov ready_for_review https://github.com/llvm/llvm-project/pull/97358 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [BOLT] Drop macro-fusion alignment (PR #97358)

2024-07-02 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/97358 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [BOLT] Drop macro-fusion alignment (PR #97358)

2024-07-02 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov closed https://github.com/llvm/llvm-project/pull/97358 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [BOLT] Drop macro-fusion alignment (PR #97358)

2024-07-02 Thread Amir Ayupov via llvm-branch-commits
aaupov wrote: It's not. I landed to main manually. https://github.com/llvm/llvm-project/pull/97358 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [BOLT] Match functions with name similarity (PR #95884)

2024-07-02 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/95884 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [BOLT] Match functions with name similarity (PR #95884)

2024-07-02 Thread Amir Ayupov via llvm-branch-commits
@@ -342,6 +350,107 @@ bool YAMLProfileReader::mayHaveProfileData(const BinaryFunction &BF) { return false; } +uint64_t YAMLProfileReader::matchWithNameSimilarity(BinaryContext &BC) { + uint64_t MatchedWithNameSimilarity = 0; + ItaniumPartialDemangler ItaniumPartialDemangl

[llvm-branch-commits] [llvm] [BOLT] Match functions with name similarity (PR #95884)

2024-07-02 Thread Amir Ayupov via llvm-branch-commits
@@ -342,6 +350,107 @@ bool YAMLProfileReader::mayHaveProfileData(const BinaryFunction &BF) { return false; } +uint64_t YAMLProfileReader::matchWithNameSimilarity(BinaryContext &BC) { + uint64_t MatchedWithNameSimilarity = 0; + ItaniumPartialDemangler ItaniumPartialDemangl

[llvm-branch-commits] [llvm] [BOLT] Match functions with name similarity (PR #95884)

2024-07-02 Thread Amir Ayupov via llvm-branch-commits
@@ -342,6 +350,107 @@ bool YAMLProfileReader::mayHaveProfileData(const BinaryFunction &BF) { return false; } +uint64_t YAMLProfileReader::matchWithNameSimilarity(BinaryContext &BC) { + uint64_t MatchedWithNameSimilarity = 0; + ItaniumPartialDemangler ItaniumPartialDemangl

[llvm-branch-commits] [llvm] [BOLT] Match functions with name similarity (PR #95884)

2024-07-02 Thread Amir Ayupov via llvm-branch-commits
@@ -342,6 +350,107 @@ bool YAMLProfileReader::mayHaveProfileData(const BinaryFunction &BF) { return false; } +uint64_t YAMLProfileReader::matchWithNameSimilarity(BinaryContext &BC) { + uint64_t MatchedWithNameSimilarity = 0; + ItaniumPartialDemangler ItaniumPartialDemangl

[llvm-branch-commits] [llvm] [BOLT] Match functions with name similarity (PR #95884)

2024-07-02 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov commented: LG in general with some comments https://github.com/llvm/llvm-project/pull/95884 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-co

[llvm-branch-commits] [llvm] [BOLT] Match functions with name similarity (PR #95884)

2024-07-02 Thread Amir Ayupov via llvm-branch-commits
@@ -342,6 +350,107 @@ bool YAMLProfileReader::mayHaveProfileData(const BinaryFunction &BF) { return false; } +uint64_t YAMLProfileReader::matchWithNameSimilarity(BinaryContext &BC) { + uint64_t MatchedWithNameSimilarity = 0; + ItaniumPartialDemangler ItaniumPartialDemangl

[llvm-branch-commits] [llvm] [BOLT] Match functions with name similarity (PR #95884)

2024-07-02 Thread Amir Ayupov via llvm-branch-commits
@@ -23,6 +26,11 @@ extern cl::opt Verbosity; extern cl::OptionCategory BoltOptCategory; extern cl::opt InferStaleProfile; +cl::opt NameSimilarityFunctionMatchingThreshold( +"name-similarity-function-matching-threshold", +cl::desc("Match functions using namespace and ed

[llvm-branch-commits] [llvm] [BOLT] Match blocks with calls as anchors (PR #96596)

2024-07-02 Thread Amir Ayupov via llvm-branch-commits
@@ -70,12 +70,16 @@ class YAMLProfileReader : public ProfileReaderBase { std::vector ProfileBFs; /// Populate \p Function profile with the one supplied in YAML format. - bool parseFunctionProfile(BinaryFunction &Function, -const yaml::bolt::Bin

[llvm-branch-commits] [llvm] [BOLT] Match blocks with calls as anchors (PR #96596)

2024-07-02 Thread Amir Ayupov via llvm-branch-commits
@@ -479,6 +481,11 @@ Error YAMLProfileReader::readProfile(BinaryContext &BC) { NormalizeByInsnCount = usesEvent("cycles") || usesEvent("instructions"); NormalizeByCalls = usesEvent("branches"); + // Map profiled function ids to names. + DenseMap IdToFunctionName; ---

[llvm-branch-commits] [llvm] [BOLT] Match functions with name similarity (PR #95884)

2024-07-03 Thread Amir Ayupov via llvm-branch-commits
@@ -342,6 +350,107 @@ bool YAMLProfileReader::mayHaveProfileData(const BinaryFunction &BF) { return false; } +uint64_t YAMLProfileReader::matchWithNameSimilarity(BinaryContext &BC) { + uint64_t MatchedWithNameSimilarity = 0; + ItaniumPartialDemangler Demangler; + + // De

[llvm-branch-commits] [llvm] [BOLT] Match functions with name similarity (PR #95884)

2024-07-03 Thread Amir Ayupov via llvm-branch-commits
@@ -342,6 +350,107 @@ bool YAMLProfileReader::mayHaveProfileData(const BinaryFunction &BF) { return false; } +uint64_t YAMLProfileReader::matchWithNameSimilarity(BinaryContext &BC) { + uint64_t MatchedWithNameSimilarity = 0; + ItaniumPartialDemangler Demangler; + + // De

[llvm-branch-commits] [llvm] [BOLT] Match functions with name similarity (PR #95884)

2024-07-03 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/95884 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [BOLT] Match functions with name similarity (PR #95884)

2024-07-03 Thread Amir Ayupov via llvm-branch-commits
@@ -342,6 +350,107 @@ bool YAMLProfileReader::mayHaveProfileData(const BinaryFunction &BF) { return false; } +uint64_t YAMLProfileReader::matchWithNameSimilarity(BinaryContext &BC) { + uint64_t MatchedWithNameSimilarity = 0; + ItaniumPartialDemangler Demangler; + + // De

[llvm-branch-commits] [llvm] [BOLT] Match functions with name similarity (PR #95884)

2024-07-03 Thread Amir Ayupov via llvm-branch-commits
@@ -342,6 +350,107 @@ bool YAMLProfileReader::mayHaveProfileData(const BinaryFunction &BF) { return false; } +uint64_t YAMLProfileReader::matchWithNameSimilarity(BinaryContext &BC) { + uint64_t MatchedWithNameSimilarity = 0; + ItaniumPartialDemangler Demangler; + + // De

[llvm-branch-commits] [llvm] [BOLT] Match functions with name similarity (PR #95884)

2024-07-03 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov approved this pull request. LG with a couple of nits. https://github.com/llvm/llvm-project/pull/95884 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm

[llvm-branch-commits] [llvm] [BOLT] Match functions with name similarity (PR #95884)

2024-07-03 Thread Amir Ayupov via llvm-branch-commits
@@ -342,6 +350,107 @@ bool YAMLProfileReader::mayHaveProfileData(const BinaryFunction &BF) { return false; } +uint64_t YAMLProfileReader::matchWithNameSimilarity(BinaryContext &BC) { + uint64_t MatchedWithNameSimilarity = 0; + ItaniumPartialDemangler Demangler; + + // De

[llvm-branch-commits] [llvm] [BOLT][NFC] Refactor function matching (PR #97502)

2024-07-03 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/97502 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [BOLT][NFC] Refactor function matching (PR #97502)

2024-07-03 Thread Amir Ayupov via llvm-branch-commits
@@ -334,6 +334,13 @@ Error YAMLProfileReader::preprocessProfile(BinaryContext &BC) { return Error::success(); } +bool YAMLProfileReader::profileMatches( +const yaml::bolt::BinaryFunctionProfile &Profile, BinaryFunction &BF) { aaupov wrote: ```suggestio

[llvm-branch-commits] [llvm] [BOLT][NFC] Refactor function matching (PR #97502)

2024-07-03 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov approved this pull request. LG % nit https://github.com/llvm/llvm-project/pull/97502 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [BOLT][NFC] Refactor function matching (PR #97502)

2024-07-03 Thread Amir Ayupov via llvm-branch-commits
@@ -456,6 +435,39 @@ Error YAMLProfileReader::readProfile(BinaryContext &BC) { ++MatchedWithLTOCommonName; } } + return MatchedWithLTOCommonName; +} + +Error YAMLProfileReader::readProfile(BinaryContext &BC) { + if (opts::Verbosity >= 1) { +outs() << "BOLT-INF

[llvm-branch-commits] [llvm] [BOLT] Match blocks with calls as anchors (PR #96596)

2024-07-03 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov commented: Sorry, couple of final comments https://github.com/llvm/llvm-project/pull/96596 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-com

[llvm-branch-commits] [llvm] [BOLT] Match blocks with calls as anchors (PR #96596)

2024-07-03 Thread Amir Ayupov via llvm-branch-commits
@@ -193,18 +193,43 @@ class StaleMatcher { public: /// Initialize stale matcher. void init(const std::vector &Blocks, -const std::vector &Hashes) { +const std::vector &Hashes, +const std::vector &CallHashes) { assert(Blocks.size() ==

[llvm-branch-commits] [llvm] [BOLT] Match blocks with calls as anchors (PR #96596)

2024-07-03 Thread Amir Ayupov via llvm-branch-commits
@@ -412,33 +447,62 @@ createFlowFunction(const BinaryFunction::BasicBlockOrderType &BlockOrder) { /// of the basic blocks in the binary, the count is "matched" to the block. /// Similarly, if both the source and the target of a count in the profile are /// matched to a jump in

[llvm-branch-commits] [llvm] [BOLT] Match blocks with calls as anchors (PR #96596)

2024-07-03 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/96596 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [BOLT] Match blocks with calls as anchors (PR #96596)

2024-07-03 Thread Amir Ayupov via llvm-branch-commits
@@ -193,18 +193,43 @@ class StaleMatcher { public: /// Initialize stale matcher. void init(const std::vector &Blocks, -const std::vector &Hashes) { +const std::vector &Hashes, +const std::vector &CallHashes) { assert(Blocks.size() ==

[llvm-branch-commits] [llvm] [BOLT] Match blocks with calls as anchors (PR #96596)

2024-07-03 Thread Amir Ayupov via llvm-branch-commits
@@ -220,17 +245,27 @@ class StaleMatcher { return BestBlock; } - /// Returns true if the two basic blocks (in the binary and in the profile) - /// corresponding to the given hashes are matched to each other with a high - /// confidence. - static bool isHighConfidence

[llvm-branch-commits] [llvm] [BOLT] Match blocks with calls as anchors (PR #96596)

2024-07-03 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/96596 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [BOLT] Support POSSIBLE_PIC_FIXED_BRANCH (PR #91667)

2024-07-05 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov updated https://github.com/llvm/llvm-project/pull/91667 >From dd4d0de42048c063d5e5095a0c2594c7cc578df5 Mon Sep 17 00:00:00 2001 From: Amir Ayupov Date: Thu, 9 May 2024 19:35:26 -0700 Subject: [PATCH] Fix RISCVMCPlusBuilder Created using spr 1.3.4 --- bolt/lib/Target/

[llvm-branch-commits] [llvm] [BOLT] Support POSSIBLE_PIC_FIXED_BRANCH (PR #91667)

2024-07-05 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov updated https://github.com/llvm/llvm-project/pull/91667 >From dd4d0de42048c063d5e5095a0c2594c7cc578df5 Mon Sep 17 00:00:00 2001 From: Amir Ayupov Date: Thu, 9 May 2024 19:35:26 -0700 Subject: [PATCH] Fix RISCVMCPlusBuilder Created using spr 1.3.4 --- bolt/lib/Target/

[llvm-branch-commits] [llvm] [BOLT] Eliminate dead jump tables (PR #91666)

2024-07-05 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov closed https://github.com/llvm/llvm-project/pull/91666 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [BOLT] Support POSSIBLE_PIC_FIXED_BRANCH (PR #91667)

2024-07-05 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov updated https://github.com/llvm/llvm-project/pull/91667 >From dd4d0de42048c063d5e5095a0c2594c7cc578df5 Mon Sep 17 00:00:00 2001 From: Amir Ayupov Date: Thu, 9 May 2024 19:35:26 -0700 Subject: [PATCH 1/2] Fix RISCVMCPlusBuilder Created using spr 1.3.4 --- bolt/lib/Tar

[llvm-branch-commits] [llvm] [BOLT] Support POSSIBLE_PIC_FIXED_BRANCH (PR #91667)

2024-07-06 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov updated https://github.com/llvm/llvm-project/pull/91667 >From dd4d0de42048c063d5e5095a0c2594c7cc578df5 Mon Sep 17 00:00:00 2001 From: Amir Ayupov Date: Thu, 9 May 2024 19:35:26 -0700 Subject: [PATCH 1/3] Fix RISCVMCPlusBuilder Created using spr 1.3.4 --- bolt/lib/Tar

[llvm-branch-commits] [llvm] [BOLT] Match blocks with calls as anchors (PR #96596)

2024-07-08 Thread Amir Ayupov via llvm-branch-commits
@@ -35,6 +36,12 @@ std::string hashBlock(BinaryContext &BC, const BinaryBasicBlock &BB, std::string hashBlockLoose(BinaryContext &BC, const BinaryBasicBlock &BB); +std::string hashBlockCalls(BinaryContext &BC, const BinaryBasicBlock &BB); + +std::string +hashBlockCalls(const

[llvm-branch-commits] [llvm] [BOLT] Match blocks with calls as anchors (PR #96596)

2024-07-08 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov approved this pull request. Thanks. https://github.com/llvm/llvm-project/pull/96596 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [BOLT] Match blocks with calls as anchors (PR #96596)

2024-07-09 Thread Amir Ayupov via llvm-branch-commits
@@ -40,6 +40,8 @@ class YAMLProfileReader : public ProfileReaderBase { /// Check if the file contains YAML. static bool isYAML(StringRef Filename); + using FunctionMap = DenseMap; aaupov wrote: ```suggestion using ProfileLookupMap = DenseMap; ``` http

[llvm-branch-commits] [llvm] [BOLT] Match blocks with calls as anchors (PR #96596)

2024-07-09 Thread Amir Ayupov via llvm-branch-commits
@@ -181,20 +182,19 @@ std::string hashBlockCalls(BinaryContext &BC, const BinaryBasicBlock &BB) { /// The same as the $hashBlockCalls function, but for profiled functions. std::string -hashBlockCalls(const DenseMap &IdToFunctionName, +hashBlockCalls(const DenseMap +

[llvm-branch-commits] [llvm] [BOLT] Match blocks with calls as anchors (PR #96596)

2024-07-10 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/96596 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [BOLT] Match blocks with calls as anchors (PR #96596)

2024-07-10 Thread Amir Ayupov via llvm-branch-commits
@@ -63,8 +63,8 @@ class NameResolver { } // Removes a suffix from a function name. - static StringRef removeSuffix(StringRef Name, StringRef Suffix) { -const size_t Pos = Name.find(Suffix); + static StringRef unify(StringRef Name) { aaupov wrote: Le

[llvm-branch-commits] [llvm] [BOLT] Match blocks with calls as anchors (PR #96596)

2024-07-10 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov commented: Thanks, LG with one nit. https://github.com/llvm/llvm-project/pull/96596 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [BOLT] Match blocks with calls as anchors (PR #96596)

2024-07-10 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov approved this pull request. https://github.com/llvm/llvm-project/pull/96596 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [NFC][BOLT] Rename createDummyReturnFunction to createReturnBody (PR #98448)

2024-07-11 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov approved this pull request. Suggestion: `createReturnInstructionList` https://github.com/llvm/llvm-project/pull/98448 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailm

[llvm-branch-commits] [llvm] [BOLT] Added more details on heatmap docs. (PR #98162)

2024-07-11 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov approved this pull request. Awesome, thanks for updating the documentation https://github.com/llvm/llvm-project/pull/98162 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/

[llvm-branch-commits] [llvm] [BOLT] Added more details on heatmap docs. (PR #98162)

2024-07-11 Thread Amir Ayupov via llvm-branch-commits
aaupov wrote: Please retitle as imperative statement and drop trailing dot, e.g. `[BOLT][docs] Expand Heatmaps.md` https://github.com/llvm/llvm-project/pull/98162 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.ll

<    1   2   3   4   5   6   7   8   >