[llvm] [clang] [PGO][GlobalValue][LTO]In GlobalValues::getGlobalIdentifier, use semicolon as delimiter for local-linkage varibles. (PR #74008)

Mingming Liu via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 1 11:20:26 PST 2023


================
@@ -300,12 +316,8 @@ getIRPGONameForGlobalObject(const GlobalObject &GO,
                             GlobalValue::LinkageTypes Linkage,
                             StringRef FileName) {
   SmallString<64> Name;
-  if (llvm::GlobalValue::isLocalLinkage(Linkage)) {
-    Name.append(FileName.empty() ? "<unknown>" : FileName);
-    Name.append(";");
-  }
   Mangler().getNameWithPrefix(Name, &GO, /*CannotUsePrivateLabel=*/true);
----------------
minglotus-6 wrote:

> I guess the name is still mangled, but I used Mangler().getNameWithPrefix() to get the linkage name.

When raw profiles stores (optionally filename prefixed) linkage names while global identifier uses the (filename prefixed) mangled name, the particular use case would be broken. Is it possible to convert objective-c mangled name to linkage name (needed by linker) in the post-processing of raw profiles? And do you think it make sense for the use case of D156569?

Say raw profiles still stores `[filepath;]mangled-name`, and `llvm-profdata` takes it to generate the linkage name that `-symbol-ordering-file` wants.

https://github.com/llvm/llvm-project/pull/74008


More information about the llvm-commits mailing list