[llvm-branch-commits] [BOLT][NFC] Print timers in perf2bolt invocation (PR #101270)

2024-07-31 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov updated https://github.com/llvm/llvm-project/pull/101270 ___ 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] Print timers in perf2bolt invocation (PR #101270)

2024-07-31 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov updated https://github.com/llvm/llvm-project/pull/101270 ___ 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] Print timers in perf2bolt invocation (PR #101270)

2024-07-30 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov created https://github.com/llvm/llvm-project/pull/101270 When BOLT is run in AggregateOnly mode (perf2bolt), it exits with code zero so destructors are not run thus TimerGroup never prints the timers. Add explicit printing just before the exit to honor options

[llvm-branch-commits] [llvm] [BOLT] Add profile density computation (PR #101094)

2024-07-30 Thread Amir Ayupov via llvm-branch-commits
@@ -223,6 +223,22 @@ static cl::opt TopCalledLimit( "functions section"), cl::init(100), cl::Hidden, cl::cat(BoltCategory)); +// Profile density options, synced with llvm-profgen/ProfileGenerator.cpp +static cl::opt ShowDensity("show-density",

[llvm-branch-commits] [llvm] [BOLT] Add profile density computation (PR #101094)

2024-07-29 Thread Amir Ayupov via llvm-branch-commits
@@ -223,6 +223,22 @@ static cl::opt TopCalledLimit( "functions section"), cl::init(100), cl::Hidden, cl::cat(BoltCategory)); +// Profile density options, synced with llvm-profgen/ProfileGenerator.cpp +static cl::opt ShowDensity("show-density",

[llvm-branch-commits] [MC][NFC] Store MCPseudoProbeFuncDesc::FuncName as StringRef (PR #100655)

2024-07-25 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov created https://github.com/llvm/llvm-project/pull/100655 Reduces peak RSS in `perf2bolt --profile-use-pseudo-probes` to 16.04GiB. ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org

[llvm-branch-commits] [llvm] [BOLT] Match blocks with pseudo probes (PR #99891)

2024-07-24 Thread Amir Ayupov via llvm-branch-commits
@@ -45,6 +45,8 @@ namespace opts { extern cl::opt TimeRewrite; extern cl::OptionCategory BoltOptCategory; +extern cl::opt Verbosity; +extern cl::opt ProfileUsePseudoProbes; aaupov wrote: > The profile (not stale matching) is clearly using probe as probe

[llvm-branch-commits] [llvm] [BOLT] Match blocks with pseudo probes (PR #99891)

2024-07-24 Thread Amir Ayupov via llvm-branch-commits
@@ -45,6 +45,8 @@ namespace opts { extern cl::opt TimeRewrite; extern cl::OptionCategory BoltOptCategory; +extern cl::opt Verbosity; +extern cl::opt ProfileUsePseudoProbes; aaupov wrote: > Ok, I think we need a dedicated flag to control matching strategy,

[llvm-branch-commits] [llvm] [BOLT] Match blocks with pseudo probes (PR #99891)

2024-07-24 Thread Amir Ayupov via llvm-branch-commits
@@ -208,11 +212,33 @@ class StaleMatcher { } } - /// Find the most similar block for a given hash. - const FlowBlock *matchBlock(BlendedBlockHash BlendedHash, - uint64_t CallHash) const { + /// Creates a mapping from a pseudo probe index

[llvm-branch-commits] [llvm] [BOLT] Match blocks with pseudo probes (PR #99891)

2024-07-24 Thread Amir Ayupov via llvm-branch-commits
@@ -45,6 +45,8 @@ namespace opts { extern cl::opt TimeRewrite; extern cl::OptionCategory BoltOptCategory; +extern cl::opt Verbosity; +extern cl::opt ProfileUsePseudoProbes; aaupov wrote: No, I intended `ProfileUsePseudoProbes` to cover both generation and

[llvm-branch-commits] [llvm] [BOLT] Match blocks with pseudo probes (PR #99891)

2024-07-24 Thread Amir Ayupov via llvm-branch-commits
@@ -266,6 +313,65 @@ class StaleMatcher { } return BestBlock; } + // Uses pseudo probe information to attach the profile to the appropriate + // block. + const FlowBlock *matchWithPseudoProbes( + BlendedBlockHash BlendedHash, + const std::vector ) const

[llvm-branch-commits] [llvm] [BOLT] Match blocks with pseudo probes (PR #99891)

2024-07-24 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov approved this pull request. LG but let's give some time for other reviewers https://github.com/llvm/llvm-project/pull/99891 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org

[llvm-branch-commits] [llvm] [BOLT] Match blocks with pseudo probes (PR #99891)

2024-07-24 Thread Amir Ayupov via llvm-branch-commits
@@ -206,13 +213,30 @@ class StaleMatcher { CallHashToBlocks[CallHashes[I]].push_back( std::make_pair(Hashes[I], Block)); } +this->IndexToBBPseudoProbes = IndexToBBPseudoProbes; +this->BBPseudoProbeToBlock = BBPseudoProbeToBlock; +

[llvm-branch-commits] [BOLT] Add profile-use-pseudo-probes option (PR #100299)

2024-07-24 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov updated https://github.com/llvm/llvm-project/pull/100299 ___ 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] Add profile-use-pseudo-probes option (PR #100299)

2024-07-24 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov updated https://github.com/llvm/llvm-project/pull/100299 ___ 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] Add profile-use-pseudo-probes option (PR #100299)

2024-07-24 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov ready_for_review https://github.com/llvm/llvm-project/pull/100299 ___ 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] Support more than two jump table parents (PR #99988)

2024-07-24 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov updated https://github.com/llvm/llvm-project/pull/99988 ___ 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] Support more than two jump table parents (PR #99988)

2024-07-24 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov updated https://github.com/llvm/llvm-project/pull/99988 ___ 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 pseudo probes (PR #99891)

2024-07-23 Thread Amir Ayupov via llvm-branch-commits
@@ -555,6 +574,10 @@ size_t matchWeightsByHashes( ProbeMap.lower_bound(FuncAddr + BlockRange.second)); for (const auto &[_, Probes] : BlockProbes) { for (const MCDecodedPseudoProbe : Probes) { + if

[llvm-branch-commits] [llvm] [BOLT] Match blocks with pseudo probes (PR #99891)

2024-07-23 Thread Amir Ayupov via llvm-branch-commits
@@ -306,26 +310,41 @@ class StaleMatcher { BlockPseudoProbes.push_back(); } - // Returns nullptr if there is not a 1:1 mapping of the yaml block pseudo // probe and binary pseudo probe. -if (BlockPseudoProbes.size() == 0 || BlockPseudoProbes.size() >

[llvm-branch-commits] [llvm] [BOLT] Match blocks with pseudo probes (PR #99891)

2024-07-23 Thread Amir Ayupov via llvm-branch-commits
@@ -266,6 +287,47 @@ class StaleMatcher { } return BestBlock; } + // Uses pseudo probe information to attach the profile to the appropriate + // block. + const FlowBlock *matchWithPseudoProbes( + const std::vector ) const { +// Searches for the pseudo

[llvm-branch-commits] [llvm] [BOLT] Match blocks with pseudo probes (PR #99891)

2024-07-22 Thread Amir Ayupov via llvm-branch-commits
@@ -266,6 +287,47 @@ class StaleMatcher { } return BestBlock; } + // Uses pseudo probe information to attach the profile to the appropriate + // block. + const FlowBlock *matchWithPseudoProbes( + const std::vector ) const { +// Searches for the pseudo

[llvm-branch-commits] [llvm] [BOLT][NFC] Track fragment relationships using EquivalenceClasses (PR #99979)

2024-07-22 Thread Amir Ayupov via llvm-branch-commits
@@ -241,6 +242,10 @@ class BinaryContext { /// Function fragments to skip. std::unordered_set FragmentsToSkip; + /// Fragment equivalence classes to query belonging to the same "family" in + /// presence of multiple fragments/multiple parents. + EquivalenceClasses

[llvm-branch-commits] [BOLT] Support more than two jump table parents (PR #99988)

2024-07-22 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov updated https://github.com/llvm/llvm-project/pull/99988 ___ 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] Support more than two jump table parents (PR #99988)

2024-07-22 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov updated https://github.com/llvm/llvm-project/pull/99988 ___ 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] Track fragment relationships using EquivalenceClasses (PR #99979)

2024-07-22 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov updated https://github.com/llvm/llvm-project/pull/99979 >From f6478e36a962843329c519ba35ad2a132ffd8c9e Mon Sep 17 00:00:00 2001 From: Amir Ayupov Date: Mon, 22 Jul 2024 16:34:02 -0700 Subject: [PATCH] fix getOrCreateJumpTable Created using spr 1.3.4 ---

[llvm-branch-commits] [BOLT] Support more than two jump table parents (PR #99988)

2024-07-22 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov created https://github.com/llvm/llvm-project/pull/99988 Multi-way splitting can cause multiple fragments to access the same jump table. Relax the assumption that a jump table can only have up to two parents. Test Plan: added bolt/test/X86/three-way-split-jt.s

[llvm-branch-commits] [BOLT][NFC] Track fragment relationships using EquivalenceClasses (PR #99979)

2024-07-22 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov created https://github.com/llvm/llvm-project/pull/99979 Three-way splitting can create references between split fragments (warm to cold or vice versa) that are not handled by `isChildOf/isParentOf/isChildOrParentOf`. Generalize fragment relationships to allow checking

[llvm-branch-commits] [MC][NFC] Use std::map for AddressProbesMap (PR #99553)

2024-07-18 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov updated https://github.com/llvm/llvm-project/pull/99553 ___ 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] [MC][NFC] Use std::map for AddressProbesMap (PR #99553)

2024-07-18 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov updated https://github.com/llvm/llvm-project/pull/99553 ___ 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-18 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov closed https://github.com/llvm/llvm-project/pull/91667 ___ 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-18 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/6] Fix RISCVMCPlusBuilder Created using spr 1.3.4 ---

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

2024-07-18 Thread Amir Ayupov via llvm-branch-commits
@@ -1876,6 +1876,13 @@ class X86MCPlusBuilder : public MCPlusBuilder { //add %r2, %r1 //jmp *%r1 // +// or a fixed indirect jump template: +// +//movslq En(%rip), {%r2|%r1} +//lea PIC_JUMP_TABLE(%rip), {%r1|%r2} <- MemLocInstr

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

2024-07-18 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/5] Fix RISCVMCPlusBuilder Created using spr 1.3.4 ---

[llvm-branch-commits] [llvm] [BOLT] Attach pseudo probes to blocks in YAML profile (PR #99554)

2024-07-18 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov updated https://github.com/llvm/llvm-project/pull/99554 >From 9498f8f38cea050fd363d5d4591e8401e5de8bd5 Mon Sep 17 00:00:00 2001 From: Amir Ayupov Date: Thu, 18 Jul 2024 12:49:23 -0700 Subject: [PATCH 1/2] Fix operator== Created using spr 1.3.4 ---

[llvm-branch-commits] [llvm] [BOLT] Attach pseudo probes to blocks in YAML profile (PR #99554)

2024-07-18 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov updated https://github.com/llvm/llvm-project/pull/99554 >From 9498f8f38cea050fd363d5d4591e8401e5de8bd5 Mon Sep 17 00:00:00 2001 From: Amir Ayupov Date: Thu, 18 Jul 2024 12:49:23 -0700 Subject: [PATCH] Fix operator== Created using spr 1.3.4 ---

[llvm-branch-commits] [MC][NFC] Use std::map for AddressProbesMap (PR #99553)

2024-07-18 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/99553 ___ 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] Attach pseudo probes to blocks in YAML profile (PR #99554)

2024-07-18 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov created https://github.com/llvm/llvm-project/pull/99554 Read pseudo probes in regular and BAT YAML profile generation, and attach them to YAML profile basic blocks. This exposes GUID, probe id, and probe type in profile for future use in stale profile matching. Test

[llvm-branch-commits] [MC][NFC] Use std::map for AddressProbesMap (PR #99553)

2024-07-18 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov created https://github.com/llvm/llvm-project/pull/99553 AddressProbesMap is keyed by binary addresses, and it makes sense to treat them as ordered. This also enables slicing by binary function/ binary basic block, to be used in BOLT. Test Plan: NFC

[llvm-branch-commits] [llvm] [BOLT] Match functions with call graph (PR #98125)

2024-07-17 Thread Amir Ayupov via llvm-branch-commits
@@ -43,6 +43,57 @@ class YAMLProfileReader : public ProfileReaderBase { using ProfileLookupMap = DenseMap; + /// A class for matching binary functions in functions in the YAML profile. + /// First, a call graph is constructed for both profiled and binary functions.

[llvm-branch-commits] [llvm] [BOLT] Match functions with call graph (PR #98125)

2024-07-17 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/98125 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org

[llvm-branch-commits] [llvm] [BOLT] Match functions with call graph (PR #98125)

2024-07-17 Thread Amir Ayupov via llvm-branch-commits
@@ -43,6 +43,57 @@ class YAMLProfileReader : public ProfileReaderBase { using ProfileLookupMap = DenseMap; + /// A class for matching binary functions in functions in the YAML profile. + /// First, a call graph is constructed for both profiled and binary functions.

[llvm-branch-commits] [llvm] [BOLT] Match functions with call graph (PR #98125)

2024-07-17 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/98125 ___ 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 call graph (PR #98125)

2024-07-15 Thread Amir Ayupov via llvm-branch-commits
@@ -446,6 +503,56 @@ size_t YAMLProfileReader::matchWithLTOCommonName() { return MatchedWithLTOCommonName; } +size_t YAMLProfileReader::matchWithCallGraph(BinaryContext ) { + if (!opts::MatchWithCallGraph) +return 0; + + size_t MatchedWithCallGraph = 0; +

[llvm-branch-commits] [llvm] [BOLT] Match functions with call graph (PR #98125)

2024-07-15 Thread Amir Ayupov via llvm-branch-commits
@@ -568,12 +675,30 @@ Error YAMLProfileReader::readProfile(BinaryContext ) { } YamlProfileToFunction.resize(YamlBP.Functions.size() + 1); - // Computes hash for binary functions. + // Map profiled function ids to names. + for (yaml::bolt::BinaryFunctionProfile :

[llvm-branch-commits] [llvm] [BOLT] Match functions with call graph (PR #98125)

2024-07-15 Thread Amir Ayupov via llvm-branch-commits
@@ -16,6 +16,37 @@ namespace llvm { namespace bolt { +/// A class for matching binary functions in functions in the YAML profile. +struct CallGraphMatcher { aaupov wrote: Let's make it a proper class https://github.com/llvm/llvm-project/pull/98125

[llvm-branch-commits] [llvm] [BOLT] Match functions with call graph (PR #98125)

2024-07-15 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/98125 ___ 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 call graph (PR #98125)

2024-07-15 Thread Amir Ayupov via llvm-branch-commits
https://github.com/aaupov commented: Thank you for working on this! It looks very good overall, left a couple of comments inline. Please run this new matching on a large binary to answer questions about runtime and matching quality in ambiguous cases.

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

2024-07-14 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/4] Fix RISCVMCPlusBuilder Created using spr 1.3.4 ---

[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

[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

[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

[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] [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:

[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 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-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; ```

[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 , const BinaryBasicBlock ) { /// The same as the $hashBlockCalls function, but for profiled functions. std::string -hashBlockCalls(const DenseMap , +hashBlockCalls(const DenseMap + ,

[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-08 Thread Amir Ayupov via llvm-branch-commits
@@ -35,6 +36,12 @@ std::string hashBlock(BinaryContext , const BinaryBasicBlock , std::string hashBlockLoose(BinaryContext , const BinaryBasicBlock ); +std::string hashBlockCalls(BinaryContext , const BinaryBasicBlock ); + +std::string +hashBlockCalls(const DenseMap ,

[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 ---

[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 ---

[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] Fix RISCVMCPlusBuilder Created using spr 1.3.4 ---

[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 ---

[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
@@ -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

[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 , -const std::vector ) { +const std::vector , +const std::vector ) { assert(Blocks.size() == Hashes.size() && +

[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 , -const std::vector ) { +const std::vector , +const std::vector ) { assert(Blocks.size() == Hashes.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 ) { /// 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 the

[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

[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 ) { ++MatchedWithLTOCommonName; } } + return MatchedWithLTOCommonName; +} + +Error YAMLProfileReader::readProfile(BinaryContext ) { + if (opts::Verbosity >= 1) { +outs() << "BOLT-INFO:

[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
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 ) { return Error::success(); } +bool YAMLProfileReader::profileMatches( +const yaml::bolt::BinaryFunctionProfile , BinaryFunction ) { aaupov wrote: ```suggestion const

[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

[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 ) { return false; } +uint64_t YAMLProfileReader::matchWithNameSimilarity(BinaryContext ) { + uint64_t MatchedWithNameSimilarity = 0; + ItaniumPartialDemangler Demangler; + + //

[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 ) { return false; } +uint64_t YAMLProfileReader::matchWithNameSimilarity(BinaryContext ) { + uint64_t MatchedWithNameSimilarity = 0; + ItaniumPartialDemangler Demangler; + + //

[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 ) { return false; } +uint64_t YAMLProfileReader::matchWithNameSimilarity(BinaryContext ) { + uint64_t MatchedWithNameSimilarity = 0; + ItaniumPartialDemangler Demangler; + + //

[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 ) { return false; } +uint64_t YAMLProfileReader::matchWithNameSimilarity(BinaryContext ) { + uint64_t MatchedWithNameSimilarity = 0; + ItaniumPartialDemangler Demangler; + + //

[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 ) { return false; } +uint64_t YAMLProfileReader::matchWithNameSimilarity(BinaryContext ) { + uint64_t MatchedWithNameSimilarity = 0; + ItaniumPartialDemangler Demangler; + + //

[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 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 , -const

[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 ) { 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-02 Thread Amir Ayupov via llvm-branch-commits
@@ -342,6 +350,107 @@ bool YAMLProfileReader::mayHaveProfileData(const BinaryFunction ) { return false; } +uint64_t YAMLProfileReader::matchWithNameSimilarity(BinaryContext ) { + uint64_t MatchedWithNameSimilarity = 0; + ItaniumPartialDemangler ItaniumPartialDemangler; +

[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

[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 ) { return false; } +uint64_t YAMLProfileReader::matchWithNameSimilarity(BinaryContext ) { + uint64_t MatchedWithNameSimilarity = 0; + ItaniumPartialDemangler ItaniumPartialDemangler;

[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 ) { return false; } +uint64_t YAMLProfileReader::matchWithNameSimilarity(BinaryContext ) { + uint64_t MatchedWithNameSimilarity = 0; + ItaniumPartialDemangler ItaniumPartialDemangler; +

[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 ) { return false; } +uint64_t YAMLProfileReader::matchWithNameSimilarity(BinaryContext ) { + uint64_t MatchedWithNameSimilarity = 0; + ItaniumPartialDemangler ItaniumPartialDemangler; +

[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 ) { return false; } +uint64_t YAMLProfileReader::matchWithNameSimilarity(BinaryContext ) { + uint64_t MatchedWithNameSimilarity = 0; + ItaniumPartialDemangler ItaniumPartialDemangler; +

[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

[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] [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] [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
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-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-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

[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

[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

  1   2   3   4   5   6   7   >