Skip to content

Commit 98d388f

Browse files
committed
Address comments
1 parent 7cd08c2 commit 98d388f

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

llvm/lib/ProfileData/InstrProf.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -641,11 +641,12 @@ Error InstrProfSymtab::addFuncWithName(Function &F, StringRef PGOFuncName,
641641
if (Error E = NameToGUIDMap(PGOFuncName))
642642
return E;
643643

644-
if (AddCanonical) {
645-
StringRef CanonicalFuncName = getCanonicalName(PGOFuncName);
646-
if (CanonicalFuncName != PGOFuncName)
647-
return NameToGUIDMap(CanonicalFuncName);
648-
}
644+
if (!AddCanonical)
645+
return Error::success();
646+
647+
StringRef CanonicalFuncName = getCanonicalName(PGOFuncName);
648+
if (CanonicalFuncName != PGOFuncName)
649+
return NameToGUIDMap(CanonicalFuncName);
649650

650651
return Error::success();
651652
}

llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4152,7 +4152,7 @@ bool MemProfContextDisambiguation::initializeIndirectCallPromotionInfo(
41524152
// In practice this should not be a limitation, since local functions should
41534153
// have PGOFuncName metadata and global function names shouldn't need any
41544154
// special handling (they should not get the ".llvm.*" suffix that the
4155-
// canonicalization handling is attempting to strip.
4155+
// canonicalization handling is attempting to strip).
41564156
if (Error E = Symtab->create(M, /*InLTO=*/true, /*AddCanonical=*/false)) {
41574157
std::string SymtabFailure = toString(std::move(E));
41584158
M.getContext().emitError("Failed to create symtab: " + SymtabFailure);

0 commit comments

Comments
 (0)