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

2024-08-27 Thread Mircea Trofin via llvm-branch-commits
mtrofin wrote: ### Merge activity * **Aug 27, 6:37 PM EDT**: @mtrofin started a stack merge that includes this pull request via [Graphite](https://app.graphite.dev/github/pr/llvm/llvm-project/105469). https://github.com/llvm/llvm-project/pull/105469 __

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

2024-08-27 Thread Mircea Trofin via llvm-branch-commits
@@ -456,3 +463,170 @@ declare void @_ZN5Base35func3Ev(ptr) // 1 call instruction from the entry block. EXPECT_EQ(F->front().size(), OrigEntryBBSize + 4); } + +using namespace llvm::ctx_profile; + +class ContextManager final { + std::vector> Nodes; + std::map Roots; + +pub

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

2024-08-27 Thread Mircea Trofin via llvm-branch-commits
@@ -456,3 +463,170 @@ declare void @_ZN5Base35func3Ev(ptr) // 1 call instruction from the entry block. EXPECT_EQ(F->front().size(), OrigEntryBBSize + 4); } + +using namespace llvm::ctx_profile; + +class ContextManager final { + std::vector> Nodes; + std::map Roots; + +pub

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

2024-08-27 Thread Mircea Trofin via llvm-branch-commits
https://github.com/mtrofin updated https://github.com/llvm/llvm-project/pull/105469 >From 63169fae1171006df0e6e40e64fe9479c371d376 Mon Sep 17 00:00:00 2001 From: Mircea Trofin Date: Tue, 20 Aug 2024 21:32:23 -0700 Subject: [PATCH] [ctx_prof] Add support for ICP --- llvm/include/llvm/Analysis/

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

2024-08-27 Thread Mircea Trofin via llvm-branch-commits
https://github.com/mtrofin updated https://github.com/llvm/llvm-project/pull/105469 >From a4079fec267380e8503b96eb4685682f01f93e2f Mon Sep 17 00:00:00 2001 From: Mircea Trofin Date: Tue, 20 Aug 2024 21:32:23 -0700 Subject: [PATCH] [ctx_prof] Add support for ICP --- llvm/include/llvm/Analysis/

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

2024-08-27 Thread Mircea Trofin via llvm-branch-commits
https://github.com/mtrofin updated https://github.com/llvm/llvm-project/pull/105469 >From a4079fec267380e8503b96eb4685682f01f93e2f Mon Sep 17 00:00:00 2001 From: Mircea Trofin Date: Tue, 20 Aug 2024 21:32:23 -0700 Subject: [PATCH] [ctx_prof] Add support for ICP --- llvm/include/llvm/Analysis/

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

2024-08-26 Thread Snehasish Kumar via llvm-branch-commits
@@ -456,3 +463,170 @@ declare void @_ZN5Base35func3Ev(ptr) // 1 call instruction from the entry block. EXPECT_EQ(F->front().size(), OrigEntryBBSize + 4); } + +using namespace llvm::ctx_profile; + +class ContextManager final { + std::vector> Nodes; + std::map Roots; + +pub

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

2024-08-26 Thread Snehasish Kumar via llvm-branch-commits
https://github.com/snehasish approved this pull request. lgtm, rest are minor nits. https://github.com/llvm/llvm-project/pull/105469 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo

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

2024-08-26 Thread Snehasish Kumar via llvm-branch-commits
@@ -456,3 +463,170 @@ declare void @_ZN5Base35func3Ev(ptr) // 1 call instruction from the entry block. EXPECT_EQ(F->front().size(), OrigEntryBBSize + 4); } + +using namespace llvm::ctx_profile; + +class ContextManager final { + std::vector> Nodes; + std::map Roots; + +pub

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

2024-08-26 Thread Snehasish Kumar via llvm-branch-commits
@@ -456,3 +463,170 @@ declare void @_ZN5Base35func3Ev(ptr) // 1 call instruction from the entry block. EXPECT_EQ(F->front().size(), OrigEntryBBSize + 4); } + +using namespace llvm::ctx_profile; + +class ContextManager final { + std::vector> Nodes; + std::map Roots; + +pub

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

