[llvm] [ctx_prof] CtxProfAnalysis: populate module data (PR #102930)
Mircea Trofin via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 13 12:25:58 PDT 2024
================
@@ -35,6 +51,20 @@ class PGOContextualProfile {
return *Profiles;
}
+ bool isFunctionKnown(const Function &F) const {
+ return getDefinedFunctionGUID(F) != 0;
+ }
+
+ uint32_t allocateNextCounterIndex(const Function &F) {
+ assert(isFunctionKnown(F));
+ return FuncInfo.find(getDefinedFunctionGUID(F))->second.NextCounterIndex++;
----------------
mtrofin wrote:
ya, but I wanted the code to be more readable - i.e. the assertion is that the function is known rather than its implementation.
https://github.com/llvm/llvm-project/pull/102930
More information about the llvm-commits
mailing list