From: Rong Xu Date: Mon, 27 Feb 2017 21:42:39 +0000 (+0000) Subject: [PGO] Fix a bug in reading text format value profile. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=676fd3131ac71a6e9c8a097f51e90e60878133a8;p=llvm [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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296391 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/ProfileData/InstrProfReader.cpp b/lib/ProfileData/InstrProfReader.cpp index ad407f07957..cdc4593602f 100644 --- a/lib/ProfileData/InstrProfReader.cpp +++ b/lib/ProfileData/InstrProfReader.cpp @@ -182,7 +182,7 @@ TextInstrProfReader::readValueProfileData(InstrProfRecord &Record) { CHECK_LINE_END(Line); std::pair 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();