[llvm] [NFC][InstrProf]Factor out getCanonicalName to compute the canonical name given a pgo name. (PR #81547)
Mingming Liu via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 13 09:45:34 PST 2024
================
@@ -544,11 +544,12 @@ StringRef InstrProfSymtab::getCanonicalName(StringRef PGOName) {
}
Error InstrProfSymtab::addFuncWithName(Function &F, StringRef PGOFuncName) {
- StringSet<> Names;
- Names.insert(PGOFuncName);
- Names.insert(InstrProfSymtab::getCanonicalName(PGOFuncName));
- for (const auto &NameEntry : Names) {
- StringRef Name = NameEntry.getKey();
+ SmallVector<StringRef, 2> Names;
+ Names.push_back(PGOFuncName);
+ StringRef CanonicalFuncName = getCanonicalName(PGOFuncName);
+ if (CanonicalFuncName != PGOFuncName)
----------------
minglotus-6 wrote:
done.
https://github.com/llvm/llvm-project/pull/81547
More information about the llvm-commits
mailing list