diff options
author | Rong Xu <xur@google.com> | 2016-02-08 23:11:16 +0000 |
---|---|---|
committer | Rong Xu <xur@google.com> | 2016-02-08 23:11:16 +0000 |
commit | d0dfb67fe18e24de6e45d6cfaca8ef91f36cbd26 (patch) | |
tree | a8c2d74dd528081fae5ca618885afa116b127f7a /llvm/tools/llvm-profdata/llvm-profdata.cpp | |
parent | 1da4afdfc9fe6cb8848e9fb7aa55ff53d06bd16b (diff) | |
download | bcm5719-llvm-d0dfb67fe18e24de6e45d6cfaca8ef91f36cbd26.tar.gz bcm5719-llvm-d0dfb67fe18e24de6e45d6cfaca8ef91f36cbd26.zip |
[PGO] Revert r260146 as it breaks Darwin platforms.
r260146 | xur | 2016-02-08 13:07:46 -0800 (Mon, 08 Feb 2016) | 13 lines
[PGO] Differentiate Clang instrumentation and IR level instrumentation profiles
llvm-svn: 260170
Diffstat (limited to 'llvm/tools/llvm-profdata/llvm-profdata.cpp')
-rw-r--r-- | llvm/tools/llvm-profdata/llvm-profdata.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/llvm/tools/llvm-profdata/llvm-profdata.cpp b/llvm/tools/llvm-profdata/llvm-profdata.cpp index c7760866b80..2b6eacfb48a 100644 --- a/llvm/tools/llvm-profdata/llvm-profdata.cpp +++ b/llvm/tools/llvm-profdata/llvm-profdata.cpp @@ -128,10 +128,6 @@ static void mergeInstrProfile(const WeightedFileVector &Inputs, exitWithErrorCode(ec, Input.Filename); auto Reader = std::move(ReaderOrErr.get()); - bool IsIRProfile = Reader->isIRLevelProfile(); - if (Writer.setIsIRLevelProfile(IsIRProfile)) - exitWithError("Merge IR generated profile with Clang generated profile."); - for (auto &I : *Reader) { if (std::error_code EC = Writer.addRecord(std::move(I), Input.Weight)) { // Only show hint the first time an error occurs. @@ -273,7 +269,6 @@ static int showInstrProfile(std::string Filename, bool ShowCounts, exitWithErrorCode(EC, Filename); auto Reader = std::move(ReaderOrErr.get()); - bool IsIRInstr = Reader->isIRLevelProfile(); size_t ShownFunctions = 0; for (const auto &Func : *Reader) { bool Show = @@ -300,9 +295,8 @@ static int showInstrProfile(std::string Filename, bool ShowCounts, OS << " " << Func.Name << ":\n" << " Hash: " << format("0x%016" PRIx64, Func.Hash) << "\n" - << " Counters: " << Func.Counts.size() << "\n"; - if (!IsIRInstr) - OS << " Function count: " << Func.Counts[0] << "\n"; + << " Counters: " << Func.Counts.size() << "\n" + << " Function count: " << Func.Counts[0] << "\n"; if (ShowIndirectCallTargets) OS << " Indirect Call Site Count: " @@ -310,9 +304,8 @@ static int showInstrProfile(std::string Filename, bool ShowCounts, if (ShowCounts) { OS << " Block counts: ["; - size_t Start = (IsIRInstr ? 0 : 1); - for (size_t I = Start, E = Func.Counts.size(); I < E; ++I) { - OS << (I == Start ? "" : ", ") << Func.Counts[I]; + for (size_t I = 1, E = Func.Counts.size(); I < E; ++I) { + OS << (I == 1 ? "" : ", ") << Func.Counts[I]; } OS << "]\n"; } |