[PATCH] D39997: [llvm-profdata] Report if profile data file is IR- or FE-level

Adam Nemet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 14 08:59:31 PST 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL318159: [llvm-profdata] Report if profile data file is IR- or FE-level (authored by anemet).

Repository:
  rL LLVM

https://reviews.llvm.org/D39997

Files:
  llvm/trunk/test/tools/llvm-profdata/show-instr-level.test
  llvm/trunk/tools/llvm-profdata/llvm-profdata.cpp


Index: llvm/trunk/tools/llvm-profdata/llvm-profdata.cpp
===================================================================
--- llvm/trunk/tools/llvm-profdata/llvm-profdata.cpp
+++ llvm/trunk/tools/llvm-profdata/llvm-profdata.cpp
@@ -625,6 +625,8 @@
   if (ShowCounts && TextFormat)
     return 0;
   std::unique_ptr<ProfileSummary> PS(Builder.getSummary());
+  OS << "Instrumentation level: "
+     << (Reader->isIRLevelProfile() ? "IR" : "Front-end") << "\n";
   if (ShowAllFunctions || !ShowFunction.empty())
     OS << "Functions shown: " << ShownFunctions << "\n";
   OS << "Total functions: " << PS->getNumFunctions() << "\n";
Index: llvm/trunk/test/tools/llvm-profdata/show-instr-level.test
===================================================================
--- llvm/trunk/test/tools/llvm-profdata/show-instr-level.test
+++ llvm/trunk/test/tools/llvm-profdata/show-instr-level.test
@@ -0,0 +1,7 @@
+RUN: llvm-profdata merge -o %t_clang.profdata %p/Inputs/clang_profile.proftext
+RUN: llvm-profdata show %t_clang.profdata | FileCheck %s -check-prefix=FE
+FE: Instrumentation level: Front-end
+
+RUN: llvm-profdata merge -o %t_ir.profdata %p/Inputs/IR_profile.proftext
+RUN: llvm-profdata show %t_ir.profdata | FileCheck %s -check-prefix=IR
+IR: Instrumentation level: IR


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39997.122854.patch
Type: text/x-patch
Size: 1278 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171114/d3567c94/attachment.bin>


More information about the llvm-commits mailing list