[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
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 @@
// 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 @@
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