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

Mingming Liu via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 4 11:09:58 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:

To avoid subtle issues when linkage-name is different from mangled names,,I'm wondering if it warrants a change to use linkage-names (as opposed to mangled name) in `GlobalValue::getGlobalIdentifier` in this PR.  Global identifier is supposed to be hash of unique names, and linkage-name is already unique.

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


More information about the cfe-commits mailing list