Skip to content

Commit 749d595

Browse files
[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.
1 parent 40422bf commit 749d595

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

llvm/lib/ProfileData/MemProf.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,12 @@ IndexedMemProfRecord::deserialize(const MemProfSchema &Schema,
7676
}
7777

7878
GlobalValue::GUID IndexedMemProfRecord::getGUID(const StringRef FunctionName) {
79-
// Canonicalize the function name to drop suffixes such as ".llvm.", ".uniq."
80-
// etc. We can then match functions in the profile use phase prior to the
81-
// addition of these suffixes. Note that this applies to both instrumented and
82-
// sampled function names.
79+
// Canonicalize the function name to drop suffixes such as ".llvm.". Note
80+
// we do not drop any ".__uniq." suffixes, as getCanonicalFnName does not drop
81+
// those by default. This is by design to differentiate internal linkage
82+
// functions during matching. By dropping the other suffixes we can then match
83+
// functions in the profile use phase prior to their addition. Note that this
84+
// applies to both instrumented and sampled function names.
8385
StringRef CanonicalName =
8486
sampleprof::FunctionSamples::getCanonicalFnName(FunctionName);
8587

0 commit comments

Comments
 (0)