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

Amir Ayupov via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Jul 3 11:03:41 PDT 2024


================
@@ -412,33 +447,62 @@ createFlowFunction(const BinaryFunction::BasicBlockOrderType &BlockOrder) {
 /// of the basic blocks in the binary, the count is "matched" to the block.
 /// Similarly, if both the source and the target of a count in the profile are
 /// matched to a jump in the binary, the count is recorded in CFG.
-size_t matchWeightsByHashes(
-    BinaryContext &BC, const BinaryFunction::BasicBlockOrderType &BlockOrder,
-    const yaml::bolt::BinaryFunctionProfile &YamlBF, FlowFunction &Func) {
+size_t
+matchWeightsByHashes(BinaryContext &BC,
+                     const DenseMap<uint32_t, std::string *> &IdToFunctionName,
+                     const BinaryFunction::BasicBlockOrderType &BlockOrder,
+                     const yaml::bolt::BinaryFunctionProfile &YamlBF,
+                     FlowFunction &Func, HashFunction HashFunction) {
----------------
aaupov wrote:

```suggestion
size_t
matchWeightsByHashes(BinaryContext &BC,
                     const BinaryFunction::BasicBlockOrderType &BlockOrder,
                     const yaml::bolt::BinaryFunctionProfile &YamlBF,
                     FlowFunction &Func, HashFunction HashFunction,
                     const DenseMap<uint32_t, std::string *> &IdToFunctionName) {
```
It's customary to add new parameters to the end

https://github.com/llvm/llvm-project/pull/96596


More information about the llvm-branch-commits mailing list