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/Uops.cpp | |
| 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/Uops.cpp')
| -rw-r--r-- | llvm/tools/llvm-exegesis/lib/Uops.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/llvm/tools/llvm-exegesis/lib/Uops.cpp b/llvm/tools/llvm-exegesis/lib/Uops.cpp index b90ab1a22e4..7f1079e3182 100644 --- a/llvm/tools/llvm-exegesis/lib/Uops.cpp +++ b/llvm/tools/llvm-exegesis/lib/Uops.cpp @@ -145,11 +145,12 @@ InstructionBenchmark::ModeE UopsBenchmarkRunner::getMode() const { return InstructionBenchmark::Uops; } -llvm::Expected<std::vector<llvm::MCInst>> -UopsBenchmarkRunner::createSnippet(RegisterAliasingTrackerCache &RATC, - unsigned Opcode, - llvm::raw_ostream &Info) const { - std::vector<llvm::MCInst> Snippet; +llvm::Expected<BenchmarkConfiguration> +UopsBenchmarkRunner::createConfiguration(RegisterAliasingTrackerCache &RATC, + unsigned Opcode, + llvm::raw_ostream &Info) const { + BenchmarkConfiguration Configuration; + std::vector<llvm::MCInst> &Snippet = Configuration.Snippet; const llvm::MCInstrDesc &MCInstrDesc = MCInstrInfo.get(Opcode); const Instruction Instruction(MCInstrDesc, RATC); @@ -162,12 +163,12 @@ UopsBenchmarkRunner::createSnippet(RegisterAliasingTrackerCache &RATC, if (SelfAliasing.empty()) { Info << "instruction is parallel, repeating a random one.\n"; Snippet.push_back(randomizeUnsetVariablesAndBuild(Instruction)); - return Snippet; + return Configuration; } if (SelfAliasing.hasImplicitAliasing()) { Info << "instruction is serial, repeating a random one.\n"; Snippet.push_back(randomizeUnsetVariablesAndBuild(Instruction)); - return Snippet; + return Configuration; } const auto TiedVariables = getTiedVariables(Instruction); if (!TiedVariables.empty()) { @@ -188,7 +189,7 @@ UopsBenchmarkRunner::createSnippet(RegisterAliasingTrackerCache &RATC, Var->AssignedValue = llvm::MCOperand::createReg(Reg); Snippet.push_back(randomizeUnsetVariablesAndBuild(Instruction)); } - return Snippet; + return Configuration; } // No tied variables, we pick random values for defs. llvm::BitVector Defs(MCRegisterInfo.getNumRegs()); @@ -219,7 +220,7 @@ UopsBenchmarkRunner::createSnippet(RegisterAliasingTrackerCache &RATC, Info << "instruction has no tied variables picking Uses different from defs\n"; Snippet.push_back(randomizeUnsetVariablesAndBuild(Instruction)); - return Snippet; + return Configuration; } std::vector<BenchmarkMeasure> |

