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

2024-06-24 Thread shaw young via llvm-branch-commits
https://github.com/shawbyoung updated https://github.com/llvm/llvm-project/pull/95821 >From 92212c96ea169d26ac10bf8d750539bc5dd72c49 Mon Sep 17 00:00:00 2001 From: shawbyoung Date: Mon, 17 Jun 2024 15:39:02 -0700 Subject: [PATCH 01/20] spr amend Created using spr 1.3.4 --- bolt/lib/Profile/YA

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

2024-06-24 Thread shaw young via llvm-branch-commits
https://github.com/shawbyoung updated https://github.com/llvm/llvm-project/pull/95821 >From 92212c96ea169d26ac10bf8d750539bc5dd72c49 Mon Sep 17 00:00:00 2001 From: shawbyoung Date: Mon, 17 Jun 2024 15:39:02 -0700 Subject: [PATCH 01/20] spr amend Created using spr 1.3.4 --- bolt/lib/Profile/YA

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

2024-06-24 Thread shaw young via llvm-branch-commits
https://github.com/shawbyoung updated https://github.com/llvm/llvm-project/pull/95821 >From 92212c96ea169d26ac10bf8d750539bc5dd72c49 Mon Sep 17 00:00:00 2001 From: shawbyoung Date: Mon, 17 Jun 2024 15:39:02 -0700 Subject: [PATCH 01/20] spr amend Created using spr 1.3.4 --- bolt/lib/Profile/YA

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

2024-06-22 Thread shaw young via llvm-branch-commits
https://github.com/shawbyoung updated https://github.com/llvm/llvm-project/pull/95821 >From 92212c96ea169d26ac10bf8d750539bc5dd72c49 Mon Sep 17 00:00:00 2001 From: shawbyoung Date: Mon, 17 Jun 2024 15:39:02 -0700 Subject: [PATCH 01/19] spr amend Created using spr 1.3.4 --- bolt/lib/Profile/YA

[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] 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
@@ -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
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-21 Thread shaw young via llvm-branch-commits
https://github.com/shawbyoung updated https://github.com/llvm/llvm-project/pull/95821 >From 92212c96ea169d26ac10bf8d750539bc5dd72c49 Mon Sep 17 00:00:00 2001 From: shawbyoung Date: Mon, 17 Jun 2024 15:39:02 -0700 Subject: [PATCH 01/18] spr amend Created using spr 1.3.4 --- bolt/lib/Profile/YA

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

2024-06-21 Thread shaw young via llvm-branch-commits
https://github.com/shawbyoung updated https://github.com/llvm/llvm-project/pull/95821 >From 92212c96ea169d26ac10bf8d750539bc5dd72c49 Mon Sep 17 00:00:00 2001 From: shawbyoung Date: Mon, 17 Jun 2024 15:39:02 -0700 Subject: [PATCH 01/17] spr amend Created using spr 1.3.4 --- bolt/lib/Profile/YA

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

2024-06-21 Thread shaw young via llvm-branch-commits
https://github.com/shawbyoung updated https://github.com/llvm/llvm-project/pull/95821 >From 92212c96ea169d26ac10bf8d750539bc5dd72c49 Mon Sep 17 00:00:00 2001 From: shawbyoung Date: Mon, 17 Jun 2024 15:39:02 -0700 Subject: [PATCH 01/16] spr amend Created using spr 1.3.4 --- bolt/lib/Profile/YA

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

2024-06-21 Thread shaw young via llvm-branch-commits
https://github.com/shawbyoung updated https://github.com/llvm/llvm-project/pull/95821 >From 92212c96ea169d26ac10bf8d750539bc5dd72c49 Mon Sep 17 00:00:00 2001 From: shawbyoung Date: Mon, 17 Jun 2024 15:39:02 -0700 Subject: [PATCH 01/15] spr amend Created using spr 1.3.4 --- bolt/lib/Profile/YA

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

