[PATCH] D46931: [llvm-exegesis] Add a flag to output analysis csv to a file.

Clement Courbet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 16 02:24:46 PDT 2018


courbet updated this revision to Diff 147021.
courbet added a comment.

address review comments


Repository:
  rL LLVM

https://reviews.llvm.org/D46931

Files:
  tools/llvm-exegesis/llvm-exegesis.cpp


Index: tools/llvm-exegesis/llvm-exegesis.cpp
===================================================================
--- tools/llvm-exegesis/llvm-exegesis.cpp
+++ tools/llvm-exegesis/llvm-exegesis.cpp
@@ -70,6 +70,10 @@
                     llvm::cl::desc("dbscan epsilon for analysis clustering"),
                     llvm::cl::init(0.1));
 
+static llvm::cl::opt<std::string> AnalysisClustersFile("analysis-clusters-file",
+                                                       llvm::cl::desc(""),
+                                                       llvm::cl::init("-"));
+
 namespace exegesis {
 
 void benchmarkMain() {
@@ -135,7 +139,6 @@
   // FIXME: Check that all points have the same triple/cpu.
   // FIXME: Merge points from several runs (latency and uops).
 
-  //llvm::InitializeAllTargets();
   llvm::InitializeNativeTarget();
   llvm::InitializeNativeTargetAsmPrinter();
 
@@ -151,7 +154,13 @@
 
   const Analysis Analyzer(*TheTarget, Clustering);
 
-  if (auto Err = Analyzer.printClusters(llvm::outs()))
+  std::error_code ErrorCode;
+  llvm::raw_fd_ostream ClustersOS(AnalysisClustersFile, ErrorCode,
+                                  llvm::sys::fs::F_RW);
+  if (ErrorCode)
+    llvm::report_fatal_error("cannot open out file: " + AnalysisClustersFile);
+
+  if (auto Err = Analyzer.printClusters(ClustersOS))
     llvm::report_fatal_error(std::move(Err));
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46931.147021.patch
Type: text/x-patch
Size: 1384 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180516/964aab89/attachment.bin>


More information about the llvm-commits mailing list