[PATCH] D103372: [InstrProfiling] If no value profiling, make data variable private and (for Windows) use one comdat
David Li via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun May 30 15:33:36 PDT 2021
davidxl added inline comments.
================
Comment at: llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp:849
// discarded.
+ bool ValueProfiling = enablesValueProfiling(*M);
bool NeedComdat = needsComdatForCounter(*Fn, *M);
----------------
Probably define a helper : profDataReferencedInCode(). Currently it is the same as enablesValueProfiling, but may change in the future. It also makes code more readable.
================
Comment at: llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp:857
+ auto GroupName = TT.isOSBinFormatCOFF() && ValueProfiling ? GV->getName()
+ : CntsVarName;
Comdat *C = M->getOrInsertComdat(GroupName);
----------------
why changing behavior on ELF?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D103372/new/
https://reviews.llvm.org/D103372
More information about the llvm-commits
mailing list