[llvm-exegesis] Implements a cache of Instruction objects.
[llvm-core.git] / tools / llvm-exegesis / lib / BenchmarkCode.h
blob38bea2519a64ecad80c765a4607f7462629a54b4
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 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_TOOLS_LLVM_EXEGESIS_BENCHMARKCODE_H
11 #define LLVM_TOOLS_LLVM_EXEGESIS_BENCHMARKCODE_H
13 #include "RegisterValue.h"
14 #include "llvm/MC/MCInst.h"
15 #include <string>
16 #include <vector>
18 namespace llvm {
19 namespace exegesis {
21 // A collection of instructions that are to be assembled, executed and measured.
22 struct BenchmarkCode {
23 // The sequence of instructions that are to be repeated.
24 std::vector<llvm::MCInst> Instructions;
26 // Before the code is executed some instructions are added to setup the
27 // registers initial values.
28 std::vector<RegisterValue> RegisterInitialValues;
30 // We also need to provide the registers that are live on entry for the
31 // assembler to generate proper prologue/epilogue.
32 std::vector<unsigned> LiveIns;
34 // Informations about how this configuration was built.
35 std::string Info;
38 } // namespace exegesis
39 } // namespace llvm
41 #endif // LLVM_TOOLS_LLVM_EXEGESIS_BENCHMARKCODE_H