[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


================
@@ -4108,6 +4456,119 @@ bool MemProfContextDisambiguation::applyImport(Module &M) {
         I.setMetadata(LLVMContext::MD_callsite, nullptr);
       }
     }
+
+    // Now do any promotion required for cloning. Specifically, for each
+    // recorded ICP candidate (which was only recorded because one clone of that
+    // candidate should call a cloned target), we perform ICP (speculative
+    // devirtualization) for each clone of the callsite, and update its callee
+    // to the appropriate clone. Note that the ICP compares against the original
+    // version of the target, which is what is in the vtable.
+    for (auto &ICallInfo : ICallAnalysisMap) {
----------------
snehasish wrote:

Can you move this to a separate helper method?

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


More information about the llvm-commits mailing list