xref: /openbsd-src/gnu/llvm/llvm/tools/llvm-exegesis/lib/UopsBenchmarkRunner.h (revision d415bd752c734aee168c4ee86ff32e8cc249eb16)
1 //===-- UopsBenchmarkRunner.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 uop decomposition.
11 ///
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_TOOLS_LLVM_EXEGESIS_UOPSBENCHMARKRUNNER_H
15 #define LLVM_TOOLS_LLVM_EXEGESIS_UOPSBENCHMARKRUNNER_H
16 
17 #include "BenchmarkRunner.h"
18 
19 namespace llvm {
20 namespace exegesis {
21 
22 class UopsBenchmarkRunner : public BenchmarkRunner {
23 public:
UopsBenchmarkRunner(const LLVMState & State,BenchmarkPhaseSelectorE BenchmarkPhaseSelector)24   UopsBenchmarkRunner(const LLVMState &State,
25                       BenchmarkPhaseSelectorE BenchmarkPhaseSelector)
26       : BenchmarkRunner(State, InstructionBenchmark::Uops,
27                         BenchmarkPhaseSelector) {}
28   ~UopsBenchmarkRunner() override;
29 
30   static constexpr const size_t kMinNumDifferentAddresses = 6;
31 
32 private:
33   Expected<std::vector<BenchmarkMeasure>>
34   runMeasurements(const FunctionExecutor &Executor) const override;
35 };
36 
37 } // namespace exegesis
38 } // namespace llvm
39 
40 #endif // LLVM_TOOLS_LLVM_EXEGESIS_UOPSBENCHMARKRUNNER_H
41