[llvm] [IR] Handle `.__uniq.` in `getGlobalIndentifier` for local linkage objects (PR #98163)

Ellis Hoag via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 19 10:52:16 PDT 2024


================
@@ -599,10 +599,9 @@ StringRef InstrProfSymtab::getCanonicalName(StringRef PGOName) {
   // different modules and should be kept. This is the only suffix with the
   // pattern ".xxx" which is kept before matching, other suffixes similar as
   // ".llvm." will be stripped.
-  const std::string UniqSuffix = ".__uniq.";
-  size_t Pos = PGOName.find(UniqSuffix);
+  size_t Pos = PGOName.find(NameParticles::UniqSuffix);
----------------
ellishg wrote:

I suspect this can actually be replaced with `getOriginalNameBeforePromote()`, but we might also need to strip out `PartSuffix` too. 

This reminds me of recent discussion on a different PR: https://github.com/llvm/llvm-project/pull/96268/files#r1651870215
CC @MaskRay 

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


More information about the llvm-commits mailing list