[llvm] r296391 - [PGO] Fix a bug in reading text format value profile.

Rong Xu via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 27 13:42:39 PST 2017


Author: xur
Date: Mon Feb 27 15:42:39 2017
New Revision: 296391

URL: http://llvm.org/viewvc/llvm-project?rev=296391&view=rev
Log:
[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

Modified:
    llvm/trunk/lib/ProfileData/InstrProfReader.cpp

Modified: llvm/trunk/lib/ProfileData/InstrProfReader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ProfileData/InstrProfReader.cpp?rev=296391&r1=296390&r2=296391&view=diff
==============================================================================
--- llvm/trunk/lib/ProfileData/InstrProfReader.cpp (original)
+++ llvm/trunk/lib/ProfileData/InstrProfReader.cpp Mon Feb 27 15:42:39 2017
@@ -182,7 +182,7 @@ TextInstrProfReader::readValueProfileDat
         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::readValueProfileDat
         CurrentValues.push_back({Value, TakenCount});
         Line++;
       }
-      Record.addValueData(VK, S, CurrentValues.data(), NumValueData, nullptr);
+      Record.addValueData(ValueKind, S, CurrentValues.data(), NumValueData,
+                          nullptr);
     }
   }
   return success();




More information about the llvm-commits mailing list