summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-exegesis/lib/BenchmarkCode.h
diff options
context:
space:
mode:
authorClement Courbet <courbet@google.com>2018-09-25 07:31:44 +0000
committerClement Courbet <courbet@google.com>2018-09-25 07:31:44 +0000
commit78b2e73d1514e3bb7a729355f32fc63047efa13d (patch)
treea5e8c9f8506c9b38aba4771c5ee28cf2b1093f56 /llvm/tools/llvm-exegesis/lib/BenchmarkCode.h
parent90e7ff804508e33cd684a62c58fb31f6901601d9 (diff)
downloadbcm5719-llvm-78b2e73d1514e3bb7a729355f32fc63047efa13d.tar.gz
bcm5719-llvm-78b2e73d1514e3bb7a729355f32fc63047efa13d.zip
[llvm-exegesis] Allow benchmarking arbitrary code snippets.
Summary: This is a step towards fixing PR38048. Note that right now the measurements are given per instruction. We'll need to give measurements a per code snippet and update the analysis (PR38731). Reviewers: gchatelet Subscribers: tschuett, llvm-commits Differential Revision: https://reviews.llvm.org/D52041 llvm-svn: 342947
Diffstat (limited to 'llvm/tools/llvm-exegesis/lib/BenchmarkCode.h')
-rw-r--r--llvm/tools/llvm-exegesis/lib/BenchmarkCode.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/tools/llvm-exegesis/lib/BenchmarkCode.h b/llvm/tools/llvm-exegesis/lib/BenchmarkCode.h
index 03708683106..f0032555546 100644
--- a/llvm/tools/llvm-exegesis/lib/BenchmarkCode.h
+++ b/llvm/tools/llvm-exegesis/lib/BenchmarkCode.h
@@ -10,12 +10,19 @@
#ifndef LLVM_TOOLS_LLVM_EXEGESIS_BENCHMARKCODE_H
#define LLVM_TOOLS_LLVM_EXEGESIS_BENCHMARKCODE_H
+#include "llvm/ADT/APInt.h"
#include "llvm/MC/MCInst.h"
#include <string>
#include <vector>
namespace exegesis {
+// A simple object storing the value for a particular register.
+struct RegisterValue {
+ unsigned Register;
+ llvm::APInt Value;
+};
+
// A collection of instructions that are to be assembled, executed and measured.
struct BenchmarkCode {
// The sequence of instructions that are to be repeated.
OpenPOWER on IntegriCloud