[PATCH] D18624: [PGO] PGOFuncName meta data if PGOFuncName is different from function's raw name.
Rong Xu via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 21 12:00:51 PDT 2016
xur added a comment.
I was using spec-run where the command line has the pathless filename.
The source in Atam's command-line has the absolute path.
In meta-data creation, we used Module's getSourceFileName() which has the
source name appeared in the command line (in this case, a full patch name).
While in Clang's setFuncName, it uses CGM.getCodeGenOpts().MainFileName.
This string strips the path from the source.
I can expand function createPGOFuncNameMetadata() to handle this (I mean
using the stripped name).
But I need to point out that stripping the patch may not a good idea as it
greatly increases the change name conflicts:
If we have
static bar() in dir1/foo.c
static bar() in dir2/foo.c
if the user compiler with:
> clang ... dir1/foo.c
> clang ... dir2/foo.c
With Clang's scheme, both functions would have PGOFuncName of foo.c:bar().
In IR instrumentation, we will have different name in this case:
dir1/foo.c:bar(), and dir2/foo.c:bar()
Of course, if the user compiles the code the following way:
> cd dir1; clang foo.c
> cd ../dir2; clang foo.c
we will have conflict for both instrumentation.
In this case, we can suggestion the user to have the relative path in the
More information about the cfe-commits