1 //===-- Uops.h --------------------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 ///
10 /// \file
11 /// A BenchmarkRunner implementation to measure uop decomposition.
12 ///
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_TOOLS_LLVM_EXEGESIS_UOPS_H
16 #define LLVM_TOOLS_LLVM_EXEGESIS_UOPS_H
17 
18 #include "BenchmarkRunner.h"
19 
20 namespace exegesis {
21 
22 class UopsBenchmarkRunner : public BenchmarkRunner {
23 public:
UopsBenchmarkRunner(const LLVMState & State)24   UopsBenchmarkRunner(const LLVMState &State)
25       : BenchmarkRunner(State, InstructionBenchmark::Uops) {}
26   ~UopsBenchmarkRunner() override;
27 
28   llvm::Expected<SnippetPrototype>
29   generatePrototype(unsigned Opcode) const override;
30 
31 private:
32   llvm::Error isInfeasible(const llvm::MCInstrDesc &MCInstrDesc) const;
33 
34   std::vector<BenchmarkMeasure>
35   runMeasurements(const ExecutableFunction &EF,
36                   const unsigned NumRepetitions) const override;
37 };
38 
39 } // namespace exegesis
40 
41 #endif // LLVM_TOOLS_LLVM_EXEGESIS_UOPS_H
42