Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[InstrProf] Adding utility weights to BalancedPartitioning #72717

Merged
merged 5 commits into from
Jan 19, 2024

Conversation

spupyrev
Copy link
Contributor

@spupyrev spupyrev commented Nov 17, 2023

Adding weights to utility nodes in BP so that we can give more importance to
certain utilities. This is useful when we optimize several objectives jointly.

@spupyrev spupyrev force-pushed the pika-bp-weights branch 3 times, most recently from 565ef7e to 0d355d8 Compare November 18, 2023 15:01
@spupyrev spupyrev marked this pull request as ready for review November 18, 2023 16:27
@llvmbot llvmbot added PGO Profile Guided Optimizations llvm:support labels Nov 18, 2023
@llvmbot
Copy link
Collaborator

llvmbot commented Nov 18, 2023

@llvm/pr-subscribers-pgo

@llvm/pr-subscribers-llvm-support

Author: None (spupyrev)

Changes

Adding weights to utility nodes in BP so that we can give more importance to
certain utilities. This is useful when we optimize several objectives jointly.


Full diff: https://github.com/llvm/llvm-project/pull/72717.diff

5 Files Affected:

  • (modified) llvm/include/llvm/Support/BalancedPartitioning.h (+11-1)
  • (modified) llvm/lib/ProfileData/InstrProf.cpp (+12-5)
  • (modified) llvm/lib/Support/BalancedPartitioning.cpp (+31-19)
  • (modified) llvm/unittests/ProfileData/BPFunctionNodeTest.cpp (+12-11)
  • (modified) llvm/unittests/Support/BalancedPartitioningTest.cpp (+61)
