[PATCH] D18490: [PGO] Comment how function pointers for indirect calls are mapped to function names
Adam Nemet via llvm-commits
llvm-commits at lists.llvm.org
Sat Mar 26 02:07:41 PDT 2016
anemet created this revision.
anemet added reviewers: bogner, davidxl.
anemet added a subscriber: llvm-commits.
Hopefully this will make it easier for the next person to figure all
this out...
http://reviews.llvm.org/D18490
Files:
include/llvm/ProfileData/InstrProfData.inc
lib/ProfileData/InstrProfReader.cpp
Index: lib/ProfileData/InstrProfReader.cpp
===================================================================
--- lib/ProfileData/InstrProfReader.cpp
+++ lib/ProfileData/InstrProfReader.cpp
@@ -412,6 +412,9 @@
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();
Index: include/llvm/ProfileData/InstrProfData.inc
===================================================================
--- include/llvm/ProfileData/InstrProfData.inc
+++ include/llvm/ProfileData/InstrProfData.inc
@@ -73,6 +73,8 @@
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.
INSTR_PROF_DATA(const IntPtrT, llvm::Type::getInt8PtrTy(Ctx), FunctionPointer, \
FunctionAddr)
INSTR_PROF_DATA(IntPtrT, llvm::Type::getInt8PtrTy(Ctx), Values, \
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18490.51714.patch
Type: text/x-patch
Size: 1380 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160326/c8c27c54/attachment.bin>
More information about the llvm-commits
mailing list