[PATCH] D30420: [PGO] Fix a bug in reading text format value profile.

Rong Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 27 11:25:21 PST 2017


xur created this revision.

Should use the Valuekind read from the profile.


https://reviews.llvm.org/D30420

Files:
  lib/ProfileData/InstrProfReader.cpp


Index: lib/ProfileData/InstrProfReader.cpp
===================================================================
--- lib/ProfileData/InstrProfReader.cpp
+++ lib/ProfileData/InstrProfReader.cpp
@@ -182,7 +182,7 @@
         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 @@
         CurrentValues.push_back({Value, TakenCount});
         Line++;
       }
-      Record.addValueData(VK, S, CurrentValues.data(), NumValueData, nullptr);
+      Record.addValueData(ValueKind, S, CurrentValues.data(), NumValueData,
+                          nullptr);
     }
   }
   return success();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30420.89909.patch
Type: text/x-patch
Size: 891 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170227/c781f966/attachment.bin>


More information about the llvm-commits mailing list