[llvm] [MemProf] Support cloning for indirect calls with ThinLTO (PR #110625)
Teresa Johnson via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 9 20:35:52 PDT 2024
================
@@ -3933,6 +4215,16 @@ bool MemProfContextDisambiguation::applyImport(Module &M) {
MapTailCallCalleeVIToCallsite.insert({Callsite.Callee, Callsite});
}
+ // Data structures for saving indirect call profile info for use in ICP with
+ // cloning.
+ struct ICallAnalysisData {
+ std::vector<InstrProfValueData> CandidateProfileData;
+ uint32_t NumCandidates;
+ uint64_t TotalCount;
+ unsigned CallsiteInfoStartIndex;
+ };
+ std::map<CallBase *, ICallAnalysisData> ICallAnalysisMap;
----------------
teresajohnson wrote:
Actually, it's probably best that we do the promotions in a consistent order, so this is a good point, and I realized we don't even need a map, so I have moved the CallBase into the ICallAnalysisData struct and changed this to a vector. Doing that made me realize that we were (harmlessly but unnecessarily) reinserting the same info into the map multiple times in the loop over CandidateProfileData, which would have been an issue for the vector, so I moved the insertion into the new vector outside the loop over the candidate data.
https://github.com/llvm/llvm-project/pull/110625
More information about the llvm-commits
mailing list