[llvm] [MemProf] Support cloning for indirect calls with ThinLTO (PR #110625)

Snehasish Kumar via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 4 10:47:54 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;
----------------
snehasish wrote:

We iterate over this map on L4466 and use pointer keys so this could lead to non-determinism in the order things are processed. Since it shouldn't matter, lets change it to DenseMap?

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


More information about the llvm-commits mailing list