[llvm] [nfc][ctx_prof] Efficient profile traversal and update (PR #110052)
Mircea Trofin via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 26 17:57:52 PDT 2024
================
@@ -279,16 +278,44 @@ static void preorderVisit(ProfilesTy &Profiles,
Traverser(P);
}
-void PGOContextualProfile::update(Visitor V, const Function *F) {
- GlobalValue::GUID G = F ? getDefinedFunctionGUID(*F) : 0U;
+void PGOContextualProfile::initIndex() {
+ // Initialize the head of the index list for each function. We don't need it
+ // after this point.
+ DenseMap<GlobalValue::GUID, PGOCtxProfContext *> InsertionPoints;
+ for (auto &FI : FuncInfo)
+ InsertionPoints[FI.first] = &FI.second.Index;
----------------
mtrofin wrote:
oh - of course. Done.
https://github.com/llvm/llvm-project/pull/110052
More information about the llvm-commits
mailing list