]> granicus.if.org Git - llvm/commitdiff
[PGO] Fix a bug in reading text format value profile.
authorRong Xu <xur@google.com>
Mon, 27 Feb 2017 21:42:39 +0000 (21:42 +0000)
committerRong Xu <xur@google.com>
Mon, 27 Feb 2017 21:42:39 +0000 (21:42 +0000)
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

lib/ProfileData/InstrProfReader.cpp

index ad407f07957ff8211c7b94606a21a5a7a2574fe9..cdc4593602febd3e5b0a0630741df51cafd4da0b 100644 (file)
@@ -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();