2024-06-21 Thread shaw young via llvm-branch-commits
https://github.com/shawbyoung 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-21 Thread shaw young via llvm-branch-commits
@@ -1161,4 +1165,4 @@ - `--print-options` - Print non-default options after command line parsing shawbyoung wrote: Didn't touch this line - diff return nothing when applied to "added" and "deleted" line - maybe it's some git corner case? https://github.co

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

2024-06-21 Thread shaw young via llvm-branch-commits
@@ -374,15 +393,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] Hash-based function matching (PR #95821)

2024-06-21 Thread via llvm-branch-commits
@@ -374,15 +393,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] 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
@@ -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
@@ -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
@@ -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-20 Thread shaw young via llvm-branch-commits
https://github.com/shawbyoung updated https://github.com/llvm/llvm-project/pull/95821 >From 92212c96ea169d26ac10bf8d750539bc5dd72c49 Mon Sep 17 00:00:00 2001 From: shawbyoung Date: Mon, 17 Jun 2024 15:39:02 -0700 Subject: [PATCH 01/14] spr amend Created using spr 1.3.4 --- bolt/lib/Profile/YA

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

2024-06-20 Thread shaw young via llvm-branch-commits
https://github.com/shawbyoung 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-20 Thread shaw young via llvm-branch-commits
https://github.com/shawbyoung updated https://github.com/llvm/llvm-project/pull/95821 >From 92212c96ea169d26ac10bf8d750539bc5dd72c49 Mon Sep 17 00:00:00 2001 From: shawbyoung Date: Mon, 17 Jun 2024 15:39:02 -0700 Subject: [PATCH 01/13] spr amend Created using spr 1.3.4 --- bolt/lib/Profile/YA

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

2024-06-20 Thread shaw young via llvm-branch-commits
https://github.com/shawbyoung updated https://github.com/llvm/llvm-project/pull/95821 >From 92212c96ea169d26ac10bf8d750539bc5dd72c49 Mon Sep 17 00:00:00 2001 From: shawbyoung Date: Mon, 17 Jun 2024 15:39:02 -0700 Subject: [PATCH 01/12] spr amend Created using spr 1.3.4 --- bolt/lib/Profile/YA

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

2024-06-20 Thread shaw young via llvm-branch-commits
https://github.com/shawbyoung updated https://github.com/llvm/llvm-project/pull/95821 >From 92212c96ea169d26ac10bf8d750539bc5dd72c49 Mon Sep 17 00:00:00 2001 From: shawbyoung Date: Mon, 17 Jun 2024 15:39:02 -0700 Subject: [PATCH 01/11] spr amend Created using spr 1.3.4 --- bolt/lib/Profile/YA

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

2024-06-20 Thread shaw young via llvm-branch-commits
https://github.com/shawbyoung updated https://github.com/llvm/llvm-project/pull/95821 >From 92212c96ea169d26ac10bf8d750539bc5dd72c49 Mon Sep 17 00:00:00 2001 From: shawbyoung Date: Mon, 17 Jun 2024 15:39:02 -0700 Subject: [PATCH 01/10] spr amend Created using spr 1.3.4 --- bolt/lib/Profile/YA

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

2024-06-20 Thread shaw young via llvm-branch-commits
https://github.com/shawbyoung updated https://github.com/llvm/llvm-project/pull/95821 >From 92212c96ea169d26ac10bf8d750539bc5dd72c49 Mon Sep 17 00:00:00 2001 From: shawbyoung Date: Mon, 17 Jun 2024 15:39:02 -0700 Subject: [PATCH 1/9] spr amend Created using spr 1.3.4 --- bolt/lib/Profile/YAML

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

2024-06-20 Thread Alexander Yermolovich via llvm-branch-commits
@@ -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

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

2024-06-20 Thread Alexander Yermolovich via llvm-branch-commits
@@ -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

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

