[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

Mingming Liu via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 6 23:15:42 PDT 2024


================
@@ -341,6 +879,17 @@ static bool promoteIndirectCalls(Module &M, ProfileSummaryInfo *PSI, bool InLTO,
     return false;
   }
   bool Changed = false;
+  VirtualCallSiteTypeInfoMap VirtualCSInfo;
+
+  computeVirtualCallSiteTypeInfoMap(M, MAM, VirtualCSInfo);
+
+  // This map records states across functions in an LLVM IR module.
----------------
minglotus-6 wrote:

`VTableAddressPointOffsetVal` stores the vtable address points. The vtable address point of a given `<vtable, address point offset>` is static (doesn't change after being computed once).

`IndirectCallPromoter::getOrCreateVTableAddressPointVar` creates the map entry the first time a `<vtable, offset>` pair is seen,  as `promoteIndirectCalls`  processes an IR module and calls `IndirectCallPromoter` repeatedly on each function.

I reworded the comments. PTAL.


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


More information about the llvm-commits mailing list