Skip to content

Commit 088a726

Browse files
committed
Revert "[PGO] Fix name encoding for ObjC-like functions"
This reverts commit r264587. Reverting to investigate 6 unexpected failures on the ppc bot: http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/2822 llvm-svn: 264590
1 parent a76bcc2 commit 088a726

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

llvm/include/llvm/ProfileData/InstrProf.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,6 @@ inline StringRef getInstrProfFileOverriderFuncName() {
151151
return "__llvm_profile_override_default_filename";
152152
}
153153

154-
/// Return the marker used to separate PGO names during serialization.
155-
inline StringRef getInstrProfNameSeparator() { return "\01"; }
156-
157154
/// Return the modified name for function \c F suitable to be
158155
/// used the key for profile lookup.
159156
std::string getPGOFuncName(const Function &F,

llvm/lib/ProfileData/InstrProf.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ int collectPGOFuncNameStrings(const std::vector<std::string> &NameStrs,
160160
bool doCompression, std::string &Result) {
161161
uint8_t Header[16], *P = Header;
162162
std::string UncompressedNameStrings =
163-
join(NameStrs.begin(), NameStrs.end(), getInstrProfNameSeparator());
163+
join(NameStrs.begin(), NameStrs.end(), StringRef(" "));
164164

165165
unsigned EncLen = encodeULEB128(UncompressedNameStrings.length(), P);
166166
P += EncLen;
@@ -238,7 +238,7 @@ int readPGOFuncNameStrings(StringRef NameStrings, InstrProfSymtab &Symtab) {
238238
}
239239
// Now parse the name strings.
240240
SmallVector<StringRef, 0> Names;
241-
NameStrings.split(Names, getInstrProfNameSeparator());
241+
NameStrings.split(Names, ' ');
242242
for (StringRef &Name : Names)
243243
Symtab.addFuncName(Name);
244244

llvm/unittests/ProfileData/InstrProfTest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,7 @@ TEST_P(MaybeSparseInstrProfTest, instr_prof_symtab_compression_test) {
893893
OS << "func_" << I;
894894
FuncNames1.push_back(OS.str());
895895
str.clear();
896-
OS << "f oooooooooooooo_" << I;
896+
OS << "fooooooooooooooo_" << I;
897897
FuncNames1.push_back(OS.str());
898898
str.clear();
899899
OS << "BAR_" << I;
@@ -931,7 +931,7 @@ TEST_P(MaybeSparseInstrProfTest, instr_prof_symtab_compression_test) {
931931
StringRef R = Symtab.getFuncName(IndexedInstrProf::ComputeHash(FuncNames1[0]));
932932
ASSERT_EQ(StringRef("func_0"), R);
933933
R = Symtab.getFuncName(IndexedInstrProf::ComputeHash(FuncNames1[1]));
934-
ASSERT_EQ(StringRef("f oooooooooooooo_0"), R);
934+
ASSERT_EQ(StringRef("fooooooooooooooo_0"), R);
935935
for (int I = 0; I < 3; I++) {
936936
std::string N[4];
937937
N[0] = FuncNames1[2 * I];

0 commit comments

Comments
 (0)