2024-06-20 Thread shaw young via llvm-branch-commits
https://github.com/shawbyoung updated https://github.com/llvm/llvm-project/pull/95821 >From 92212c96ea169d26ac10bf8d750539bc5dd72c49 Mon Sep 17 00:00:00 2001 From: shawbyoung Date: Mon, 17 Jun 2024 15:39:02 -0700 Subject: [PATCH 1/8] spr amend Created using spr 1.3.4 --- bolt/lib/Profile/YAML

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

2024-06-20 Thread shaw young via llvm-branch-commits
https://github.com/shawbyoung updated https://github.com/llvm/llvm-project/pull/95821 >From 92212c96ea169d26ac10bf8d750539bc5dd72c49 Mon Sep 17 00:00:00 2001 From: shawbyoung Date: Mon, 17 Jun 2024 15:39:02 -0700 Subject: [PATCH 1/7] spr amend Created using spr 1.3.4 --- bolt/lib/Profile/YAML

[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] 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
@@ -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 shaw young via llvm-branch-commits
https://github.com/shawbyoung updated https://github.com/llvm/llvm-project/pull/95821 >From 92212c96ea169d26ac10bf8d750539bc5dd72c49 Mon Sep 17 00:00:00 2001 From: shawbyoung Date: Mon, 17 Jun 2024 15:39:02 -0700 Subject: [PATCH 1/6] spr amend Created using spr 1.3.4 --- bolt/lib/Profile/YAML

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

2024-06-17 Thread shaw young via llvm-branch-commits
https://github.com/shawbyoung updated https://github.com/llvm/llvm-project/pull/95821 >From 92212c96ea169d26ac10bf8d750539bc5dd72c49 Mon Sep 17 00:00:00 2001 From: shawbyoung Date: Mon, 17 Jun 2024 15:39:02 -0700 Subject: [PATCH 1/5] spr amend Created using spr 1.3.4 --- bolt/lib/Profile/YAML

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

2024-06-17 Thread shaw young via llvm-branch-commits
https://github.com/shawbyoung updated https://github.com/llvm/llvm-project/pull/95821 >From 92212c96ea169d26ac10bf8d750539bc5dd72c49 Mon Sep 17 00:00:00 2001 From: shawbyoung Date: Mon, 17 Jun 2024 15:39:02 -0700 Subject: [PATCH 1/4] spr amend Created using spr 1.3.4 --- bolt/lib/Profile/YAML

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

2024-06-17 Thread shaw young via llvm-branch-commits
https://github.com/shawbyoung updated https://github.com/llvm/llvm-project/pull/95821 >From 92212c96ea169d26ac10bf8d750539bc5dd72c49 Mon Sep 17 00:00:00 2001 From: shawbyoung Date: Mon, 17 Jun 2024 15:39:02 -0700 Subject: [PATCH 1/3] spr amend Created using spr 1.3.4 --- bolt/lib/Profile/YAML

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

2024-06-17 Thread shaw young via llvm-branch-commits
https://github.com/shawbyoung updated https://github.com/llvm/llvm-project/pull/95821 >From 92212c96ea169d26ac10bf8d750539bc5dd72c49 Mon Sep 17 00:00:00 2001 From: shawbyoung Date: Mon, 17 Jun 2024 15:39:02 -0700 Subject: [PATCH 1/2] spr amend Created using spr 1.3.4 --- bolt/lib/Profile/YAML

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

2024-06-17 Thread shaw young via llvm-branch-commits
https://github.com/shawbyoung updated https://github.com/llvm/llvm-project/pull/95821 >From 92212c96ea169d26ac10bf8d750539bc5dd72c49 Mon Sep 17 00:00:00 2001 From: shawbyoung Date: Mon, 17 Jun 2024 15:39:02 -0700 Subject: [PATCH] spr amend Created using spr 1.3.4 --- bolt/lib/Profile/YAMLProf