https://github.com/aaupov updated
https://github.com/llvm/llvm-project/pull/99891
>From 36197b175681d07b4704e576fb008cec3cc1e05e Mon Sep 17 00:00:00 2001
From: Amir Ayupov
Date: Wed, 28 Aug 2024 21:10:25 +0200
Subject: [PATCH 1/3] Reworked block probe matching
Use new probe ifaces
Get all func
https://github.com/aaupov updated
https://github.com/llvm/llvm-project/pull/99891
>From 36197b175681d07b4704e576fb008cec3cc1e05e Mon Sep 17 00:00:00 2001
From: Amir Ayupov
Date: Wed, 28 Aug 2024 21:10:25 +0200
Subject: [PATCH 1/3] Reworked block probe matching
Use new probe ifaces
Get all func
https://github.com/aaupov updated
https://github.com/llvm/llvm-project/pull/99891
>From 36197b175681d07b4704e576fb008cec3cc1e05e Mon Sep 17 00:00:00 2001
From: Amir Ayupov
Date: Wed, 28 Aug 2024 21:10:25 +0200
Subject: [PATCH 1/3] Reworked block probe matching
Use new probe ifaces
Get all func
https://github.com/aaupov updated
https://github.com/llvm/llvm-project/pull/99891
>From 36197b175681d07b4704e576fb008cec3cc1e05e Mon Sep 17 00:00:00 2001
From: Amir Ayupov
Date: Wed, 28 Aug 2024 21:10:25 +0200
Subject: [PATCH 1/3] Reworked block probe matching
Use new probe ifaces
Get all func
aaupov wrote:
> > > Ping @wlei-llvm
> >
> >
> > Sorry for the delay. The new version addressed my last comment (with just
> > minor nits). However, I didn't fully follow the new features related to
> > `ProbeMatchSpecs` stuffs. Could you add more descriptions to the diff
> > summary? Or if i
@@ -447,12 +561,12 @@ 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
@@ -482,11 +596,68 @@ matchWeightsByHashes(BinaryContext &BC,
<< Twine::utohexstr(BB->getHash()) << "\n");
}
StaleMatcher Matcher;
+ // Collects function pseudo probes for use in the StaleMatcher.
+ if (opts::StaleMatchingWithPseudoProbes) {
+con
wlei-llvm wrote:
> > Ping @wlei-llvm
>
> Sorry for the delay. The new version addressed my last comment (with just
> minor nits). However, I didn't fully follow the new features related to
> `ProbeMatchSpecs` stuffs. Could you add more descriptions to the diff
> summary? Or if it’s not a lot
@@ -628,9 +618,75 @@ void
YAMLProfileReader::InlineTreeNodeMapTy::matchInlineTrees(
}
}
}
-if (Cur && Decoder.getFuncDescForGUID(GUID)->FuncHash == Hash)
+// Don't match nodes if the profile is stale (mismatching binary FuncHash
+// and YAML Hash)
@@ -722,12 +722,28 @@ class BinaryContext {
/// Stats for stale profile matching:
/// the total number of basic blocks in the profile
uint32_t NumStaleBlocks{0};
-/// the number of matched basic blocks
-uint32_t NumMatchedBlocks{0};
+/// the number
wlei-llvm wrote:
> Ping @wlei-llvm
Sorry for the delay. The new version addressed my last comment (with just minor
nits). However, I didn't fully follow the new features related to
`ProbeMatchSpecs` stuffs. Could you add more descriptions to the diff summary?
Or if it’s not a lot of work, cou
aaupov wrote:
Ping @wlei-llvm
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/aaupov updated
https://github.com/llvm/llvm-project/pull/99891
>From 36197b175681d07b4704e576fb008cec3cc1e05e Mon Sep 17 00:00:00 2001
From: Amir Ayupov
Date: Wed, 28 Aug 2024 21:10:25 +0200
Subject: [PATCH 1/3] Reworked block probe matching
Use new probe ifaces
Get all func
https://github.com/aaupov 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/aaupov 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/aaupov updated
https://github.com/llvm/llvm-project/pull/99891
>From 36197b175681d07b4704e576fb008cec3cc1e05e Mon Sep 17 00:00:00 2001
From: Amir Ayupov
Date: Wed, 28 Aug 2024 21:10:25 +0200
Subject: [PATCH 1/2] Reworked block probe matching
Use new probe ifaces
Get all func
@@ -0,0 +1,62 @@
+## Tests stale block matching with pseudo probes.
+
+# REQUIRES: system-linux
+# RUN: split-file %s %t
+# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %t/main.s -o %t.o
+# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q -nostdlib
+# RUN: llvm-bolt %t.exe -
https://github.com/aaupov updated
https://github.com/llvm/llvm-project/pull/99891
>From 36197b175681d07b4704e576fb008cec3cc1e05e Mon Sep 17 00:00:00 2001
From: Amir Ayupov
Date: Wed, 28 Aug 2024 21:10:25 +0200
Subject: [PATCH 1/2] Reworked block probe matching
Use new probe ifaces
Get all func
@@ -722,6 +770,15 @@ Error YAMLProfileReader::readProfile(BinaryContext &BC) {
}
}
+ if (opts::StaleMatchingWithPseudoProbes) {
+const MCPseudoProbeDecoder *Decoder = BC.getPseudoProbeDecoder();
+assert(Decoder &&
+ "If pseudo probes are in use, pseudo
https://github.com/aaupov 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/aaupov 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
@@ -587,6 +590,51 @@ size_t YAMLProfileReader::matchWithCallGraph(BinaryContext
&BC) {
return MatchedWithCallGraph;
}
+void YAMLProfileReader::InlineTreeNodeMapTy::matchInlineTrees(
+const MCPseudoProbeDecoder &Decoder,
+const yaml::bolt::PseudoProbeDesc &YamlPD,
+
@@ -587,6 +590,51 @@ size_t YAMLProfileReader::matchWithCallGraph(BinaryContext
&BC) {
return MatchedWithCallGraph;
}
+void YAMLProfileReader::InlineTreeNodeMapTy::matchInlineTrees(
+const MCPseudoProbeDecoder &Decoder,
+const yaml::bolt::PseudoProbeDesc &YamlPD,
+
@@ -587,6 +590,51 @@ size_t YAMLProfileReader::matchWithCallGraph(BinaryContext
&BC) {
return MatchedWithCallGraph;
}
+void YAMLProfileReader::InlineTreeNodeMapTy::matchInlineTrees(
+const MCPseudoProbeDecoder &Decoder,
+const yaml::bolt::PseudoProbeDesc &YamlPD,
+
@@ -587,6 +590,51 @@ size_t YAMLProfileReader::matchWithCallGraph(BinaryContext
&BC) {
return MatchedWithCallGraph;
}
+void YAMLProfileReader::InlineTreeNodeMapTy::matchInlineTrees(
+const MCPseudoProbeDecoder &Decoder,
+const yaml::bolt::PseudoProbeDesc &YamlPD,
+
@@ -587,6 +590,51 @@ size_t YAMLProfileReader::matchWithCallGraph(BinaryContext
&BC) {
return MatchedWithCallGraph;
}
+void YAMLProfileReader::InlineTreeNodeMapTy::matchInlineTrees(
+const MCPseudoProbeDecoder &Decoder,
+const yaml::bolt::PseudoProbeDesc &YamlPD,
+
@@ -96,6 +101,42 @@ class YAMLProfileReader : public ProfileReaderBase {
YamlBFAdjacencyMap;
};
+ // A class for matching inline tree nodes between profile and binary.
+ class InlineTreeNodeMapTy {
+DenseMap Map;
+
+void mapInlineTreeNode(uint32_t ProfileNo
@@ -587,6 +590,51 @@ size_t YAMLProfileReader::matchWithCallGraph(BinaryContext
&BC) {
return MatchedWithCallGraph;
}
+void YAMLProfileReader::InlineTreeNodeMapTy::matchInlineTrees(
+const MCPseudoProbeDecoder &Decoder,
+const yaml::bolt::PseudoProbeDesc &YamlPD,
+
@@ -96,6 +101,42 @@ class YAMLProfileReader : public ProfileReaderBase {
YamlBFAdjacencyMap;
};
+ // A class for matching inline tree nodes between profile and binary.
+ class InlineTreeNodeMapTy {
+DenseMap Map;
+
+void mapInlineTreeNode(uint32_t ProfileNo
@@ -96,6 +101,42 @@ class YAMLProfileReader : public ProfileReaderBase {
YamlBFAdjacencyMap;
};
+ // A class for matching inline tree nodes between profile and binary.
+ class InlineTreeNodeMapTy {
+DenseMap Map;
wlei-llvm wrote:
add comments
@@ -266,6 +305,69 @@ class StaleMatcher {
}
return BestBlock;
}
+
+ /// Matches a profile block with an binary block based on pseudo probes.
wlei-llvm wrote:
nit: `an` -> `a`
https://github.com/llvm/llvm-project/pull/99891
_
@@ -96,6 +101,42 @@ class YAMLProfileReader : public ProfileReaderBase {
YamlBFAdjacencyMap;
};
+ // A class for matching inline tree nodes between profile and binary.
+ class InlineTreeNodeMapTy {
+DenseMap Map;
+
+void mapInlineTreeNode(uint32_t ProfileNo
@@ -96,6 +101,42 @@ class YAMLProfileReader : public ProfileReaderBase {
YamlBFAdjacencyMap;
};
+ // A class for matching inline tree nodes between profile and binary.
+ class InlineTreeNodeMapTy {
+DenseMap Map;
+
+void mapInlineTreeNode(uint32_t ProfileNo
@@ -0,0 +1,62 @@
+## Tests stale block matching with pseudo probes.
+
+# REQUIRES: system-linux
+# RUN: split-file %s %t
+# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %t/main.s -o %t.o
+# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q -nostdlib
+# RUN: llvm-bolt %t.exe -
@@ -722,12 +722,28 @@ class BinaryContext {
/// Stats for stale profile matching:
/// the total number of basic blocks in the profile
uint32_t NumStaleBlocks{0};
-/// the number of matched basic blocks
-uint32_t NumMatchedBlocks{0};
+/// the number
@@ -587,6 +590,51 @@ size_t YAMLProfileReader::matchWithCallGraph(BinaryContext
&BC) {
return MatchedWithCallGraph;
}
+void YAMLProfileReader::InlineTreeNodeMapTy::matchInlineTrees(
+const MCPseudoProbeDecoder &Decoder,
+const yaml::bolt::PseudoProbeDesc &YamlPD,
+
@@ -266,6 +305,69 @@ class StaleMatcher {
}
return BestBlock;
}
+
+ /// Matches a profile block with an binary block based on pseudo probes.
+ /// Returns the best matching block (or nullptr) and whether the match is
+ /// unambiguous.
+ std::pair matchWithPseudoP
@@ -722,6 +770,15 @@ Error YAMLProfileReader::readProfile(BinaryContext &BC) {
}
}
+ if (opts::StaleMatchingWithPseudoProbes) {
+const MCPseudoProbeDecoder *Decoder = BC.getPseudoProbeDecoder();
+assert(Decoder &&
+ "If pseudo probes are in use, pseudo
@@ -587,6 +590,51 @@ size_t YAMLProfileReader::matchWithCallGraph(BinaryContext
&BC) {
return MatchedWithCallGraph;
}
+void YAMLProfileReader::InlineTreeNodeMapTy::matchInlineTrees(
+const MCPseudoProbeDecoder &Decoder,
+const yaml::bolt::PseudoProbeDesc &YamlPD,
+
@@ -482,6 +584,30 @@ matchWeightsByHashes(BinaryContext &BC,
<< Twine::utohexstr(BB->getHash()) << "\n");
}
StaleMatcher Matcher;
+ // Collects function pseudo probes for use in the StaleMatcher.
+ if (opts::StaleMatchingWithPseudoProbes) {
+cons
https://github.com/aaupov updated
https://github.com/llvm/llvm-project/pull/99891
>From 36197b175681d07b4704e576fb008cec3cc1e05e Mon Sep 17 00:00:00 2001
From: Amir Ayupov
Date: Wed, 28 Aug 2024 21:10:25 +0200
Subject: [PATCH 1/2] Reworked block probe matching
Use new probe ifaces
Get all func
https://github.com/aaupov updated
https://github.com/llvm/llvm-project/pull/99891
>From 36197b175681d07b4704e576fb008cec3cc1e05e Mon Sep 17 00:00:00 2001
From: Amir Ayupov
Date: Wed, 28 Aug 2024 21:10:25 +0200
Subject: [PATCH 1/2] Reworked block probe matching
Use new probe ifaces
Get all func
https://github.com/aaupov updated
https://github.com/llvm/llvm-project/pull/99891
>From 36197b175681d07b4704e576fb008cec3cc1e05e Mon Sep 17 00:00:00 2001
From: Amir Ayupov
Date: Wed, 28 Aug 2024 21:10:25 +0200
Subject: [PATCH 1/2] Reworked block probe matching
Use new probe ifaces
Get all func
https://github.com/aaupov updated
https://github.com/llvm/llvm-project/pull/99891
>From 36197b175681d07b4704e576fb008cec3cc1e05e Mon Sep 17 00:00:00 2001
From: Amir Ayupov
Date: Wed, 28 Aug 2024 21:10:25 +0200
Subject: [PATCH 1/2] Reworked block probe matching
Use new probe ifaces
Get all func
https://github.com/aaupov updated
https://github.com/llvm/llvm-project/pull/99891
>From 36197b175681d07b4704e576fb008cec3cc1e05e Mon Sep 17 00:00:00 2001
From: Amir Ayupov
Date: Wed, 28 Aug 2024 21:10:25 +0200
Subject: [PATCH 1/2] Reworked block probe matching
Use new probe ifaces
Get all func
https://github.com/aaupov updated
https://github.com/llvm/llvm-project/pull/99891
>From 36197b175681d07b4704e576fb008cec3cc1e05e Mon Sep 17 00:00:00 2001
From: Amir Ayupov
Date: Wed, 28 Aug 2024 21:10:25 +0200
Subject: [PATCH 1/2] Reworked block probe matching
Use new probe ifaces
Get all func
https://github.com/aaupov updated
https://github.com/llvm/llvm-project/pull/99891
>From 36197b175681d07b4704e576fb008cec3cc1e05e Mon Sep 17 00:00:00 2001
From: Amir Ayupov
Date: Wed, 28 Aug 2024 21:10:25 +0200
Subject: [PATCH 1/2] Reworked block probe matching
Use new probe ifaces
Get all func
https://github.com/aaupov updated
https://github.com/llvm/llvm-project/pull/99891
>From 36197b175681d07b4704e576fb008cec3cc1e05e Mon Sep 17 00:00:00 2001
From: Amir Ayupov
Date: Wed, 28 Aug 2024 21:10:25 +0200
Subject: [PATCH 1/2] Reworked block probe matching
Use new probe ifaces
Get all func
https://github.com/aaupov updated
https://github.com/llvm/llvm-project/pull/99891
>From 36197b175681d07b4704e576fb008cec3cc1e05e Mon Sep 17 00:00:00 2001
From: Amir Ayupov
Date: Wed, 28 Aug 2024 21:10:25 +0200
Subject: [PATCH 1/2] Reworked block probe matching
Use new probe ifaces
Get all func
https://github.com/aaupov updated
https://github.com/llvm/llvm-project/pull/99891
>From 36197b175681d07b4704e576fb008cec3cc1e05e Mon Sep 17 00:00:00 2001
From: Amir Ayupov
Date: Wed, 28 Aug 2024 21:10:25 +0200
Subject: [PATCH 1/2] Reworked block probe matching
Use new probe ifaces
Get all func
https://github.com/aaupov updated
https://github.com/llvm/llvm-project/pull/99891
>From 36197b175681d07b4704e576fb008cec3cc1e05e Mon Sep 17 00:00:00 2001
From: Amir Ayupov
Date: Wed, 28 Aug 2024 21:10:25 +0200
Subject: [PATCH 1/2] Reworked block probe matching
Use new probe ifaces
Get all func
https://github.com/aaupov updated
https://github.com/llvm/llvm-project/pull/99891
>From 36197b175681d07b4704e576fb008cec3cc1e05e Mon Sep 17 00:00:00 2001
From: Amir Ayupov
Date: Wed, 28 Aug 2024 21:10:25 +0200
Subject: [PATCH 1/2] Reworked block probe matching
Use new probe ifaces
Get all func
https://github.com/aaupov 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/aaupov updated
https://github.com/llvm/llvm-project/pull/99891
>From 36197b175681d07b4704e576fb008cec3cc1e05e Mon Sep 17 00:00:00 2001
From: Amir Ayupov
Date: Wed, 28 Aug 2024 21:10:25 +0200
Subject: [PATCH 1/2] Reworked block probe matching
Use new probe ifaces
Get all func
github-actions[bot] wrote:
:warning: C/C++ code formatter, clang-format found issues in your code.
:warning:
You can test this locally with the following command:
``bash
git-clang-format --diff bfa0afc8fd9a4cfb4c44146379ea2f6e231661cc
0f455d09f5d2bcd07278debd55e76dfbc1162472 --e
https://github.com/aaupov updated
https://github.com/llvm/llvm-project/pull/99891
>From 36197b175681d07b4704e576fb008cec3cc1e05e Mon Sep 17 00:00:00 2001
From: Amir Ayupov
Date: Wed, 28 Aug 2024 21:10:25 +0200
Subject: [PATCH] Reworked block probe matching
Use new probe ifaces
Get all function
https://github.com/aaupov updated
https://github.com/llvm/llvm-project/pull/99891
>From 36197b175681d07b4704e576fb008cec3cc1e05e Mon Sep 17 00:00:00 2001
From: Amir Ayupov
Date: Wed, 28 Aug 2024 21:10:25 +0200
Subject: [PATCH] Reworked block probe matching
Use new probe ifaces
Get all function
@@ -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
https://github.com/wlei-llvm deleted
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
@@ -478,10 +675,34 @@ matchWeightsByHashes(BinaryContext &BC,
Blocks.push_back(&Func.Blocks[I + 1]);
BlendedBlockHash BlendedHash(BB->getHash());
BlendedHashes.push_back(BlendedHash);
+// Collects pseudo probes attached to the BB for use in the StaleMatcher.
+
@@ -478,10 +675,34 @@ matchWeightsByHashes(BinaryContext &BC,
Blocks.push_back(&Func.Blocks[I + 1]);
BlendedBlockHash BlendedHash(BB->getHash());
BlendedHashes.push_back(BlendedHash);
+// Collects pseudo probes attached to the BB for use in the StaleMatcher.
+
@@ -266,6 +325,122 @@ class StaleMatcher {
}
return BestBlock;
}
+
+ /// A helper function for logging.
+ static bool LogErrIfExpr(bool Expr, StringRef Message) {
+if (Expr)
+ errs() << Message;
+return Expr;
+ }
+
+ /// Matches an inlined profile blo
@@ -266,6 +325,122 @@ class StaleMatcher {
}
return BestBlock;
}
+
+ /// A helper function for logging.
+ static bool LogErrIfExpr(bool Expr, StringRef Message) {
+if (Expr)
+ errs() << Message;
+return Expr;
+ }
+
+ /// Matches an inlined profile blo
@@ -478,10 +605,31 @@ matchWeightsByHashes(BinaryContext &BC,
Blocks.push_back(&Func.Blocks[I + 1]);
BlendedBlockHash BlendedHash(BB->getHash());
BlendedHashes.push_back(BlendedHash);
+// Collects pseudo probes attached to the BB for use in the StaleMatcher.
+
https://github.com/shawbyoung updated
https://github.com/llvm/llvm-project/pull/99891
>From 0274f697376264c2d77816190f9a434f64e79089 Mon Sep 17 00:00:00 2001
From: shawbyoung
Date: Mon, 22 Jul 2024 11:56:23 -0700
Subject: [PATCH 01/25] Changed assignment of profiles with pseudo probe index
Cre
@@ -478,10 +675,34 @@ matchWeightsByHashes(BinaryContext &BC,
Blocks.push_back(&Func.Blocks[I + 1]);
BlendedBlockHash BlendedHash(BB->getHash());
BlendedHashes.push_back(BlendedHash);
+// Collects pseudo probes attached to the BB for use in the StaleMatcher.
+
@@ -45,6 +45,8 @@ namespace opts {
extern cl::opt TimeRewrite;
extern cl::OptionCategory BoltOptCategory;
+extern cl::opt Verbosity;
+extern cl::opt ProfileUsePseudoProbes;
shawbyoung wrote:
Added a flag for pseudo probe block matching.
https://github.com/ll
https://github.com/shawbyoung updated
https://github.com/llvm/llvm-project/pull/99891
>From 0274f697376264c2d77816190f9a434f64e79089 Mon Sep 17 00:00:00 2001
From: shawbyoung
Date: Mon, 22 Jul 2024 11:56:23 -0700
Subject: [PATCH 01/24] Changed assignment of profiles with pseudo probe index
Cre
@@ -266,6 +325,123 @@ class StaleMatcher {
}
return BestBlock;
}
+
+ /// A helper function for logging.
+ static bool LogErrIfExpr(bool Expr, std::string Message) {
wlei-llvm wrote:
Nit: `std::string` can this be `StringRef`?
https://github.com/ll
@@ -116,6 +118,11 @@ cl::opt StaleMatchingCostJumpUnknownFTInc(
"The cost of increasing an unknown fall-through jump count by one."),
cl::init(3), cl::ReallyHidden, cl::cat(BoltOptCategory));
+cl::opt StaleMatchingWithBlockPseudoProbes(
+"stale-matching-with-bl
@@ -0,0 +1,62 @@
+## Tests stale block matching with pseudo probes.
+
+# REQUIRES: system-linux
+# RUN: split-file %s %t
+# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %t/main.s -o %t.o
+# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q -nostdlib
+# RUN: llvm-bolt %t.exe -
@@ -478,10 +675,34 @@ matchWeightsByHashes(BinaryContext &BC,
Blocks.push_back(&Func.Blocks[I + 1]);
BlendedBlockHash BlendedHash(BB->getHash());
BlendedHashes.push_back(BlendedHash);
+// Collects pseudo probes attached to the BB for use in the StaleMatcher.
+
@@ -478,10 +605,31 @@ matchWeightsByHashes(BinaryContext &BC,
Blocks.push_back(&Func.Blocks[I + 1]);
BlendedBlockHash BlendedHash(BB->getHash());
BlendedHashes.push_back(BlendedHash);
+// Collects pseudo probes attached to the BB for use in the StaleMatcher.
+
https://github.com/shawbyoung updated
https://github.com/llvm/llvm-project/pull/99891
>From 0274f697376264c2d77816190f9a434f64e79089 Mon Sep 17 00:00:00 2001
From: shawbyoung
Date: Mon, 22 Jul 2024 11:56:23 -0700
Subject: [PATCH 01/23] Changed assignment of profiles with pseudo probe index
Cre
https://github.com/shawbyoung updated
https://github.com/llvm/llvm-project/pull/99891
>From 0274f697376264c2d77816190f9a434f64e79089 Mon Sep 17 00:00:00 2001
From: shawbyoung
Date: Mon, 22 Jul 2024 11:56:23 -0700
Subject: [PATCH 01/22] Changed assignment of profiles with pseudo probe index
Cre
@@ -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
@@ -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
@@ -45,6 +45,8 @@ namespace opts {
extern cl::opt TimeRewrite;
extern cl::OptionCategory BoltOptCategory;
+extern cl::opt Verbosity;
+extern cl::opt ProfileUsePseudoProbes;
WenleiHe wrote:
> There's no use of probes outside stale matching.
True, but you do
https://github.com/shawbyoung updated
https://github.com/llvm/llvm-project/pull/99891
>From 0274f697376264c2d77816190f9a434f64e79089 Mon Sep 17 00:00:00 2001
From: shawbyoung
Date: Mon, 22 Jul 2024 11:56:23 -0700
Subject: [PATCH 01/21] Changed assignment of profiles with pseudo probe index
Cre
https://github.com/shawbyoung updated
https://github.com/llvm/llvm-project/pull/99891
>From 0274f697376264c2d77816190f9a434f64e79089 Mon Sep 17 00:00:00 2001
From: shawbyoung
Date: Mon, 22 Jul 2024 11:56:23 -0700
Subject: [PATCH 01/20] Changed assignment of profiles with pseudo probe index
Cre
https://github.com/shawbyoung updated
https://github.com/llvm/llvm-project/pull/99891
>From 0274f697376264c2d77816190f9a434f64e79089 Mon Sep 17 00:00:00 2001
From: shawbyoung
Date: Mon, 22 Jul 2024 11:56:23 -0700
Subject: [PATCH 01/19] Changed assignment of profiles with pseudo probe index
Cre
@@ -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
@@ -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 exist
@@ -45,6 +45,8 @@ namespace opts {
extern cl::opt TimeRewrite;
extern cl::OptionCategory BoltOptCategory;
+extern cl::opt Verbosity;
+extern cl::opt ProfileUsePseudoProbes;
WenleiHe wrote:
> If the profile contains probe information, but ProfileUsePseudoProbe
@@ -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, oth
@@ -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 t
@@ -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 t
@@ -45,6 +45,8 @@ namespace opts {
extern cl::opt TimeRewrite;
extern cl::OptionCategory BoltOptCategory;
+extern cl::opt Verbosity;
+extern cl::opt ProfileUsePseudoProbes;
WenleiHe wrote:
Ok, I think we need a dedicated flag to control matching strategy, oth
@@ -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 use
@@ -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 t
@@ -45,6 +45,8 @@ namespace opts {
extern cl::opt TimeRewrite;
extern cl::OptionCategory BoltOptCategory;
+extern cl::opt Verbosity;
+extern cl::opt ProfileUsePseudoProbes;
WenleiHe wrote:
IIUC `ProfileUsePseudoProbes` controls whether we extract probe from b
@@ -478,10 +605,31 @@ matchWeightsByHashes(BinaryContext &BC,
Blocks.push_back(&Func.Blocks[I + 1]);
BlendedBlockHash BlendedHash(BB->getHash());
BlendedHashes.push_back(BlendedHash);
+// Collects pseudo probes attached to the BB for use in the StaleMatcher.
+
@@ -478,10 +605,31 @@ matchWeightsByHashes(BinaryContext &BC,
Blocks.push_back(&Func.Blocks[I + 1]);
BlendedBlockHash BlendedHash(BB->getHash());
BlendedHashes.push_back(BlendedHash);
+// Collects pseudo probes attached to the BB for use in the StaleMatcher.
+
@@ -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
@@ -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
1 - 100 of 131 matches
Mail list logo