1 //===-- BenchmarkResult.h ---------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 /// Defines classes to represent measurements and serialize/deserialize them to
14 //===----------------------------------------------------------------------===//
16 #ifndef LLVM_TOOLS_LLVM_EXEGESIS_BENCHMARKRESULT_H
17 #define LLVM_TOOLS_LLVM_EXEGESIS_BENCHMARKRESULT_H
19 #include "llvm/ADT/StringRef.h"
20 #include "llvm/Support/YAMLTraits.h"
30 struct BenchmarkMeasure {
33 std::string DebugString;
36 // The result of an instruction benchmark.
37 struct InstructionBenchmark {
40 std::string LLVMTriple;
41 size_t NumRepetitions = 0;
42 std::vector<BenchmarkMeasure> Measurements;
45 static InstructionBenchmark readYamlOrDie(llvm::StringRef Filename);
47 // Unfortunately this function is non const because of YAML traits.
48 void writeYamlOrDie(const llvm::StringRef Filename);
51 } // namespace exegesis
53 #endif // LLVM_TOOLS_LLVM_EXEGESIS_BENCHMARKRESULT_H