[ARM] Add support for MVE pre and post inc loads and stores
[llvm-core.git] / tools / llvm-exegesis / lib / Latency.h
blob7d6d96a195efb338015e704d73ebf2c63f54afa8
1 //===-- Latency.h -----------------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 ///
9 /// \file
10 /// A BenchmarkRunner implementation to measure instruction latencies.
11 ///
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_TOOLS_LLVM_EXEGESIS_LATENCY_H
15 #define LLVM_TOOLS_LLVM_EXEGESIS_LATENCY_H
17 #include "BenchmarkRunner.h"
18 #include "MCInstrDescView.h"
19 #include "SnippetGenerator.h"
21 namespace llvm {
22 namespace exegesis {
24 class LatencySnippetGenerator : public SnippetGenerator {
25 public:
26 LatencySnippetGenerator(const LLVMState &State) : SnippetGenerator(State) {}
27 ~LatencySnippetGenerator() override;
29 llvm::Expected<std::vector<CodeTemplate>>
30 generateCodeTemplates(const Instruction &Instr) const override;
33 class LatencyBenchmarkRunner : public BenchmarkRunner {
34 public:
35 LatencyBenchmarkRunner(const LLVMState &State,
36 InstructionBenchmark::ModeE Mode);
37 ~LatencyBenchmarkRunner() override;
39 private:
40 llvm::Expected<std::vector<BenchmarkMeasure>>
41 runMeasurements(const FunctionExecutor &Executor) const override;
43 } // namespace exegesis
44 } // namespace llvm
46 #endif // LLVM_TOOLS_LLVM_EXEGESIS_LATENCY_H