summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-exegesis/llvm-exegesis.cpp
diff options
context:
space:
mode:
authorClement Courbet <courbet@google.com>2018-05-16 09:50:04 +0000
committerClement Courbet <courbet@google.com>2018-05-16 09:50:04 +0000
commitcaa163ef6a753e4306a057f8f508f5aea299dba8 (patch)
treedc9bacbc1dd2fa94b8244b83391f9f5c092829c8 /llvm/tools/llvm-exegesis/llvm-exegesis.cpp
parentc811758da63837912a1cae1639ff0739aed5317f (diff)
downloadbcm5719-llvm-caa163ef6a753e4306a057f8f508f5aea299dba8.tar.gz
bcm5719-llvm-caa163ef6a753e4306a057f8f508f5aea299dba8.zip
[llvm-exegesis] Add a flag to output analysis csv to a file.
Reviewers: gchatelet Subscribers: llvm-commits, tschuett Differential Revision: https://reviews.llvm.org/D46931 llvm-svn: 332445
Diffstat (limited to 'llvm/tools/llvm-exegesis/llvm-exegesis.cpp')
-rw-r--r--llvm/tools/llvm-exegesis/llvm-exegesis.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/llvm/tools/llvm-exegesis/llvm-exegesis.cpp b/llvm/tools/llvm-exegesis/llvm-exegesis.cpp
index 2d4e3f8a28f..a872c759093 100644
--- a/llvm/tools/llvm-exegesis/llvm-exegesis.cpp
+++ b/llvm/tools/llvm-exegesis/llvm-exegesis.cpp
@@ -70,6 +70,10 @@ static llvm::cl::opt<float>
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 @@ void analysisMain() {
// 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 @@ void analysisMain() {
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));
}
OpenPOWER on IntegriCloud