https://github.com/dcci approved this pull request.
LG
https://github.com/llvm/llvm-project/pull/128546
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/dcci approved this pull request.
https://github.com/llvm/llvm-project/pull/126881
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
dcci wrote:
OK with merging this.
https://github.com/llvm/llvm-project/pull/126881
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/dcci approved this pull request.
Thanks.
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
@@ -223,10 +249,31 @@ class StaleMatcher {
return Hash1.InstrHash == Hash2.InstrHash;
}
+ /// Returns true if a profiled block was matched with its pseudo probe.
+ bool isPseudoProbeMatch(BlendedBlockHash YamlBBHash) {
+return MatchedWithPseudoProbes.find(YamlBBHas
@@ -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 &PseudoPr
https://github.com/dcci commented:
some comments.
https://github.com/llvm/llvm-project/pull/99891
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -223,10 +249,31 @@ class StaleMatcher {
return Hash1.InstrHash == Hash2.InstrHash;
}
+ /// Returns true if a profiled block was matched with its pseudo probe.
+ bool isPseudoProbeMatch(BlendedBlockHash YamlBBHash) {
+return MatchedWithPseudoProbes.find(YamlBBHas
@@ -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 &PseudoPr
@@ -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 &PseudoPr
https://github.com/dcci edited https://github.com/llvm/llvm-project/pull/99891
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/dcci approved this pull request.
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
https://github.com/dcci commented:
LG
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
@@ -446,6 +503,56 @@ size_t YAMLProfileReader::matchWithLTOCommonName() {
return MatchedWithLTOCommonName;
}
+size_t YAMLProfileReader::matchWithCallGraph(BinaryContext &BC) {
+ if (!opts::MatchWithCallGraph)
+return 0;
+
+ size_t MatchedWithCallGraph = 0;
+ CGMatcher
@@ -50,6 +54,59 @@ llvm::cl::opt ProfileUseDFS("profile-use-dfs",
namespace llvm {
namespace bolt {
+void CallGraphMatcher::addBFCGEdges(BinaryContext &BC,
+yaml::bolt::BinaryProfile &YamlBP,
+BinaryFuncti
@@ -568,12 +675,30 @@ Error YAMLProfileReader::readProfile(BinaryContext &BC) {
}
YamlProfileToFunction.resize(YamlBP.Functions.size() + 1);
- // Computes hash for binary functions.
+ // Map profiled function ids to names.
+ for (yaml::bolt::BinaryFunctionProfile &YamlB
@@ -446,6 +503,56 @@ size_t YAMLProfileReader::matchWithLTOCommonName() {
return MatchedWithLTOCommonName;
}
+size_t YAMLProfileReader::matchWithCallGraph(BinaryContext &BC) {
+ if (!opts::MatchWithCallGraph)
+return 0;
+
+ size_t MatchedWithCallGraph = 0;
+ CGMatcher
https://github.com/dcci 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
@@ -16,6 +16,37 @@
namespace llvm {
namespace bolt {
+/// A class for matching binary functions in functions in the YAML profile.
dcci wrote:
I think it would be useful to add a general description of the algorithm, in
particular if you have a reference to t
https://github.com/dcci commented:
This is heading in the right direction.
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-bran
dcci wrote:
(assuming Amir is happy)
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
https://github.com/dcci approved this pull request.
LGTM
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
dcci wrote:
LG with the other comments addressed
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
@@ -414,31 +449,59 @@ createFlowFunction(const
BinaryFunction::BasicBlockOrderType &BlockOrder) {
/// matched to a jump in the binary, the count is recorded in CFG.
size_t matchWeightsByHashes(
BinaryContext &BC, const BinaryFunction::BasicBlockOrderType &BlockOrder,
-
@@ -155,5 +155,51 @@ std::string hashBlockLoose(BinaryContext &BC, const
BinaryBasicBlock &BB) {
return HashString;
}
+/// An even looser hash of a basic block to use with stale profile matching,
+/// composed of the names of a block's called functions in lexicographic orde
dcci wrote:
Can we have @rafaelauler looking at this when he's back?
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-com
@@ -155,5 +155,51 @@ std::string hashBlockLoose(BinaryContext &BC, const
BinaryBasicBlock &BB) {
return HashString;
}
+/// An even looser hash of a basic block to use with stale profile matching,
+/// composed of the names of a block's called functions in lexicographic orde
@@ -155,5 +155,51 @@ std::string hashBlockLoose(BinaryContext &BC, const
BinaryBasicBlock &BB) {
return HashString;
}
+/// An even looser hash of a basic block to use with stale profile matching,
dcci wrote:
You can say: a looser version of $SOMETHING and
@@ -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
@@ -414,31 +449,59 @@ createFlowFunction(const
BinaryFunction::BasicBlockOrderType &BlockOrder) {
/// matched to a jump in the binary, the count is recorded in CFG.
size_t matchWeightsByHashes(
BinaryContext &BC, const BinaryFunction::BasicBlockOrderType &BlockOrder,
-
@@ -414,31 +449,59 @@ createFlowFunction(const
BinaryFunction::BasicBlockOrderType &BlockOrder) {
/// matched to a jump in the binary, the count is recorded in CFG.
size_t matchWeightsByHashes(
BinaryContext &BC, const BinaryFunction::BasicBlockOrderType &BlockOrder,
-
@@ -414,31 +449,59 @@ createFlowFunction(const
BinaryFunction::BasicBlockOrderType &BlockOrder) {
/// matched to a jump in the binary, the count is recorded in CFG.
size_t matchWeightsByHashes(
BinaryContext &BC, const BinaryFunction::BasicBlockOrderType &BlockOrder,
-
@@ -414,31 +449,59 @@ createFlowFunction(const
BinaryFunction::BasicBlockOrderType &BlockOrder) {
/// matched to a jump in the binary, the count is recorded in CFG.
size_t matchWeightsByHashes(
BinaryContext &BC, const BinaryFunction::BasicBlockOrderType &BlockOrder,
-
https://github.com/dcci 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
@@ -155,5 +155,51 @@ std::string hashBlockLoose(BinaryContext &BC, const
BinaryBasicBlock &BB) {
return HashString;
}
+/// An even looser hash of a basic block to use with stale profile matching,
+/// composed of the names of a block's called functions in lexicographic orde
https://github.com/dcci requested changes to this pull request.
First round of 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/listi
https://github.com/dcci approved this pull request.
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
dcci wrote:
> I have a couple of general comments about this. Can you also please add a
> description explaining what this patch does?
i.e. why we're refactoring these functions.
https://github.com/llvm/llvm-project/pull/97502
___
llvm-branch-commits
https://github.com/dcci 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
https://github.com/dcci commented:
I have a couple of general comments about this.
Can you also please add a description explaining what this patch does?
https://github.com/llvm/llvm-project/pull/97502
___
llvm-branch-commits mailing list
llvm-branch-c
@@ -73,13 +73,26 @@ class YAMLProfileReader : public ProfileReaderBase {
bool parseFunctionProfile(BinaryFunction &Function,
const yaml::bolt::BinaryFunctionProfile &YamlBF);
+ /// Returns block cnt equality if IgnoreHash is true, otherwise, hash
@@ -73,13 +73,26 @@ class YAMLProfileReader : public ProfileReaderBase {
bool parseFunctionProfile(BinaryFunction &Function,
const yaml::bolt::BinaryFunctionProfile &YamlBF);
+ /// Returns block cnt equality if IgnoreHash is true, otherwise, hash
dcci wrote:
is this the correct destination branch?
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
dcci wrote:
Maybe you can add a comment to the title explaining *why* we're removing it.
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/list
https://github.com/dcci approved this pull request.
Thanks for measuring the impact and removing this code, Amir.
https://github.com/llvm/llvm-project/pull/97358
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm
https://github.com/dcci requested changes to this pull request.
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
https://github.com/dcci 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
@@ -129,6 +129,8 @@ void BoltAddressTranslation::write(const BinaryContext &BC,
raw_ostream &OS) {
LLVM_DEBUG(dbgs() << " Cold part\n");
for (const FunctionFragment &FF :
Function.getLayout().getSplitFragments()) {
+ if (FF.empty())
dcci
@@ -4788,13 +4788,22 @@ void RewriteInstance::updateELFSymbolTable(
if (!IsDynSym && shouldStrip(Symbol))
continue;
+Expected SymbolName = Symbol.getName(StringSection);
+assert(SymbolName && "cannot get symbol name");
dcci wrote:
SG
https:
https://github.com/dcci approved this pull request.
LG
https://github.com/llvm/llvm-project/pull/92713
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/dcci edited https://github.com/llvm/llvm-project/pull/92713
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -30,12 +31,12 @@
# CHECK-OUTPUT: __hot_start
# CHECK-OUTPUT-NEXT: main
# CHECK-OUTPUT-NEXT: __hot_end
+# CHECK-OUTPUT-NOT: __hot_start.cold
.text
.globl main
.type main, %function
.globl __hot_start
- .type __hot_start, %object
dcc
@@ -4788,13 +4788,22 @@ void RewriteInstance::updateELFSymbolTable(
if (!IsDynSym && shouldStrip(Symbol))
continue;
+Expected SymbolName = Symbol.getName(StringSection);
+assert(SymbolName && "cannot get symbol name");
dcci wrote:
is this as
https://github.com/dcci requested changes to this pull request.
Some comments, thanks for working o this.
https://github.com/llvm/llvm-project/pull/92713
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi
@@ -4788,13 +4788,22 @@ void RewriteInstance::updateELFSymbolTable(
if (!IsDynSym && shouldStrip(Symbol))
continue;
+Expected SymbolName = Symbol.getName(StringSection);
+assert(SymbolName && "cannot get symbol name");
+
const BinaryFunction *Function =
dcci wrote:
I would suggest `BranchTakenInfo` rather than `TakenInfo` but up to you/@maksfb
https://github.com/llvm/llvm-project/pull/92017
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/
https://github.com/dcci approved this pull request.
https://github.com/llvm/llvm-project/pull/92017
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/dcci approved this pull request.
LG
https://github.com/llvm/llvm-project/pull/91898
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/dcci approved this pull request.
https://github.com/llvm/llvm-project/pull/91775
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/dcci approved this pull request.
https://github.com/llvm/llvm-project/pull/91773
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/dcci approved this pull request.
https://github.com/llvm/llvm-project/pull/89742
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/dcci approved this pull request.
https://github.com/llvm/llvm-project/pull/87967
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/dcci requested changes to this pull request.
Can you add a test? that way we can better understand what this function
actually does, given it touches a core functionality.
https://github.com/llvm/llvm-project/pull/87967
___
llvm-bra
https://github.com/dcci approved this pull request.
LG with the question answered/addressed.
https://github.com/llvm/llvm-project/pull/87123
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/
@@ -197,8 +197,10 @@ void BoltAddressTranslation::writeMaps(std::map &Maps,
? SecondaryEntryPointsMap[Address].size()
: 0;
if (Cold) {
- size_t HotIndex =
- std::distance(ColdPartSource.begin(), ColdPartSource.find(Address));
+ //
https://github.com/dcci commented:
> Also address the issue with enumeration of secondary entry points:
make them start with 1 instead of 0 (reserved for primary entry point).
^ do you want to split this in a separate commit?
https://github.com/llvm/llvm-project/pull/82128
_
https://github.com/dcci approved this pull request.
https://github.com/llvm/llvm-project/pull/76909
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/dcci commented:
No problems with this, but do we really need 8 commits? It clutters history.
Can you merge in a single one?
https://github.com/llvm/llvm-project/pull/76909
___
llvm-branch-commits mailing list
llvm-branch-commits@lis
https://github.com/dcci approved this pull request.
LG
https://github.com/llvm/llvm-project/pull/76905
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -110,6 +111,34 @@ void BoltAddressTranslation::write(const BinaryContext
&BC, raw_ostream &OS) {
outs() << "BOLT-INFO: Wrote " << Maps.size() << " BAT maps\n";
}
+APInt BoltAddressTranslation::calculateBranchEntriesBitMask(MapTy &Map,
+
@@ -207,15 +280,23 @@ void
BoltAddressTranslation::parseMaps(std::vector &HotFuncs,
const uint64_t OutputAddress = PrevAddress + OutputDelta;
const uint64_t OutputOffset = OutputAddress - Address;
PrevAddress = OutputAddress;
- const int64_t InputDelta =
71 matches
Mail list logo