[llvm] 749d595 - [MemProf][NFC] Correct comment about stripping of suffixes in profile (#73840)

via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 29 10:34:26 PST 2023


Author: Teresa Johnson
Date: 2023-11-29T10:34:21-08:00
New Revision: 749d595de906e43660dfd0daa1a60b501e1dc838

URL: https://github.com/llvm/llvm-project/commit/749d595de906e43660dfd0daa1a60b501e1dc838
DIFF: https://github.com/llvm/llvm-project/commit/749d595de906e43660dfd0daa1a60b501e1dc838.diff

LOG: [MemProf][NFC] Correct comment about stripping of suffixes in profile (#73840)

The comment about the stripping of suffixes when creating the indexed
MemProf profile was partially incorrect, as we do not strip ".__uniq."
suffixes by default (by design). Update the comment accordingly.

Added: 
    

Modified: 
    llvm/lib/ProfileData/MemProf.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/ProfileData/MemProf.cpp b/llvm/lib/ProfileData/MemProf.cpp
index db34de704a3c325..0461f0e9f840789 100644
--- a/llvm/lib/ProfileData/MemProf.cpp
+++ b/llvm/lib/ProfileData/MemProf.cpp
@@ -76,10 +76,12 @@ IndexedMemProfRecord::deserialize(const MemProfSchema &Schema,
 }
 
 GlobalValue::GUID IndexedMemProfRecord::getGUID(const StringRef FunctionName) {
-  // Canonicalize the function name to drop suffixes such as ".llvm.", ".uniq."
-  // etc. We can then match functions in the profile use phase prior to the
-  // addition of these suffixes. Note that this applies to both instrumented and
-  // sampled function names.
+  // Canonicalize the function name to drop suffixes such as ".llvm.". Note
+  // we do not drop any ".__uniq." suffixes, as getCanonicalFnName does not drop
+  // those by default. This is by design to 
diff erentiate internal linkage
+  // functions during matching. By dropping the other suffixes we can then match
+  // functions in the profile use phase prior to their addition. Note that this
+  // applies to both instrumented and sampled function names.
   StringRef CanonicalName =
       sampleprof::FunctionSamples::getCanonicalFnName(FunctionName);
 


        


More information about the llvm-commits mailing list