2024-08-26 Thread Snehasish Kumar via llvm-branch-commits
https://github.com/snehasish edited https://github.com/llvm/llvm-project/pull/105469 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

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

2024-08-26 Thread Mircea Trofin via llvm-branch-commits
https://github.com/mtrofin updated https://github.com/llvm/llvm-project/pull/105469 >From 4e948895dfc12595f0d65e2599d3d369da8ee204 Mon Sep 17 00:00:00 2001 From: Mircea Trofin Date: Tue, 20 Aug 2024 21:32:23 -0700 Subject: [PATCH] [ctx_prof] Add support for ICP --- llvm/include/llvm/Analysis/

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

2024-08-26 Thread Mircea Trofin via llvm-branch-commits
https://github.com/mtrofin updated https://github.com/llvm/llvm-project/pull/105469 >From 955ac292d2b879a5d8557688345fad4d3e21a09b Mon Sep 17 00:00:00 2001 From: Mircea Trofin Date: Tue, 20 Aug 2024 21:32:23 -0700 Subject: [PATCH] [ctx_prof] Add support for ICP --- llvm/include/llvm/Analysis/

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

2024-08-26 Thread Mircea Trofin via llvm-branch-commits
@@ -572,6 +575,89 @@ CallBase &llvm::promoteCallWithIfThenElse(CallBase &CB, Function *Callee, return promoteCall(NewInst, Callee); } +CallBase *llvm::promoteCallWithIfThenElse(CallBase &CB, Function &Callee, + PGOContextualProfile &

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

2024-08-26 Thread Mircea Trofin via llvm-branch-commits
@@ -572,6 +575,89 @@ CallBase &llvm::promoteCallWithIfThenElse(CallBase &CB, Function *Callee, return promoteCall(NewInst, Callee); } +CallBase *llvm::promoteCallWithIfThenElse(CallBase &CB, Function &Callee, + PGOContextualProfile &

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

2024-08-26 Thread Mircea Trofin via llvm-branch-commits
@@ -456,3 +463,170 @@ declare void @_ZN5Base35func3Ev(ptr) // 1 call instruction from the entry block. EXPECT_EQ(F->front().size(), OrigEntryBBSize + 4); } + +using namespace llvm::ctx_profile; + +class ContextManager final { + std::vector> Nodes; + std::map Roots; + +pub

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

2024-08-26 Thread Mircea Trofin via llvm-branch-commits
@@ -57,9 +57,23 @@ class PGOCtxProfContext final { GlobalValue::GUID guid() const { return GUID; } const SmallVectorImpl &counters() const { return Counters; } + SmallVectorImpl &counters() { return Counters; } + + uint64_t getEntrycount() const { return Counters[0]; } -

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

2024-08-26 Thread Mircea Trofin via llvm-branch-commits
@@ -572,6 +575,89 @@ CallBase &llvm::promoteCallWithIfThenElse(CallBase &CB, Function *Callee, return promoteCall(NewInst, Callee); } +CallBase *llvm::promoteCallWithIfThenElse(CallBase &CB, Function &Callee, + PGOContextualProfile &

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

2024-08-26 Thread Mircea Trofin via llvm-branch-commits
@@ -105,13 +111,18 @@ class CtxProfAnalysis : public AnalysisInfoMixin { class CtxProfAnalysisPrinterPass : public PassInfoMixin { - raw_ostream &OS; - public: - explicit CtxProfAnalysisPrinterPass(raw_ostream &OS) : OS(OS) {} + enum class PrintMode { Everything, JSON

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

2024-08-26 Thread Mircea Trofin via llvm-branch-commits
@@ -105,13 +111,18 @@ class CtxProfAnalysis : public AnalysisInfoMixin { class CtxProfAnalysisPrinterPass : public PassInfoMixin { - raw_ostream &OS; - public: - explicit CtxProfAnalysisPrinterPass(raw_ostream &OS) : OS(OS) {} + enum class PrintMode { Everything, JSON

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

2024-08-26 Thread Mircea Trofin via llvm-branch-commits
@@ -57,9 +57,23 @@ class PGOCtxProfContext final { GlobalValue::GUID guid() const { return GUID; } const SmallVectorImpl &counters() const { return Counters; } + SmallVectorImpl &counters() { return Counters; } + + uint64_t getEntrycount() const { return Counters[0]; } +

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

2024-08-26 Thread Mircea Trofin via llvm-branch-commits
@@ -572,6 +575,89 @@ CallBase &llvm::promoteCallWithIfThenElse(CallBase &CB, Function *Callee, return promoteCall(NewInst, Callee); } +CallBase *llvm::promoteCallWithIfThenElse(CallBase &CB, Function &Callee, + PGOContextualProfile &

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

2024-08-26 Thread Mircea Trofin via llvm-branch-commits
@@ -1585,6 +1586,7 @@ class InstrProfCallsite : public InstrProfCntrInstBase { return isa(V) && classof(cast(V)); } Value *getCallee() const; + void setCallee(Value *); mtrofin wrote: done https://github.com/llvm/llvm-project/pull/105469

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

2024-08-26 Thread Mircea Trofin via llvm-branch-commits
https://github.com/mtrofin updated https://github.com/llvm/llvm-project/pull/105469 >From 40b481829c2c2d284210cfcc157de796c6cb Mon Sep 17 00:00:00 2001 From: Mircea Trofin Date: Tue, 20 Aug 2024 21:32:23 -0700 Subject: [PATCH] [ctx_prof] Add support for ICP --- llvm/include/llvm/Analysis/

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

2024-08-26 Thread Snehasish Kumar via llvm-branch-commits
@@ -572,6 +575,89 @@ CallBase &llvm::promoteCallWithIfThenElse(CallBase &CB, Function *Callee, return promoteCall(NewInst, Callee); } +CallBase *llvm::promoteCallWithIfThenElse(CallBase &CB, Function &Callee, + PGOContextualProfile &

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

2024-08-26 Thread Snehasish Kumar via llvm-branch-commits
@@ -456,3 +463,170 @@ declare void @_ZN5Base35func3Ev(ptr) // 1 call instruction from the entry block. EXPECT_EQ(F->front().size(), OrigEntryBBSize + 4); } + +using namespace llvm::ctx_profile; + +class ContextManager final { + std::vector> Nodes; + std::map Roots; + +pub

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

2024-08-26 Thread Snehasish Kumar via llvm-branch-commits
@@ -572,6 +575,89 @@ CallBase &llvm::promoteCallWithIfThenElse(CallBase &CB, Function *Callee, return promoteCall(NewInst, Callee); } +CallBase *llvm::promoteCallWithIfThenElse(CallBase &CB, Function &Callee, + PGOContextualProfile &

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

2024-08-26 Thread Snehasish Kumar via llvm-branch-commits
@@ -572,6 +575,89 @@ CallBase &llvm::promoteCallWithIfThenElse(CallBase &CB, Function *Callee, return promoteCall(NewInst, Callee); } +CallBase *llvm::promoteCallWithIfThenElse(CallBase &CB, Function &Callee, + PGOContextualProfile &

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

2024-08-26 Thread Snehasish Kumar via llvm-branch-commits
@@ -572,6 +575,89 @@ CallBase &llvm::promoteCallWithIfThenElse(CallBase &CB, Function *Callee, return promoteCall(NewInst, Callee); } +CallBase *llvm::promoteCallWithIfThenElse(CallBase &CB, Function &Callee, + PGOContextualProfile &

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

2024-08-26 Thread Snehasish Kumar via llvm-branch-commits
@@ -300,6 +305,11 @@ Value *InstrProfCallsite::getCallee() const { return nullptr; } +void InstrProfCallsite::setCallee(Value *V) { snehasish wrote: nit: `Value* Callee` to match the decl. https://github.com/llvm/llvm-project/pull/105469 __

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

2024-08-26 Thread Snehasish Kumar via llvm-branch-commits
@@ -572,6 +575,89 @@ CallBase &llvm::promoteCallWithIfThenElse(CallBase &CB, Function *Callee, return promoteCall(NewInst, Callee); } +CallBase *llvm::promoteCallWithIfThenElse(CallBase &CB, Function &Callee, + PGOContextualProfile &

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

2024-08-26 Thread Snehasish Kumar via llvm-branch-commits
@@ -572,6 +575,89 @@ CallBase &llvm::promoteCallWithIfThenElse(CallBase &CB, Function *Callee, return promoteCall(NewInst, Callee); } +CallBase *llvm::promoteCallWithIfThenElse(CallBase &CB, Function &Callee, + PGOContextualProfile &

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

2024-08-26 Thread Mircea Trofin via llvm-branch-commits
https://github.com/mtrofin updated https://github.com/llvm/llvm-project/pull/105469 >From 44201f1b7d371f156a8ae02b329f2321cad503d2 Mon Sep 17 00:00:00 2001 From: Mircea Trofin Date: Tue, 20 Aug 2024 21:32:23 -0700 Subject: [PATCH] [ctx_prof] Add support for ICP --- llvm/include/llvm/Analysis/

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

2024-08-26 Thread Mircea Trofin via llvm-branch-commits
https://github.com/mtrofin updated https://github.com/llvm/llvm-project/pull/105469 >From 0ff81a0fb355f31a863ded1ce677b8dad26b3c0f Mon Sep 17 00:00:00 2001 From: Mircea Trofin Date: Tue, 20 Aug 2024 21:32:23 -0700 Subject: [PATCH] [ctx_prof] Add support for ICP --- llvm/include/llvm/Analysis/

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

2024-08-26 Thread Mircea Trofin via llvm-branch-commits
https://github.com/mtrofin edited https://github.com/llvm/llvm-project/pull/105469 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

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

2024-08-23 Thread Mircea Trofin via llvm-branch-commits
https://github.com/mtrofin edited https://github.com/llvm/llvm-project/pull/105469 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

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

2024-08-21 Thread Mircea Trofin via llvm-branch-commits
https://github.com/mtrofin updated https://github.com/llvm/llvm-project/pull/105469 >From d58d308957961ae7442a7b5aa0561f42dea69caf Mon Sep 17 00:00:00 2001 From: Mircea Trofin Date: Tue, 20 Aug 2024 21:32:23 -0700 Subject: [PATCH] [ctx_prof] Add support for ICP --- llvm/include/llvm/Analysis/

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

2024-08-21 Thread Mircea Trofin via llvm-branch-commits
https://github.com/mtrofin updated https://github.com/llvm/llvm-project/pull/105469 >From 0d7c720e67a0213565f0e7c141c4ffa1b91fc5b9 Mon Sep 17 00:00:00 2001 From: Mircea Trofin Date: Tue, 20 Aug 2024 21:09:16 -0700 Subject: [PATCH 1/2] [ctx_prof] API to get the instrumentation of a BB --- llvm

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

2024-08-21 Thread Mircea Trofin via llvm-branch-commits
https://github.com/mtrofin updated https://github.com/llvm/llvm-project/pull/105469 >From d58d308957961ae7442a7b5aa0561f42dea69caf Mon Sep 17 00:00:00 2001 From: Mircea Trofin Date: Tue, 20 Aug 2024 21:32:23 -0700 Subject: [PATCH] [ctx_prof] Add support for ICP --- llvm/include/llvm/Analysis/

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

2024-08-21 Thread Mircea Trofin via llvm-branch-commits
https://github.com/mtrofin updated https://github.com/llvm/llvm-project/pull/105469 >From de6d88788d35cfeace3f694008d446e8175421a0 Mon Sep 17 00:00:00 2001 From: Mircea Trofin Date: Tue, 20 Aug 2024 21:32:23 -0700 Subject: [PATCH] [ctx_prof] Add support for ICP --- llvm/include/llvm/Analysis/

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

2024-08-21 Thread Mircea Trofin via llvm-branch-commits
https://github.com/mtrofin updated https://github.com/llvm/llvm-project/pull/105469 >From 1edbc3bed4cf6c2726394a346891409d5f548537 Mon Sep 17 00:00:00 2001 From: Mircea Trofin Date: Tue, 20 Aug 2024 21:32:23 -0700 Subject: [PATCH] [ctx_prof] Add support for ICP --- llvm/include/llvm/Analysis/