diff options
Diffstat (limited to 'llvm/tools/llvm-exegesis/lib/Uops.h')
-rw-r--r-- | llvm/tools/llvm-exegesis/lib/Uops.h | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/llvm/tools/llvm-exegesis/lib/Uops.h b/llvm/tools/llvm-exegesis/lib/Uops.h index 0236cd99182..160397affed 100644 --- a/llvm/tools/llvm-exegesis/lib/Uops.h +++ b/llvm/tools/llvm-exegesis/lib/Uops.h @@ -16,14 +16,14 @@ #define LLVM_TOOLS_LLVM_EXEGESIS_UOPS_H #include "BenchmarkRunner.h" +#include "SnippetGenerator.h" namespace exegesis { -class UopsBenchmarkRunner : public BenchmarkRunner { +class UopsSnippetGenerator : public SnippetGenerator { public: - UopsBenchmarkRunner(const LLVMState &State) - : BenchmarkRunner(State, InstructionBenchmark::Uops) {} - ~UopsBenchmarkRunner() override; + UopsSnippetGenerator(const LLVMState &State) : SnippetGenerator(State) {} + ~UopsSnippetGenerator() override; llvm::Expected<CodeTemplate> generateCodeTemplate(unsigned Opcode) const override; @@ -33,10 +33,6 @@ public: private: llvm::Error isInfeasible(const llvm::MCInstrDesc &MCInstrDesc) const; - std::vector<BenchmarkMeasure> - runMeasurements(const ExecutableFunction &EF, ScratchSpace &Scratch, - const unsigned NumRepetitions) const override; - // Instantiates memory operands within a snippet. // To make computations as parallel as possible, we generate independant // memory locations for instructions that load and store. If there are less @@ -65,6 +61,20 @@ private: std::vector<InstructionBuilder> &Snippet) const; }; +class UopsBenchmarkRunner : public BenchmarkRunner { +public: + UopsBenchmarkRunner(const LLVMState &State) + : BenchmarkRunner(State, InstructionBenchmark::Uops) {} + ~UopsBenchmarkRunner() override; + + static constexpr const size_t kMinNumDifferentAddresses = 6; + +private: + std::vector<BenchmarkMeasure> + runMeasurements(const ExecutableFunction &EF, ScratchSpace &Scratch, + const unsigned NumRepetitions) const override; +}; + } // namespace exegesis #endif // LLVM_TOOLS_LLVM_EXEGESIS_UOPS_H |