[PATCH] D44717: [InstrProf] Support for external functions in text format.
David Li via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 20 23:04:47 PDT 2018
davidxl added inline comments.
================
Comment at: lib/ProfileData/InstrProfWriter.cpp:361
OS << ND << "\n";
std::unique_ptr<InstrProfValueData[]> VD = Func.getValueForSite(VK, S);
for (uint32_t I = 0; I < ND; I++) {
----------------
mtrofin wrote:
> davidxl wrote:
> > What I suggested is that instead of emitting a fake target with a name that may collide with a real function, just skip the target (or better emit some comments here). Of course, the value of ND needs to be precomputed/adjusted first.
> Wouldn't we lose a counter value in that case? (which would shift thresholds, for example)
>
> I share the concern of potential (albeit low probability) name collision. How about building a name using invalid characters, such as space - since the reader matches on ':' (so the external symbol name could be "External Symbol")
Ok. Also avoid using __llvm which is a reserved namespace for profiling library symbols.
Repository:
rL LLVM
https://reviews.llvm.org/D44717
More information about the llvm-commits
mailing list