1 //===-- Latency.h -----------------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 /// A BenchmarkRunner implementation to measure instruction latencies.
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_TOOLS_LLVM_EXEGESIS_LATENCY_H
16 #define LLVM_TOOLS_LLVM_EXEGESIS_LATENCY_H
18 #include "BenchmarkRunner.h"
22 class LatencyBenchmarkRunner : public BenchmarkRunner {
24 ~LatencyBenchmarkRunner() override;
27 const char *getDisplayName() const override;
29 llvm::Expected<std::vector<llvm::MCInst>>
30 createCode(const LLVMState &State, unsigned OpcodeIndex,
31 unsigned NumRepetitions,
32 const JitFunctionContext &Context) const override;
34 std::vector<BenchmarkMeasure>
35 runMeasurements(const LLVMState &State, const JitFunction &Function,
36 unsigned NumRepetitions) const override;
39 } // namespace exegesis
41 #endif // LLVM_TOOLS_LLVM_EXEGESIS_LATENCY_H