diff options
| author | Guillaume Chatelet <gchatelet@google.com> | 2018-06-07 08:11:54 +0000 |
|---|---|---|
| committer | Guillaume Chatelet <gchatelet@google.com> | 2018-06-07 08:11:54 +0000 |
| commit | 7b852cd814bfc9840640b52933e7fd427b8fd39c (patch) | |
| tree | aed7300c6b96d4811ec25bca4f4448b59f89ee41 /llvm/tools/llvm-exegesis/lib/BenchmarkRunner.h | |
| parent | b9c78e41ba4cfd721dd542daef1e1ba7d74b298e (diff) | |
| download | bcm5719-llvm-7b852cd814bfc9840640b52933e7fd427b8fd39c.tar.gz bcm5719-llvm-7b852cd814bfc9840640b52933e7fd427b8fd39c.zip | |
[llvm-exegesis] Add a Configuration object for Benchmark.
Summary: This is the first step to have the BenchmarkRunner create and measure many different configurations (different initial values for instance).
Reviewers: courbet
Subscribers: tschuett, llvm-commits
Differential Revision: https://reviews.llvm.org/D47826
llvm-svn: 334169
Diffstat (limited to 'llvm/tools/llvm-exegesis/lib/BenchmarkRunner.h')
| -rw-r--r-- | llvm/tools/llvm-exegesis/lib/BenchmarkRunner.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.h b/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.h index 5dfd05e6028..8907cccc4dd 100644 --- a/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.h +++ b/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.h @@ -26,6 +26,17 @@ namespace exegesis { +// A collection of instructions that are to be assembled, executed and measured. +struct BenchmarkConfiguration { + // This code is run before the Snippet is iterated. Since it is part of the + // measurement it should be as short as possible. It is usually used to setup + // the content of the Registers. + std::vector<llvm::MCInst> SnippetSetup; + + // The sequence of instructions that are to be repeated. + std::vector<llvm::MCInst> Snippet; +}; + // Common code for all benchmark modes. class BenchmarkRunner { public: @@ -56,9 +67,9 @@ protected: private: virtual InstructionBenchmark::ModeE getMode() const = 0; - virtual llvm::Expected<std::vector<llvm::MCInst>> - createSnippet(RegisterAliasingTrackerCache &RATC, unsigned Opcode, - llvm::raw_ostream &Debug) const = 0; + virtual llvm::Expected<BenchmarkConfiguration> + createConfiguration(RegisterAliasingTrackerCache &RATC, unsigned Opcode, + llvm::raw_ostream &Debug) const = 0; virtual std::vector<BenchmarkMeasure> runMeasurements(const ExecutableFunction &EF, |

