[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
Mon Nov 13 21:49:22 PST 2017


anemet created this revision.

https://reviews.llvm.org/D39997

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


Index: tools/llvm-profdata/llvm-profdata.cpp
===================================================================
--- tools/llvm-profdata/llvm-profdata.cpp
+++ 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: test/tools/llvm-profdata/show-instr-level.test
===================================================================
--- /dev/null
+++ 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.122774.patch
Type: text/x-patch
Size: 1175 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171114/66f2eae1/attachment.bin>


More information about the llvm-commits mailing list