[llvm-exegesis][NFC] Disassociate snippet generators from benchmark runners
The addition of `inverse_throughput` mode highlighted the disjointedness
of snippet generators and benchmark runners because it used the
`UopsSnippetGenerator` with the `LatencyBenchmarkRunner`.
To keep the code consistent tie the snippet generators to
parallelization/serialization rather than their benchmark runners.
Renaming `LatencySnippetGenerator` -> `SerialSnippetGenerator`.
Renaming `UopsSnippetGenerator` -> `ParallelSnippetGenerator`.
Differential Revision: https://reviews.llvm.org/D72928
diff --git a/llvm/tools/llvm-exegesis/lib/Target.cpp b/llvm/tools/llvm-exegesis/lib/Target.cpp
index 2974195..40021e2 100644
--- a/llvm/tools/llvm-exegesis/lib/Target.cpp
+++ b/llvm/tools/llvm-exegesis/lib/Target.cpp
@@ -7,8 +7,10 @@
//===----------------------------------------------------------------------===//
#include "Target.h"
-#include "Latency.h"
-#include "Uops.h"
+#include "LatencyBenchmarkRunner.h"
+#include "ParallelSnippetGenerator.h"
+#include "SerialSnippetGenerator.h"
+#include "UopsBenchmarkRunner.h"
namespace llvm {
namespace exegesis {
@@ -43,10 +45,10 @@
case InstructionBenchmark::Unknown:
return nullptr;
case InstructionBenchmark::Latency:
- return createLatencySnippetGenerator(State, Opts);
+ return createSerialSnippetGenerator(State, Opts);
case InstructionBenchmark::Uops:
case InstructionBenchmark::InverseThroughput:
- return createUopsSnippetGenerator(State, Opts);
+ return createParallelSnippetGenerator(State, Opts);
}
return nullptr;
}
@@ -77,14 +79,14 @@
return nullptr;
}
-std::unique_ptr<SnippetGenerator> ExegesisTarget::createLatencySnippetGenerator(
+std::unique_ptr<SnippetGenerator> ExegesisTarget::createSerialSnippetGenerator(
const LLVMState &State, const SnippetGenerator::Options &Opts) const {
- return std::make_unique<LatencySnippetGenerator>(State, Opts);
+ return std::make_unique<SerialSnippetGenerator>(State, Opts);
}
-std::unique_ptr<SnippetGenerator> ExegesisTarget::createUopsSnippetGenerator(
+std::unique_ptr<SnippetGenerator> ExegesisTarget::createParallelSnippetGenerator(
const LLVMState &State, const SnippetGenerator::Options &Opts) const {
- return std::make_unique<UopsSnippetGenerator>(State, Opts);
+ return std::make_unique<ParallelSnippetGenerator>(State, Opts);
}
std::unique_ptr<BenchmarkRunner> ExegesisTarget::createLatencyBenchmarkRunner(