[PATCH] D56327: [PGO] Use SourceFileName rather module name in PGOFuncName
Rong Xu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 4 14:29:48 PST 2019
xur marked an inline comment as done.
xur added inline comments.
================
Comment at: lib/ProfileData/InstrProf.cpp:255
if (!InLTO) {
- StringRef FileName = (StaticFuncFullModulePrefix
- ? F.getParent()->getName()
- : sys::path::filename(F.getParent()->getName()));
- if (StaticFuncFullModulePrefix && StaticFuncStripDirNamePrefix != 0)
- FileName = stripDirPrefix(FileName, StaticFuncStripDirNamePrefix);
+ StringRef FileName(F.getParent()->getSourceFileName());
+ uint32_t StripLevel = StaticFuncFullModulePrefix ? 0 : -1;
----------------
davidxl wrote:
> xur wrote:
> > davidxl wrote:
> > > When StaticFullModulePrefix is false, should the base name be used ?
> > Yes. when it's false, only use the basename.
> > In this patch, when it's false, StripLevel is -1, in which case, we strip all the paths and leave only the basename.
> >
> > There is a test
> > test/Transforms/PGOProfile/statics_counter_naming.ll
> > that tests the stripping behavior.
> but the stripLevel will be reset to StaticFuncStripDirNamePrefix which is 0 by default?
It will not be reset as the cond in line 257 will be false if StripLevel is (unsigned) -1.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56327/new/
https://reviews.llvm.org/D56327
More information about the llvm-commits
mailing list