summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-exegesis/lib/Target.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-exegesis/lib/Target.cpp')
-rw-r--r--llvm/tools/llvm-exegesis/lib/Target.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/llvm/tools/llvm-exegesis/lib/Target.cpp b/llvm/tools/llvm-exegesis/lib/Target.cpp
index 67a9ea65195..a8b34878475 100644
--- a/llvm/tools/llvm-exegesis/lib/Target.cpp
+++ b/llvm/tools/llvm-exegesis/lib/Target.cpp
@@ -36,6 +36,20 @@ void ExegesisTarget::registerTarget(ExegesisTarget *Target) {
FirstTarget = Target;
}
+std::unique_ptr<SnippetGenerator>
+ExegesisTarget::createSnippetGenerator(InstructionBenchmark::ModeE Mode,
+ const LLVMState &State) const {
+ switch (Mode) {
+ case InstructionBenchmark::Unknown:
+ return nullptr;
+ case InstructionBenchmark::Latency:
+ return createLatencySnippetGenerator(State);
+ case InstructionBenchmark::Uops:
+ return createUopsSnippetGenerator(State);
+ }
+ return nullptr;
+}
+
std::unique_ptr<BenchmarkRunner>
ExegesisTarget::createBenchmarkRunner(InstructionBenchmark::ModeE Mode,
const LLVMState &State) const {
@@ -50,6 +64,16 @@ ExegesisTarget::createBenchmarkRunner(InstructionBenchmark::ModeE Mode,
return nullptr;
}
+std::unique_ptr<SnippetGenerator>
+ExegesisTarget::createLatencySnippetGenerator(const LLVMState &State) const {
+ return llvm::make_unique<LatencySnippetGenerator>(State);
+}
+
+std::unique_ptr<SnippetGenerator>
+ExegesisTarget::createUopsSnippetGenerator(const LLVMState &State) const {
+ return llvm::make_unique<UopsSnippetGenerator>(State);
+}
+
std::unique_ptr<BenchmarkRunner>
ExegesisTarget::createLatencyBenchmarkRunner(const LLVMState &State) const {
return llvm::make_unique<LatencyBenchmarkRunner>(State);
OpenPOWER on IntegriCloud