[PATCH] D18489: [PGO] Comment how function pointers for indirect calls are mapped to function names

Adam Nemet via cfe-commits cfe-commits at lists.llvm.org
Sat Mar 26 02:05:54 PDT 2016

anemet created this revision.
anemet added reviewers: bogner, davidxl.
anemet added a subscriber: cfe-commits.

Hopefully this will make it easier for the next person to figure all
this out...



Index: lib/CodeGen/CodeGenPGO.cpp
--- lib/CodeGen/CodeGenPGO.cpp
+++ lib/CodeGen/CodeGenPGO.cpp
@@ -755,6 +755,14 @@
   if (!ValuePtr || !ValueSite || !Builder.GetInsertBlock())
+  // During instrumentation, function pointers are collected for the different
+  // indirect call targets.  Then as part of the conversion from raw to merged
+  // profile data, these get replaced with md5 function name hashes.  (This
+  // actually happens during deserialization of the raw profdata.)
+  //
+  // For this remapping the ProfData is used.  ProfData contains both the
+  // function name hash and the function address.
   bool InstrumentValueSites = CGM.getCodeGenOpts().hasProfileClangInstr();
   if (InstrumentValueSites && RegionCounterMap) {
     llvm::LLVMContext &Ctx = CGM.getLLVMContext();

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18489.51713.patch
Type: text/x-patch
Size: 879 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160326/50e4a37f/attachment.bin>

More information about the cfe-commits mailing list