aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp
diff options
context:
space:
mode:
authorClement Courbet <courbet@google.com>2018-09-26 08:37:21 +0000
committerClement Courbet <courbet@google.com>2018-09-26 08:37:21 +0000
commit684a5f675380ad3e97fbb9b6e6858ee2348f85b3 (patch)
treeab9c1cecf65cca691bda95a5b312a2ed27179708 /llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp
parentcc525e7b8d62231c3825630a4c1e384031d7b41d (diff)
downloadllvm-684a5f675380ad3e97fbb9b6e6858ee2348f85b3.zip
llvm-684a5f675380ad3e97fbb9b6e6858ee2348f85b3.tar.gz
llvm-684a5f675380ad3e97fbb9b6e6858ee2348f85b3.tar.bz2
[llvm-exegesis] Output the unscaled value as well as the scaled one.
Summary: See PR38936 for context. Reviewers: gchatelet Subscribers: tschuett, llvm-commits Differential Revision: https://reviews.llvm.org/D52500 llvm-svn: 343081
Diffstat (limited to 'llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp')
-rw-r--r--llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp b/llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp
index 9a41114..1748c53 100644
--- a/llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp
+++ b/llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp
@@ -164,9 +164,10 @@ template <> struct SequenceElementTraits<exegesis::BenchmarkMeasure> {
// e.g. { "key": "the key", "value": 0123 }
template <> struct MappingTraits<exegesis::BenchmarkMeasure> {
static void mapping(IO &Io, exegesis::BenchmarkMeasure &Obj) {
- Io.mapRequired("key", Obj.Key);
- Io.mapRequired("value", Obj.Value);
Io.mapOptional("debug_string", Obj.DebugString);
+ Io.mapRequired("value", Obj.PerInstructionValue);
+ Io.mapOptional("per_snippet_value", Obj.PerSnippetValue);
+ Io.mapRequired("key", Obj.Key);
}
static const bool flow = true;
};
@@ -345,14 +346,14 @@ llvm::Error InstructionBenchmark::writeYaml(const LLVMState &State,
return llvm::Error::success();
}
-void BenchmarkMeasureStats::push(const BenchmarkMeasure &BM) {
+void PerInstructionStats::push(const BenchmarkMeasure &BM) {
if (Key.empty())
Key = BM.Key;
assert(Key == BM.Key);
++NumValues;
- SumValues += BM.Value;
- MaxValue = std::max(MaxValue, BM.Value);
- MinValue = std::min(MinValue, BM.Value);
+ SumValues += BM.PerInstructionValue;
+ MaxValue = std::max(MaxValue, BM.PerInstructionValue);
+ MinValue = std::min(MinValue, BM.PerInstructionValue);
}
} // namespace exegesis