[PATCH] D65848: [ThinLTO][AutoFDO] Fix memory corruption due to race condition from thin backends
Wenlei He via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 8 21:20:55 PDT 2019
wenlei marked an inline comment as done.
wenlei added inline comments.
================
Comment at: llvm/include/llvm/ProfileData/SampleProf.h:383
void findInlinedFunctions(DenseSet<GlobalValue::GUID> &S, const Module *M,
+ DenseMap<uint64_t, StringRef> &GUIDToFuncNameMap,
uint64_t Threshold) const {
----------------
wmi wrote:
> If we can avoid adding the param, that will be great. GUIDToFuncNameMap is only used when the format is compact. When the interface of findInlinedFunctions is used, I hope the user doesn't have to worry about how to create a GUIDToFuncNameMap. That is why I think we may pass the handle of GUIDToFuncNameMap to FunctionSamples objects in GUIDToFuncNameMapper constructor.
Agreed it's better to avoid this extra param. Changed to populate GUIDToFuncNameMap for FunctionSamples in GUIDToFuncNameMapper's ctor now. We have to traverse all inline trees though to cover all FunctionSamples, which is a bit heavy and why I didn't do this in previous version. But this is cleaner for sure - thanks! I also moved GUIDToFuncNameMapper out of FunctionSamples.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D65848/new/
https://reviews.llvm.org/D65848
More information about the llvm-commits
mailing list