Guillaume Chatelet | 7f8d310 | 2018-09-26 11:57:24 +0000 | [diff] [blame] | 1 | //===-- CodeTemplate.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 CodeTemplate is a set of InstructionBuilders that may not be fully |
| 12 | /// specified (i.e. some variables are not yet set). This allows the |
| 13 | /// BenchmarkRunner to instantiate it many times with specific values to study |
| 14 | /// their impact on instruction's performance. |
| 15 | /// |
| 16 | //===----------------------------------------------------------------------===// |
| 17 | |
| 18 | #ifndef LLVM_TOOLS_LLVM_EXEGESIS_CODETEMPLATE_H |
| 19 | #define LLVM_TOOLS_LLVM_EXEGESIS_CODETEMPLATE_H |
| 20 | |
| 21 | #include "MCInstrDescView.h" |
| 22 | |
| 23 | namespace exegesis { |
| 24 | |
| 25 | struct CodeTemplate { |
| 26 | CodeTemplate() = default; |
| 27 | |
| 28 | CodeTemplate(CodeTemplate &&); // default |
| 29 | CodeTemplate &operator=(CodeTemplate &&); // default |
| 30 | CodeTemplate(const CodeTemplate &) = delete; |
| 31 | CodeTemplate &operator=(const CodeTemplate &) = delete; |
| 32 | |
| 33 | // Some information about how this template has been created. |
| 34 | std::string Info; |
| 35 | // The list of the instructions for this template. |
| 36 | std::vector<InstructionBuilder> Instructions; |
| 37 | // If the template uses the provided scratch memory, the register in which |
| 38 | // the pointer to this memory is passed in to the function. |
| 39 | unsigned ScratchSpacePointerInReg = 0; |
| 40 | }; |
| 41 | |
| 42 | } // namespace exegesis |
| 43 | |
| 44 | #endif // LLVM_TOOLS_LLVM_EXEGESIS_CODETEMPLATE_H |