[llvm] [lld] [InstrProf] No linkage prefixes in IRPGO names (PR #76994)
David Li via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 4 12:11:47 PST 2024
================
@@ -297,31 +295,6 @@ static StringRef getStrippedSourceFileName(const GlobalObject &GO) {
return FileName;
}
-// The PGO name has the format [<filepath>;]<linkage-name> where <filepath>; is
-// provided if linkage is local and <linkage-name> is the mangled function
-// name. The filepath is used to discriminate possibly identical function names.
-// ; is used because it is unlikely to be found in either <filepath> or
-// <linkage-name>.
-//
-// Older compilers used getPGOFuncName() which has the format
-// [<filepath>:]<function-name>. <filepath> is used to discriminate between
-// possibly identical function names when linkage is local and <function-name>
-// simply comes from F.getName(). This caused trouble for Objective-C functions
-// which commonly have :'s in their names. Also, since <function-name> is not
-// mangled, they cannot be passed to Mach-O linkers via -order_file. We still
-// need to compute this name to lookup functions from profiles built by older
-// compilers.
-static std::string
-getIRPGONameForGlobalObject(const GlobalObject &GO,
- GlobalValue::LinkageTypes Linkage,
- StringRef FileName) {
- SmallString<64> Name;
- // FIXME: Mangler's handling is kept outside of `getGlobalIdentifier` for now.
- // For more details please check issue #74565.
- Mangler().getNameWithPrefix(Name, &GO, /*CannotUsePrivateLabel=*/true);
----------------
david-xl wrote:
Shall we just keep getIRPGONameForGlobalObject method here and simply replace line 321 with another dummy helper which is a wrapper to getName() (with some comments)? This allows more platform specific handling flexibility in the future.
https://github.com/llvm/llvm-project/pull/76994
More information about the llvm-commits
mailing list