Clement Courbet | d939f6d | 2018-09-13 07:40:53 +0000 | [diff] [blame] | 1 | //===-- BenchmarkCode.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 | #ifndef LLVM_TOOLS_LLVM_EXEGESIS_BENCHMARKCODE_H |
| 11 | #define LLVM_TOOLS_LLVM_EXEGESIS_BENCHMARKCODE_H |
| 12 | |
| 13 | #include "llvm/MC/MCInst.h" |
| 14 | #include <string> |
| 15 | #include <vector> |
| 16 | |
| 17 | namespace exegesis { |
| 18 | |
| 19 | // A collection of instructions that are to be assembled, executed and measured. |
| 20 | struct BenchmarkCode { |
| 21 | // The sequence of instructions that are to be repeated. |
| 22 | std::vector<llvm::MCInst> Instructions; |
| 23 | |
| 24 | // Before the code is executed some instructions are added to setup the |
| 25 | // registers initial values. |
Guillaume Chatelet | 937f3fe | 2018-09-18 11:26:48 +0000 | [diff] [blame^] | 26 | std::vector<RegisterValue> RegisterInitialValues; |
Clement Courbet | d939f6d | 2018-09-13 07:40:53 +0000 | [diff] [blame] | 27 | |
| 28 | // We also need to provide the registers that are live on entry for the |
| 29 | // assembler to generate proper prologue/epilogue. |
| 30 | std::vector<unsigned> LiveIns; |
| 31 | |
| 32 | // Informations about how this configuration was built. |
| 33 | std::string Info; |
| 34 | }; |
| 35 | |
| 36 | } // namespace exegesis |
| 37 | |
| 38 | #endif // LLVM_TOOLS_LLVM_EXEGESIS_BENCHMARKCODE_H |