[llvm-branch-commits] [llvm] [ctx_prof] Add support for ICP (PR #105469)

Mircea Trofin via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Aug 26 19:34:48 PDT 2024


================
@@ -57,9 +57,23 @@ class PGOCtxProfContext final {
 
   GlobalValue::GUID guid() const { return GUID; }
   const SmallVectorImpl<uint64_t> &counters() const { return Counters; }
+  SmallVectorImpl<uint64_t> &counters() { return Counters; }
+
+  uint64_t getEntrycount() const { return Counters[0]; }
+
   const CallsiteMapTy &callsites() const { return Callsites; }
   CallsiteMapTy &callsites() { return Callsites; }
 
+  void ingestContext(uint32_t CSId, PGOCtxProfContext &&Other) {
+    auto [Iter, _] = callsites().try_emplace(CSId, CallTargetMapTy());
+    Iter->second.emplace(Other.guid(), std::move(Other));
+  }
+
+  void growCounters(uint32_t Size) {
+    if (Size >= Counters.size())
----------------
mtrofin wrote:

done

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


More information about the llvm-branch-commits mailing list