[PATCH] D56327: [PGO] Use SourceFileName rather module name in PGOFuncName
David Li via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 4 14:18:59 PST 2019
davidxl 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;
----------------
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?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56327/new/
https://reviews.llvm.org/D56327
More information about the llvm-commits
mailing list