summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/docs/CommandGuide/llvm-exegesis.rst8
-rw-r--r--llvm/test/tools/llvm-exegesis/X86/analysis-uops-backwards.test2
-rw-r--r--llvm/test/tools/llvm-exegesis/X86/analysis-uops-variant.test2
-rw-r--r--llvm/test/tools/llvm-exegesis/X86/analysis-uops.test2
-rw-r--r--llvm/tools/llvm-exegesis/llvm-exegesis.cpp11
5 files changed, 17 insertions, 8 deletions
diff --git a/llvm/docs/CommandGuide/llvm-exegesis.rst b/llvm/docs/CommandGuide/llvm-exegesis.rst
index bbd90563005..878ced3c3bf 100644
--- a/llvm/docs/CommandGuide/llvm-exegesis.rst
+++ b/llvm/docs/CommandGuide/llvm-exegesis.rst
@@ -190,7 +190,9 @@ OPTIONS
.. option:: -mode=[latency|uops|inverse_throughput|analysis]
- Specify the run mode.
+ Specify the run mode. Note that if you pick `analysis` mode, you also need
+ to specify at least one of the `-analysis-clusters-output-file=` and
+ `-analysis-inconsistencies-output-file=`.
.. option:: -num-repetitions=<Number of repetition>
@@ -205,12 +207,12 @@ OPTIONS
.. option:: -analysis-clusters-output-file=</path/to/file>
If provided, write the analysis clusters as CSV to this file. "-" prints to
- stdout.
+ stdout. By default, this analysis is not run.
.. option:: -analysis-inconsistencies-output-file=</path/to/file>
If non-empty, write inconsistencies found during analysis to this file. `-`
- prints to stdout.
+ prints to stdout. By default, this analysis is not run.
.. option:: -analysis-numpoints=<dbscan numPoints parameter>
diff --git a/llvm/test/tools/llvm-exegesis/X86/analysis-uops-backwards.test b/llvm/test/tools/llvm-exegesis/X86/analysis-uops-backwards.test
index 4c758ba9379..ac806da4869 100644
--- a/llvm/test/tools/llvm-exegesis/X86/analysis-uops-backwards.test
+++ b/llvm/test/tools/llvm-exegesis/X86/analysis-uops-backwards.test
@@ -1,5 +1,5 @@
# This tests backwards-compatibility of the yaml schema (see PR39082).
-# RUN: llvm-exegesis -mode=analysis -benchmarks-file=%s -analysis-inconsistencies-output-file="" -analysis-numpoints=1 | FileCheck %s
+# RUN: llvm-exegesis -mode=analysis -benchmarks-file=%s -analysis-clusters-output-file=- -analysis-numpoints=1 | FileCheck %s
# CHECK: cluster_id,opcode_name,config,sched_class,HWPort0,HWPort1,HWPort2,HWPort3,HWPort4,HWPort5,HWPort6,HWPort7,NumMicroOps
# CHECK-NEXT: vzeroall
diff --git a/llvm/test/tools/llvm-exegesis/X86/analysis-uops-variant.test b/llvm/test/tools/llvm-exegesis/X86/analysis-uops-variant.test
index 507e979e5dc..f1efa3af050 100644
--- a/llvm/test/tools/llvm-exegesis/X86/analysis-uops-variant.test
+++ b/llvm/test/tools/llvm-exegesis/X86/analysis-uops-variant.test
@@ -1,4 +1,4 @@
-# RUN: llvm-exegesis -mode=analysis -benchmarks-file=%s -analysis-inconsistencies-output-file="" -analysis-numpoints=1 | FileCheck %s
+# RUN: llvm-exegesis -mode=analysis -benchmarks-file=%s -analysis-clusters-output-file=- -analysis-numpoints=1 | FileCheck %s
# REQUIRES: asserts
# (sched class name is NDEBUG only)
diff --git a/llvm/test/tools/llvm-exegesis/X86/analysis-uops.test b/llvm/test/tools/llvm-exegesis/X86/analysis-uops.test
index f1aae9750c4..95737e5d545 100644
--- a/llvm/test/tools/llvm-exegesis/X86/analysis-uops.test
+++ b/llvm/test/tools/llvm-exegesis/X86/analysis-uops.test
@@ -1,4 +1,4 @@
-# RUN: llvm-exegesis -mode=analysis -benchmarks-file=%s -analysis-inconsistencies-output-file="" -analysis-numpoints=1 | FileCheck %s
+# RUN: llvm-exegesis -mode=analysis -benchmarks-file=%s -analysis-clusters-output-file=- -analysis-numpoints=1 | FileCheck %s
# CHECK: cluster_id,opcode_name,config,sched_class,HWPort0,HWPort1,HWPort2,HWPort3,HWPort4,HWPort5,HWPort6,HWPort7,NumMicroOps
# CHECK-NEXT: vzeroall
diff --git a/llvm/tools/llvm-exegesis/llvm-exegesis.cpp b/llvm/tools/llvm-exegesis/llvm-exegesis.cpp
index ce11fadbf6e..55903728f9d 100644
--- a/llvm/tools/llvm-exegesis/llvm-exegesis.cpp
+++ b/llvm/tools/llvm-exegesis/llvm-exegesis.cpp
@@ -91,10 +91,10 @@ static cl::opt<float>
static cl::opt<std::string>
AnalysisClustersOutputFile("analysis-clusters-output-file", cl::desc(""),
- cl::init("-"));
+ cl::init(""));
static cl::opt<std::string>
AnalysisInconsistenciesOutputFile("analysis-inconsistencies-output-file",
- cl::desc(""), cl::init("-"));
+ cl::desc(""), cl::init(""));
static cl::opt<std::string>
CpuName("mcpu",
@@ -404,6 +404,13 @@ static void analysisMain() {
if (BenchmarkFile.empty())
llvm::report_fatal_error("--benchmarks-file must be set.");
+ if (AnalysisClustersOutputFile.empty() &&
+ AnalysisInconsistenciesOutputFile.empty()) {
+ llvm::report_fatal_error(
+ "At least one of --analysis-clusters-output-file and "
+ "--analysis-inconsistencies-output-file must be specified.");
+ }
+
llvm::InitializeNativeTarget();
llvm::InitializeNativeTargetAsmPrinter();
llvm::InitializeNativeTargetDisassembler();
OpenPOWER on IntegriCloud