mirror of
https://github.com/llvm/llvm-project.git
synced 2025-05-13 21:46:05 +00:00
[PGO] Fix a bug in reading text format value profile.
Summary: Should use the Valuekind read from the profile. Reviewers: davidxl Reviewed By: davidxl Subscribers: llvm-commits, xur Differential Revision: https://reviews.llvm.org/D30420 llvm-svn: 296391
This commit is contained in:
parent
f2524e6599
commit
cbb1140720
@ -182,7 +182,7 @@ TextInstrProfReader::readValueProfileData(InstrProfRecord &Record) {
|
||||
CHECK_LINE_END(Line);
|
||||
std::pair<StringRef, StringRef> VD = Line->rsplit(':');
|
||||
uint64_t TakenCount, Value;
|
||||
if (VK == IPVK_IndirectCallTarget) {
|
||||
if (ValueKind == IPVK_IndirectCallTarget) {
|
||||
Symtab->addFuncName(VD.first);
|
||||
Value = IndexedInstrProf::ComputeHash(VD.first);
|
||||
} else {
|
||||
@ -192,7 +192,8 @@ TextInstrProfReader::readValueProfileData(InstrProfRecord &Record) {
|
||||
CurrentValues.push_back({Value, TakenCount});
|
||||
Line++;
|
||||
}
|
||||
Record.addValueData(VK, S, CurrentValues.data(), NumValueData, nullptr);
|
||||
Record.addValueData(ValueKind, S, CurrentValues.data(), NumValueData,
|
||||
nullptr);
|
||||
}
|
||||
}
|
||||
return success();
|
||||
|
Loading…
x
Reference in New Issue
Block a user