<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 28, 2016 at 11:27 AM, Adam Nemet via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Author: anemet<br>
Date: Mon Mar 28 13:27:44 2016<br>
New Revision: 264611<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=264611&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=264611&view=rev</a><br>
Log:<br>
[PGO] Comment how function pointers for indirect calls are mapped to function names<br>
<br>
Summary:<br>
Hopefully this will make it easier for the next person to figure all<br>
this out...<br>
<br>
Reviewers: bogner, davidxl<br>
<br>
Subscribers: llvm-commits<br>
<br>
Differential Revision: <a href="http://reviews.llvm.org/D18490" rel="noreferrer" target="_blank">http://reviews.llvm.org/D18490</a><br>
<br>
Modified:<br>
    llvm/trunk/include/llvm/ProfileData/InstrProfData.inc<br>
    llvm/trunk/lib/ProfileData/InstrProfReader.cpp<br>
<br>
Modified: llvm/trunk/include/llvm/ProfileData/InstrProfData.inc<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ProfileData/InstrProfData.inc?rev=264611&r1=264610&r2=264611&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ProfileData/InstrProfData.inc?rev=264611&r1=264610&r2=264611&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/ProfileData/InstrProfData.inc (original)<br>
+++ llvm/trunk/include/llvm/ProfileData/InstrProfData.inc Mon Mar 28 13:27:44 2016<br>
@@ -73,6 +73,8 @@ INSTR_PROF_DATA(const uint64_t, llvm::Ty<br>
 INSTR_PROF_DATA(const IntPtrT, llvm::Type::getInt64PtrTy(Ctx), CounterPtr, \<br>
                 ConstantExpr::getBitCast(CounterPtr, \<br>
                 llvm::Type::getInt64PtrTy(Ctx)))<br>
+// This is used to map function pointers for the indirect call targets to<br>
+// function name hashes during the conversion from raw to merged profile data.<br></blockquote><div><br></div><div><span style="font-size:12.8px">I think this file has to use C-style /* */ comments.</span><br></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">-- Sean Silva</span></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
 INSTR_PROF_DATA(const IntPtrT, llvm::Type::getInt8PtrTy(Ctx), FunctionPointer, \<br>
                 FunctionAddr)<br>
 INSTR_PROF_DATA(IntPtrT, llvm::Type::getInt8PtrTy(Ctx), Values, \<br>
<br>
Modified: llvm/trunk/lib/ProfileData/InstrProfReader.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ProfileData/InstrProfReader.cpp?rev=264611&r1=264610&r2=264611&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ProfileData/InstrProfReader.cpp?rev=264611&r1=264610&r2=264611&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/ProfileData/InstrProfReader.cpp (original)<br>
+++ llvm/trunk/lib/ProfileData/InstrProfReader.cpp Mon Mar 28 13:27:44 2016<br>
@@ -412,6 +412,9 @@ RawInstrProfReader<IntPtrT>::readValuePr<br>
   if (VDataPtrOrErr.getError())<br>
     return VDataPtrOrErr.getError();<br>
<br>
+  // Note that besides deserialization, this also performs the conversion for<br>
+  // indirect call targets.  The function pointers from the raw profile are<br>
+  // remapped into function name hashes.<br>
   VDataPtrOrErr.get()->deserializeTo(Record, &Symtab->getAddrHashMap());<br>
   CurValueDataSize = VDataPtrOrErr.get()->getSize();<br>
   return success();<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div></div>