[llvm] r264611 - [PGO] Comment how function pointers for indirect calls are mapped to function names

Adam Nemet via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 28 11:37:49 PDT 2016


OK, good point, thanks.  Will update.

> On Mar 28, 2016, at 11:36 AM, Sean Silva <chisophugis at gmail.com> wrote:
> 
> 
> 
> On Mon, Mar 28, 2016 at 11:27 AM, Adam Nemet via llvm-commits <llvm-commits at lists.llvm.org <mailto:llvm-commits at lists.llvm.org>> wrote:
> Author: anemet
> Date: Mon Mar 28 13:27:44 2016
> New Revision: 264611
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=264611&view=rev <http://llvm.org/viewvc/llvm-project?rev=264611&view=rev>
> Log:
> [PGO] Comment how function pointers for indirect calls are mapped to function names
> 
> Summary:
> Hopefully this will make it easier for the next person to figure all
> this out...
> 
> Reviewers: bogner, davidxl
> 
> Subscribers: llvm-commits
> 
> Differential Revision: http://reviews.llvm.org/D18490 <http://reviews.llvm.org/D18490>
> 
> Modified:
>     llvm/trunk/include/llvm/ProfileData/InstrProfData.inc
>     llvm/trunk/lib/ProfileData/InstrProfReader.cpp
> 
> Modified: llvm/trunk/include/llvm/ProfileData/InstrProfData.inc
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ProfileData/InstrProfData.inc?rev=264611&r1=264610&r2=264611&view=diff <http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ProfileData/InstrProfData.inc?rev=264611&r1=264610&r2=264611&view=diff>
> ==============================================================================
> --- llvm/trunk/include/llvm/ProfileData/InstrProfData.inc (original)
> +++ llvm/trunk/include/llvm/ProfileData/InstrProfData.inc Mon Mar 28 13:27:44 2016
> @@ -73,6 +73,8 @@ INSTR_PROF_DATA(const uint64_t, llvm::Ty
>  INSTR_PROF_DATA(const IntPtrT, llvm::Type::getInt64PtrTy(Ctx), CounterPtr, \
>                  ConstantExpr::getBitCast(CounterPtr, \
>                  llvm::Type::getInt64PtrTy(Ctx)))
> +// This is used to map function pointers for the indirect call targets to
> +// function name hashes during the conversion from raw to merged profile data.
> 
> I think this file has to use C-style /* */ comments.
> 
> -- Sean Silva
>  
>  INSTR_PROF_DATA(const IntPtrT, llvm::Type::getInt8PtrTy(Ctx), FunctionPointer, \
>                  FunctionAddr)
>  INSTR_PROF_DATA(IntPtrT, llvm::Type::getInt8PtrTy(Ctx), Values, \
> 
> Modified: llvm/trunk/lib/ProfileData/InstrProfReader.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ProfileData/InstrProfReader.cpp?rev=264611&r1=264610&r2=264611&view=diff <http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ProfileData/InstrProfReader.cpp?rev=264611&r1=264610&r2=264611&view=diff>
> ==============================================================================
> --- llvm/trunk/lib/ProfileData/InstrProfReader.cpp (original)
> +++ llvm/trunk/lib/ProfileData/InstrProfReader.cpp Mon Mar 28 13:27:44 2016
> @@ -412,6 +412,9 @@ RawInstrProfReader<IntPtrT>::readValuePr
>    if (VDataPtrOrErr.getError())
>      return VDataPtrOrErr.getError();
> 
> +  // Note that besides deserialization, this also performs the conversion for
> +  // indirect call targets.  The function pointers from the raw profile are
> +  // remapped into function name hashes.
>    VDataPtrOrErr.get()->deserializeTo(Record, &Symtab->getAddrHashMap());
>    CurValueDataSize = VDataPtrOrErr.get()->getSize();
>    return success();
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org <mailto:llvm-commits at lists.llvm.org>
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits <http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160328/5df1e1b4/attachment.html>


More information about the llvm-commits mailing list