summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.h
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-exegesis/lib/BenchmarkRunner.h')
-rw-r--r--llvm/tools/llvm-exegesis/lib/BenchmarkRunner.h29
1 files changed, 9 insertions, 20 deletions
diff --git a/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.h b/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.h
index 679436a2cf7..715ad5884c1 100644
--- a/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.h
+++ b/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.h
@@ -16,10 +16,9 @@
#ifndef LLVM_TOOLS_LLVM_EXEGESIS_BENCHMARKRUNNER_H
#define LLVM_TOOLS_LLVM_EXEGESIS_BENCHMARKRUNNER_H
-#include "Assembler.h"
#include "BenchmarkResult.h"
+#include "InMemoryAssembler.h"
#include "LlvmState.h"
-#include "RegisterAliasing.h"
#include "llvm/MC/MCInst.h"
#include "llvm/Support/Error.h"
#include <vector>
@@ -29,8 +28,6 @@ namespace exegesis {
// Common code for all benchmark modes.
class BenchmarkRunner {
public:
- explicit BenchmarkRunner(const LLVMState &State);
-
// Subtargets can disable running benchmarks for some instructions by
// returning an error here.
class InstructionFilter {
@@ -45,29 +42,21 @@ public:
virtual ~BenchmarkRunner();
- InstructionBenchmark run(unsigned Opcode, const InstructionFilter &Filter,
- unsigned NumRepetitions);
-
-protected:
- const LLVMState &State;
- const llvm::MCInstrInfo &MCInstrInfo;
- const llvm::MCRegisterInfo &MCRegisterInfo;
+ InstructionBenchmark run(const LLVMState &State, unsigned Opcode,
+ unsigned NumRepetitions,
+ const InstructionFilter &Filter) const;
private:
virtual const char *getDisplayName() const = 0;
virtual llvm::Expected<std::vector<llvm::MCInst>>
- createSnippet(RegisterAliasingTrackerCache &RATC, unsigned Opcode,
- llvm::raw_ostream &Debug) const = 0;
+ createCode(const LLVMState &State, unsigned OpcodeIndex,
+ unsigned NumRepetitions,
+ const JitFunctionContext &Context) const = 0;
virtual std::vector<BenchmarkMeasure>
- runMeasurements(const ExecutableFunction &EF,
- const unsigned NumRepetitions) const = 0;
-
- llvm::Expected<std::string>
- writeObjectFile(llvm::ArrayRef<llvm::MCInst> Code) const;
-
- RegisterAliasingTrackerCache RATC;
+ runMeasurements(const LLVMState &State, const JitFunction &Function,
+ unsigned NumRepetitions) const = 0;
};
} // namespace exegesis
OpenPOWER on IntegriCloud