blob: 03708683106cf4322fcfb32290f0347520938032 [file] [log] [blame]
Clement Courbetd939f6d2018-09-13 07:40:53 +00001//===-- 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
17namespace exegesis {
18
19// A collection of instructions that are to be assembled, executed and measured.
20struct 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 Chatelet937f3fe2018-09-18 11:26:48 +000026 std::vector<RegisterValue> RegisterInitialValues;
Clement Courbetd939f6d2018-09-13 07:40:53 +000027
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