BenchmarkCode.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. #ifndef LLVM_TOOLS_LLVM_EXEGESIS_BENCHMARKCODE_H
  10. #define LLVM_TOOLS_LLVM_EXEGESIS_BENCHMARKCODE_H
  11. #include "RegisterValue.h"
  12. #include "llvm/MC/MCInst.h"
  13. #include <string>
  14. #include <vector>
  15. namespace llvm {
  16. namespace exegesis {
  17. // A collection of instructions that are to be assembled, executed and measured.
  18. struct BenchmarkCode {
  19. // The sequence of instructions that are to be repeated.
  20. std::vector<llvm::MCInst> Instructions;
  21. // Before the code is executed some instructions are added to setup the
  22. // registers initial values.
  23. std::vector<RegisterValue> RegisterInitialValues;
  24. // Before the code is executed some instructions are added to copy the
  25. // scratch register into the specified registers.
  26. std::vector<unsigned> ScratchRegisterCopies;
  27. // We also need to provide the registers that are live on entry for the
  28. // assembler to generate proper prologue/epilogue.
  29. std::vector<unsigned> LiveIns;
  30. // Informations about how this configuration was built.
  31. std::string Info;
  32. };
  33. } // namespace exegesis
  34. } // namespace llvm
  35. #endif // LLVM_TOOLS_LLVM_EXEGESIS_BENCHMARKCODE_H