diff --git a/llvm/include/llvm/Support/BalancedPartitioning.h b/llvm/include/llvm/Support/BalancedPartitioning.h
index a8464ac0fe60e58..11d085badc10a0c 100644
--- a/llvm/include/llvm/Support/BalancedPartitioning.h
+++ b/llvm/include/llvm/Support/BalancedPartitioning.h
@@ -57,8 +57,14 @@ class BPFunctionNode {
   friend class BalancedPartitioning;
 
 public:
+  /// The type of ID
   using IDT = uint64_t;
-  using UtilityNodeT = uint32_t;
+  /// The type of UtilityNode
+  struct UtilityNodeT {
+    UtilityNodeT(uint32_t id, uint32_t weight = 1) : id(id), weight(weight) {}
+    uint32_t id;
+    uint32_t weight;
+  };
 
   /// \param UtilityNodes the set of utility nodes (must be unique'd)
   BPFunctionNode(IDT Id, ArrayRef<UtilityNodeT> UtilityNodes)
@@ -69,6 +75,8 @@ class BPFunctionNode {
 
   void dump(raw_ostream &OS) const;
 
+  std::optional<unsigned> getBucket() const { return Bucket; };
+
 protected:
   /// The list of utility nodes associated with this node
   SmallVector<UtilityNodeT, 4> UtilityNodes;
@@ -188,6 +196,8 @@ class BalancedPartitioning {
     float CachedGainRL;
     /// Whether \p CachedGainLR and \p CachedGainRL are valid
     bool CachedGainIsValid = false;
+    /// The weight of this utility node
+    uint32_t Weight = 1;
   };
 
 protected:
diff --git a/llvm/lib/ProfileData/InstrProf.cpp b/llvm/lib/ProfileData/InstrProf.cpp
index 236b083a1e2155b..02d679cc920d34d 100644
--- a/llvm/lib/ProfileData/InstrProf.cpp
+++ b/llvm/lib/ProfileData/InstrProf.cpp
@@ -916,15 +916,15 @@ std::vector<BPFunctionNode> TemporalProfTraceTy::createBPFunctionNodes(
 
   int N = std::ceil(std::log2(LargestTraceSize));
 
-  // TODO: We need to use the Trace.Weight field to give more weight to more
+  // TODO: We may use the Trace.Weight field to give more weight to more
   // important utilities
   DenseMap<IDT, SmallVector<UtilityNodeT, 4>> FuncGroups;
-  for (size_t TraceIdx = 0; TraceIdx < Traces.size(); TraceIdx++) {
+  for (uint32_t TraceIdx = 0; TraceIdx < Traces.size(); TraceIdx++) {
     auto &Trace = Traces[TraceIdx].FunctionNameRefs;
     for (size_t Timestamp = 0; Timestamp < Trace.size(); Timestamp++) {
       for (int I = std::floor(std::log2(Timestamp + 1)); I < N; I++) {
         auto &FunctionId = Trace[Timestamp];
-        UtilityNodeT GroupId = TraceIdx * N + I;
+        UtilityNodeT GroupId = {TraceIdx * N + I};
         FuncGroups[FunctionId].push_back(GroupId);
       }
     }
@@ -933,8 +933,15 @@ std::vector<BPFunctionNode> TemporalProfTraceTy::createBPFunctionNodes(
   std::vector<BPFunctionNode> Nodes;
   for (auto &Id : FunctionIds) {
     auto &UNs = FuncGroups[Id];
-    llvm::sort(UNs);
-    UNs.erase(std::unique(UNs.begin(), UNs.end()), UNs.end());
+    llvm::sort(UNs.begin(), UNs.end(),
+               [](const UtilityNodeT &L, const UtilityNodeT &R) {
+                 return L.id < R.id;
+               });
+    UNs.erase(std::unique(UNs.begin(), UNs.end(),
+                          [](const UtilityNodeT &L, const UtilityNodeT &R) {
+                            return L.id == R.id;
+                          }),
+              UNs.end());
     Nodes.emplace_back(Id, UNs);
   }
   return Nodes;
diff --git a/llvm/lib/Support/BalancedPartitioning.cpp b/llvm/lib/Support/BalancedPartitioning.cpp
index 5843be949911514..6d6f34c8b4dc86c 100644
--- a/llvm/lib/Support/BalancedPartitioning.cpp
+++ b/llvm/lib/Support/BalancedPartitioning.cpp
@@ -20,6 +20,15 @@
 using namespace llvm;
 #define DEBUG_TYPE "balanced-partitioning"
 
+namespace llvm {
+template <> struct format_provider<BPFunctionNode::UtilityNodeT> {
+  static void format(const BPFunctionNode::UtilityNodeT &V, raw_ostream &OS,
+                     StringRef Style) {
+    OS << "(" << V.id << "-" << V.weight << ")";
+  }
+};
+} // namespace llvm
+
 void BPFunctionNode::dump(raw_ostream &OS) const {
   OS << formatv("{{ID={0} Utilities={{{1:$[,]}} Bucket={2}}", Id,
                 make_range(UtilityNodes.begin(), UtilityNodes.end()), Bucket);
@@ -167,37 +176,38 @@ void BalancedPartitioning::runIterations(const FunctionNodeRange Nodes,
                                          unsigned RightBucket,
                                          std::mt19937 &RNG) const {
   unsigned NumNodes = std::distance(Nodes.begin(), Nodes.end());
-  DenseMap<BPFunctionNode::UtilityNodeT, unsigned> UtilityNodeDegree;
+  DenseMap<uint32_t, unsigned> UtilityNodeDegree;
   for (auto &N : Nodes)
     for (auto &UN : N.UtilityNodes)
-      ++UtilityNodeDegree[UN];
+      ++UtilityNodeDegree[UN.id];
   // Remove utility nodes if they have just one edge or are connected to all
   // functions
   for (auto &N : Nodes)
     llvm::erase_if(N.UtilityNodes, [&](auto &UN) {
-      return UtilityNodeDegree[UN] <= 1 || UtilityNodeDegree[UN] >= NumNodes;
+      return UtilityNodeDegree[UN.id] <= 1 ||
+             UtilityNodeDegree[UN.id] >= NumNodes;
     });
 
   // Renumber utility nodes so they can be used to index into Signatures
-  DenseMap<BPFunctionNode::UtilityNodeT, unsigned> UtilityNodeIndex;
+  DenseMap<uint32_t, unsigned> UtilityNodeIndex;
   for (auto &N : Nodes)
     for (auto &UN : N.UtilityNodes)
-      if (!UtilityNodeIndex.count(UN))
-        UtilityNodeIndex[UN] = UtilityNodeIndex.size();
+      if (!UtilityNodeIndex.count(UN.id))
+        UtilityNodeIndex[UN.id] = UtilityNodeIndex.size();
   for (auto &N : Nodes)
     for (auto &UN : N.UtilityNodes)
-      UN = UtilityNodeIndex[UN];
+      UN.id = UtilityNodeIndex[UN.id];
 
   // Initialize signatures
   SignaturesT Signatures(/*Size=*/UtilityNodeIndex.size());
   for (auto &N : Nodes) {
     for (auto &UN : N.UtilityNodes) {
-      assert(UN < Signatures.size());
-      if (N.Bucket == LeftBucket) {
-        Signatures[UN].LeftCount++;
-      } else {
-        Signatures[UN].RightCount++;
-      }
+      assert(UN.id < Signatures.size());
+      if (N.Bucket == LeftBucket)
+        Signatures[UN.id].LeftCount++;
+      else
+        Signatures[UN.id].RightCount++;
+      Signatures[UN.id].Weight = UN.weight;
     }
   }
 
@@ -225,9 +235,11 @@ unsigned BalancedPartitioning::runIteration(const FunctionNodeRange Nodes,
     Signature.CachedGainLR = 0.f;
     Signature.CachedGainRL = 0.f;
     if (L > 0)
-      Signature.CachedGainLR = Cost - logCost(L - 1, R + 1);
+      Signature.CachedGainLR =
+          (Cost - logCost(L - 1, R + 1)) * Signature.Weight;
     if (R > 0)
-      Signature.CachedGainRL = Cost - logCost(L + 1, R - 1);
+      Signature.CachedGainRL =
+          (Cost - logCost(L + 1, R - 1)) * Signature.Weight;
     Signature.CachedGainIsValid = true;
   }
 
@@ -286,14 +298,14 @@ bool BalancedPartitioning::moveFunctionNode(BPFunctionNode &N,
   // Update signatures and invalidate gain cache
   if (FromLeftToRight) {
     for (auto &UN : N.UtilityNodes) {
-      auto &Signature = Signatures[UN];
+      auto &Signature = Signatures[UN.id];
       Signature.LeftCount--;
       Signature.RightCount++;
       Signature.CachedGainIsValid = false;
     }
   } else {
     for (auto &UN : N.UtilityNodes) {
-      auto &Signature = Signatures[UN];
+      auto &Signature = Signatures[UN.id];
       Signature.LeftCount++;
       Signature.RightCount--;
       Signature.CachedGainIsValid = false;
@@ -322,8 +334,8 @@ float BalancedPartitioning::moveGain(const BPFunctionNode &N,
                                      const SignaturesT &Signatures) {
   float Gain = 0.f;
   for (auto &UN : N.UtilityNodes)
-    Gain += (FromLeftToRight ? Signatures[UN].CachedGainLR
-                             : Signatures[UN].CachedGainRL);
+    Gain += (FromLeftToRight ? Signatures[UN.id].CachedGainLR
+                             : Signatures[UN.id].CachedGainRL);
   return Gain;
 }
 
diff --git a/llvm/unittests/ProfileData/BPFunctionNodeTest.cpp b/llvm/unittests/ProfileData/BPFunctionNodeTest.cpp
index 97ff5c1edf5efc9..ecfcc722c3cbcdd 100644
--- a/llvm/unittests/ProfileData/BPFunctionNodeTest.cpp
+++ b/llvm/unittests/ProfileData/BPFunctionNodeTest.cpp
@@ -29,17 +29,18 @@ TEST(BPFunctionNodeTest, Basic) {
       TemporalProfTraceTy({4, 2}),
   });
 
-  auto NodeIs = [](BPFunctionNode::IDT Id,
-                   ArrayRef<BPFunctionNode::UtilityNodeT> UNs) {
-    return AllOf(Field("Id", &BPFunctionNode::Id, Id),
-                 Field("UtilityNodes", &BPFunctionNode::UtilityNodes,
-                       UnorderedElementsAreArray(UNs)));
-  };
-
-  EXPECT_THAT(Nodes,
-              UnorderedElementsAre(NodeIs(0, {0, 1, 2}), NodeIs(1, {1, 2}),
-                                   NodeIs(2, {1, 2, 4, 5}), NodeIs(3, {2}),
-                                   NodeIs(4, {2, 3, 4, 5})));
+  // TODO
+  // auto NodeIs = [](BPFunctionNode::IDT Id,
+  //                  ArrayRef<BPFunctionNode::UtilityNodeT> UNs) {
+  //   return AllOf(Field("Id", &BPFunctionNode::Id, Id),
+  //                Field("UtilityNodes", &BPFunctionNode::UtilityNodes,
+  //                      UnorderedElementsAreArray(UNs)));
+  // };
+
+  // EXPECT_THAT(Nodes,
+  //             UnorderedElementsAre(NodeIs(0, {0, 1, 2}), NodeIs(1, {1, 2}),
+  //                                  NodeIs(2, {1, 2, 4, 5}), NodeIs(3, {2}),
+  //                                  NodeIs(4, {2, 3, 4, 5})));
 }
 
 } // end namespace llvm
diff --git a/llvm/unittests/Support/BalancedPartitioningTest.cpp b/llvm/unittests/Support/BalancedPartitioningTest.cpp
index ebe518a8e89cacf..aac7e6edc921812 100644
--- a/llvm/unittests/Support/BalancedPartitioningTest.cpp
+++ b/llvm/unittests/Support/BalancedPartitioningTest.cpp
@@ -7,6 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/Support/BalancedPartitioning.h"
+#include "llvm/Support/MathExtras.h"
 #include "llvm/Testing/Support/SupportHelpers.h"
 #include "gmock/gmock.h"
 #include "gtest/gtest.h"
@@ -37,6 +38,14 @@ class BalancedPartitioningTest : public ::testing::Test {
       Ids.push_back(N.Id);
     return Ids;
   }
+
+  static std::vector<std::pair<BPFunctionNode::IDT, uint32_t>>
+  getBuckets(std::vector<BPFunctionNode> &Nodes) {
+    std::vector<std::pair<BPFunctionNode::IDT, uint32_t>> Res;
+    for (auto &N : Nodes)
+      Res.emplace_back(std::make_pair(N.Id, *N.getBucket()));
+    return Res;
+  }
 };
 
 TEST_F(BalancedPartitioningTest, Basic) {
@@ -97,4 +106,56 @@ TEST_F(BalancedPartitioningTest, MoveGain) {
                   30.f);
 }
 
+TEST_F(BalancedPartitioningTest, Weight1) {
+  std::vector<BPFunctionNode::UtilityNodeT> UNs = {
+      BPFunctionNode::UtilityNodeT(0, 100),
+      BPFunctionNode::UtilityNodeT(1, 100),
+      BPFunctionNode::UtilityNodeT(2, 100),
+      BPFunctionNode::UtilityNodeT(3, 1),
+      BPFunctionNode::UtilityNodeT(4, 1),
+  };
+  std::vector<BPFunctionNode> Nodes = {
+      BPFunctionNode(0, {UNs[0], UNs[3]}), BPFunctionNode(1, {UNs[1], UNs[3]}),
+      BPFunctionNode(2, {UNs[2], UNs[3]}), BPFunctionNode(3, {UNs[0], UNs[4]}),
+      BPFunctionNode(4, {UNs[1], UNs[4]}), BPFunctionNode(5, {UNs[2], UNs[4]}),
+  };
+
+  Bp.run(Nodes);
+
+  // Verify that the created groups are [(0,3) -- (1,4) -- (2,5)].
+  auto Res = getBuckets(Nodes);
+  llvm::sort(Res);
+  EXPECT_THAT(AbsoluteDifference(Res[0].second, Res[3].second), 1);
+  EXPECT_THAT(AbsoluteDifference(Res[1].second, Res[4].second), 1);
+  EXPECT_THAT(AbsoluteDifference(Res[2].second, Res[5].second), 1);
+}
+
+TEST_F(BalancedPartitioningTest, Weight2) {
+  std::vector<BPFunctionNode::UtilityNodeT> UNs = {
+      BPFunctionNode::UtilityNodeT(0, 1),
+      BPFunctionNode::UtilityNodeT(1, 1),
+      BPFunctionNode::UtilityNodeT(2, 1),
+      BPFunctionNode::UtilityNodeT(3, 100),
+      BPFunctionNode::UtilityNodeT(4, 100),
+  };
+  std::vector<BPFunctionNode> Nodes = {
+      BPFunctionNode(0, {UNs[0], UNs[3]}), BPFunctionNode(1, {UNs[1], UNs[4]}),
+      BPFunctionNode(2, {UNs[2], UNs[3]}), BPFunctionNode(3, {UNs[0], UNs[4]}),
+      BPFunctionNode(4, {UNs[1], UNs[3]}), BPFunctionNode(5, {UNs[2], UNs[4]}),
+  };
+
+  Bp.run(Nodes);
+
+  // Verify that the created groups are [(0,2,4) -- (1,3,5)].
+  auto Res = getBuckets(Nodes);
+  llvm::sort(Res);
+  EXPECT_LE(AbsoluteDifference(Res[0].second, Res[2].second), 2u);
+  EXPECT_LE(AbsoluteDifference(Res[0].second, Res[4].second), 2u);
+  EXPECT_LE(AbsoluteDifference(Res[2].second, Res[4].second), 2u);
+
+  EXPECT_LE(AbsoluteDifference(Res[1].second, Res[3].second), 2u);
+  EXPECT_LE(AbsoluteDifference(Res[1].second, Res[5].second), 2u);
+  EXPECT_LE(AbsoluteDifference(Res[3].second, Res[5].second), 2u);
+}
+
 } // end namespace llvm

@spupyrev
Copy link
Contributor Author

@ellishg can you help me adjust BPFunctionNodeTest; i didn't figure out how to modify the matcher to work with struct. Thanks

auto &Trace = Traces[TraceIdx].FunctionNameRefs;
for (size_t Timestamp = 0; Timestamp < Trace.size(); Timestamp++) {
for (int I = std::floor(std::log2(Timestamp + 1)); I < N; I++) {
auto &FunctionId = Trace[Timestamp];
UtilityNodeT GroupId = TraceIdx * N + I;
UtilityNodeT GroupId = {TraceIdx * N + I};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
UtilityNodeT GroupId = {TraceIdx * N + I};
UtilityNodeT GroupId(TraceIdx * N + I);

I think a more explicit initialization would be better

@@ -933,8 +933,15 @@ std::vector<BPFunctionNode> TemporalProfTraceTy::createBPFunctionNodes(
std::vector<BPFunctionNode> Nodes;
for (auto &Id : FunctionIds) {
auto &UNs = FuncGroups[Id];
llvm::sort(UNs);
UNs.erase(std::unique(UNs.begin(), UNs.end()), UNs.end());
llvm::sort(UNs.begin(), UNs.end(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
llvm::sort(UNs.begin(), UNs.end(),
llvm::sort(UNs,

Comment on lines 940 to 950
UNs.erase(std::unique(UNs.begin(), UNs.end(),
[](const UtilityNodeT &L, const UtilityNodeT &R) {
return L.id == R.id;
}),
UNs.end());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that we have weights, do you think it makes sense to accumulate the weights of duplicated nodes instead? For example, if we had nodes {(A, 1), (B, 2), (B, 3), (C, 2)} then we would end up with {(A, 1), (B, 5), (C, 2)}.

I imagine this might be useful for compression. If a function has many duplicate instructions, it makes sense to weight that more than other instructions that appear once.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good suggestion but perhaps needs some experiments? In this diff I kept the behavior unchanged.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets at least add a comment here so we don't forget.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, lets factor this out into it's own helper function like void sortAndDeduplicate(SmallVector<UtilityNodeT> UNs).

Signatures[UN.id].LeftCount++;
else
Signatures[UN.id].RightCount++;
Signatures[UN.id].Weight = UN.weight;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a signature could be affected by multiple utility nodes, each of which could have different weights. So I'm not sure this is exactly correct. In fact, I think with this change CachedGainLR is now dependent on which utility node moves between buckets, so we can no longer cache this value.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All utility nodes with the same id must have the same weight -- we just store the weight together with the utility.
I re-wrote the code, please see if the new version makes more sense.

@spupyrev
Copy link
Contributor Author

spupyrev commented Jan 9, 2024

@ellishg any thoughts on this diff?

@ellishg
Copy link
Contributor

ellishg commented Jan 9, 2024

@ellishg any thoughts on this diff?

Thanks for the reminder! I'll take a look next week.

Copy link
Contributor

@ellishg ellishg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll want to rebase after #77568.

Comment on lines 65 to 66
uint32_t id;
uint32_t weight;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use CamelCase for variable names.
https://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly

Suggested change
uint32_t id;
uint32_t weight;
uint32_t Id;
uint32_t Weight;

Comment on lines 210 to 217
// Identical utility nodes (having the same UN.id) are guaranteed to have
// the same weight; thus, we can get a new weight only when the signature
// is uninitialized.
if (Signatures[UN.id].Weight != UN.weight) {
assert(Signatures[UN.id].Weight == 1);
Signatures[UN.id].Weight = UN.weight;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since utility nodes usually come from hashes, it's possible utility nodes with the same id have different weights due to hash collisions. I don't think we need to worry too much about this case, but I'd like to remove assert and the word "guaranteed".

Comment on lines 940 to 950
UNs.erase(std::unique(UNs.begin(), UNs.end(),
[](const UtilityNodeT &L, const UtilityNodeT &R) {
return L.id == R.id;
}),
UNs.end());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets at least add a comment here so we don't forget.

Comment on lines 908 to 921
// Deduplicate utility nodes for a given function.
// TODO: One may experiment with accumulating the weights of duplicates.
void sortAndDeduplicate(SmallVector<BPFunctionNode::UtilityNodeT, 4> &UNs) {
using UtilityNodeT = BPFunctionNode::UtilityNodeT;
llvm::sort(UNs, [](const UtilityNodeT &L, const UtilityNodeT &R) {
return L.Id < R.Id;
});
UNs.erase(std::unique(UNs.begin(), UNs.end(),
[](const UtilityNodeT &L, const UtilityNodeT &R) {
return L.Id == R.Id;
}),
UNs.end());
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this can be useful outside of InstrProf.cpp, I think we should move this to be a static function of UtilityNodeT.

Comment on lines 207 to 208
if (Signatures[UN.Id].Weight != UN.Weight)
Signatures[UN.Id].Weight = UN.Weight;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we simply remove the if statement and always assign the weight?

@spupyrev spupyrev merged commit 5954b9d into llvm:main Jan 19, 2024
3 of 4 checks passed
@dyung
Copy link
Collaborator

dyung commented Jan 19, 2024

Hi @spupyrev your change seems to cause a build bot failure on Windows, can you take a look?

https://lab.llvm.org/buildbot/#/builders/216/builds/33165

FAILED: unittests/ProfileData/CMakeFiles/ProfileDataTests.dir/BPFunctionNodeTest.cpp.obj 
C:\bin\ccache.exe C:\PROGRA~2\MICROS~1\2019\BUILDT~1\VC\Tools\MSVC\1429~1.301\bin\HostX64\x64\cl.exe  /nologo /TP -DGTEST_HAS_RTTI=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_GLIBCXX_ASSERTIONS -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Iunittests\ProfileData -IZ:\b\llvm-clang-x86_64-sie-win\llvm-project\llvm\unittests\ProfileData -Iinclude -IZ:\b\llvm-clang-x86_64-sie-win\llvm-project\llvm\include -IZ:\b\llvm-clang-x86_64-sie-win\llvm-project\third-party\unittest\googletest\include -IZ:\b\llvm-clang-x86_64-sie-win\llvm-project\third-party\unittest\googlemock\include /DWIN32 /D_WINDOWS   /Zc:inline /Zc:preprocessor /Zc:__cplusplus /Oi /bigobj /permissive- /W4 -wd4141 -wd4146 -wd4244 -wd4267 -wd4291 -wd4351 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd5105 -wd4324 -w14062 -we4238 /Gw /O2 /Ob2  -MD  /EHs-c- /GR- -UNDEBUG -std:c++17 /showIncludes /Founittests\ProfileData\CMakeFiles\ProfileDataTests.dir\BPFunctionNodeTest.cpp.obj /Fdunittests\ProfileData\CMakeFiles\ProfileDataTests.dir\ /FS -c Z:\b\llvm-clang-x86_64-sie-win\llvm-project\llvm\unittests\ProfileData\BPFunctionNodeTest.cpp
Z:\b\llvm-clang-x86_64-sie-win\llvm-project\llvm\unittests\ProfileData\BPFunctionNodeTest.cpp(29): error C2665: 'std::forward': none of the 2 overloads could convert all the argument types
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include\type_traits(1448): note: could be '_Ty &&std::forward<uint32_t>(unsigned int &&) noexcept'
        with
        [
            _Ty=uint32_t
        ]
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include\type_traits(1442): note: or       '_Ty &&std::forward<uint32_t>(unsigned int &) noexcept'
        with
        [
            _Ty=uint32_t
        ]
Z:\b\llvm-clang-x86_64-sie-win\llvm-project\llvm\unittests\ProfileData\BPFunctionNodeTest.cpp(27): note: while trying to match the argument list '(int)'
Z:\b\llvm-clang-x86_64-sie-win\llvm-project\llvm\unittests\ProfileData\BPFunctionNodeTest.cpp(44): note: see reference to function template instantiation 'auto llvm::BPFunctionNodeTest_Basic_Test::TestBody::<lambda_c7f27d8ac19ae610f12ac021b11cbf5c>::operator ()<int,int,int>(int,int,int) const' being compiled
Z:\b\llvm-clang-x86_64-sie-win\llvm-project\llvm\unittests\ProfileData\BPFunctionNodeTest.cpp(28): error C2672: 'Field': no matching overloaded function found
Z:\b\llvm-clang-x86_64-sie-win\llvm-project\llvm\unittests\ProfileData\BPFunctionNodeTest.cpp(27): error C2780: 'testing::PolymorphicMatcher<testing::internal::FieldMatcher<Class,FieldType>> testing::Field(const std::string &,FieldType Class::* ,const FieldMatcher &)': expects 3 arguments - 2 provided
Z:\b\llvm-clang-x86_64-sie-win\llvm-project\third-party\unittest\googlemock\include\gmock/gmock-matchers.h(4431): note: see declaration of 'testing::Field'
Z:\b\llvm-clang-x86_64-sie-win\llvm-project\llvm\unittests\ProfileData\BPFunctionNodeTest.cpp(27): error C2784: 'testing::PolymorphicMatcher<testing::internal::FieldMatcher<Class,FieldType>> testing::Field(FieldType Class::* ,const FieldMatcher &)': could not deduce template argument for 'FieldType Class::* ' from 'const char [3]'
Z:\b\llvm-clang-x86_64-sie-win\llvm-project\third-party\unittest\googlemock\include\gmock/gmock-matchers.h(4418): note: see declaration of 'testing::Field'
Z:\b\llvm-clang-x86_64-sie-win\llvm-project\llvm\unittests\ProfileData\BPFunctionNodeTest.cpp(28): error C2672: 'testing::UnorderedElementsAre': no matching overloaded function found
Z:\b\llvm-clang-x86_64-sie-win\llvm-project\llvm\unittests\ProfileData\BPFunctionNodeTest.cpp(41): error C2664: 'testing::internal::VariadicMatcher<testing::internal::AllOfMatcherImpl,testing::PolymorphicMatcher<testing::internal::FieldMatcher<llvm::BPFunctionNode,llvm::BPFunctionNode::IDT>>,testing::PolymorphicMatcher<testing::internal::FieldMatcher<llvm::BPFunctionNode,llvm::SmallVector<llvm::BPFunctionNode::UtilityNodeT,4>>>> llvm::BPFunctionNodeTest_Basic_Test::TestBody::<lambda_eb0144a4e20c49d4d4e5be57dd13cd92>::operator ()(llvm::BPFunctionNode::IDT,testing::Matcher<llvm::ArrayRef<llvm::BPFunctionNode::UtilityNodeT>>) const': cannot convert argument 2 from 'void' to 'testing::Matcher<llvm::ArrayRef<llvm::BPFunctionNode::UtilityNodeT>>'
Z:\b\llvm-clang-x86_64-sie-win\llvm-project\llvm\unittests\ProfileData\BPFunctionNodeTest.cpp(41): note: Expressions of type void cannot be converted to other types
Z:\b\llvm-clang-x86_64-sie-win\llvm-project\llvm\unittests\ProfileData\BPFunctionNodeTest.cpp(36): note: see declaration of 'llvm::BPFunctionNodeTest_Basic_Test::TestBody::<lambda_eb0144a4e20c49d4d4e5be57dd13cd92>::operator ()'
Z:\b\llvm-clang-x86_64-sie-win\llvm-project\llvm\unittests\ProfileData\BPFunctionNodeTest.cpp(41): error C2672: 'testing::UnorderedElementsAre': no matching overloaded function found
Z:\b\llvm-clang-x86_64-sie-win\llvm-project\llvm\unittests\ProfileData\BPFunctionNodeTest.cpp(41): error C2672: 'testing::internal::MakePredicateFormatterFromMatcher': no matching overloaded function found
Z:\b\llvm-clang-x86_64-sie-win\llvm-project\llvm\unittests\ProfileData\BPFunctionNodeTest.cpp(41): error C2737: 'gtest_ar': const object must be initialized
Z:\b\llvm-clang-x86_64-sie-win\llvm-project\llvm\unittests\ProfileData\BPFunctionNodeTest.cpp(51): error C2664: 'testing::internal::VariadicMatcher<testing::internal::AllOfMatcherImpl,testing::PolymorphicMatcher<testing::internal::FieldMatcher<llvm::BPFunctionNode,llvm::BPFunctionNode::IDT>>,testing::PolymorphicMatcher<testing::internal::FieldMatcher<llvm::BPFunctionNode,llvm::SmallVector<llvm::BPFunctionNode::UtilityNodeT,4>>>> llvm::BPFunctionNodeTest_Basic_Test::TestBody::<lambda_eb0144a4e20c49d4d4e5be57dd13cd92>::operator ()(llvm::BPFunctionNode::IDT,testing::Matcher<llvm::ArrayRef<llvm::BPFunctionNode::UtilityNodeT>>) const': cannot convert argument 2 from 'void' to 'testing::Matcher<llvm::ArrayRef<llvm::BPFunctionNode::UtilityNodeT>>'
Z:\b\llvm-clang-x86_64-sie-win\llvm-project\llvm\unittests\ProfileData\BPFunctionNodeTest.cpp(51): note: Expressions of type void cannot be converted to other types
Z:\b\llvm-clang-x86_64-sie-win\llvm-project\llvm\unittests\ProfileData\BPFunctionNodeTest.cpp(36): note: see declaration of 'llvm::BPFunctionNodeTest_Basic_Test::TestBody::<lambda_eb0144a4e20c49d4d4e5be57dd13cd92>::operator ()'
Z:\b\llvm-clang-x86_64-sie-win\llvm-project\llvm\unittests\ProfileData\BPFunctionNodeTest.cpp(51): error C2672: 'testing::UnorderedElementsAre': no matching overloaded function found
Z:\b\llvm-clang-x86_64-sie-win\llvm-project\llvm\unittests\ProfileData\BPFunctionNodeTest.cpp(51): error C2672: 'testing::internal::MakePredicateFormatterFromMatcher': no matching overloaded function found
Z:\b\llvm-clang-x86_64-sie-win\llvm-project\llvm\unittests\ProfileData\BPFunctionNodeTest.cpp(51): error C2737: 'gtest_ar': const object must be initialized

spupyrev added a commit to spupyrev/llvm-project that referenced this pull request Jan 19, 2024
@spupyrev spupyrev deleted the pika-bp-weights branch January 19, 2024 23:08
spupyrev added a commit that referenced this pull request Jan 19, 2024
@spupyrev
Copy link
Contributor Author

Reverted by 30aa9fb. Will investigate and re-commit later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
llvm:support PGO Profile Guided Optimizations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants