[llvm-exegesis] move Mode from Key to BenchmarResult.
Moves the Mode field out of the Key. The existing yaml benchmark results can be fixed with the following script:
```
readonly FILE=$1
readonly MODE=latency # Change to uops to fix a uops benchmark.
cat $FILE | \
sed "/^\ \+mode:\ \+$MODE$/d" | \
sed "/^cpu_name.*$/i mode: $MODE"
```
Differential Revision: https://reviews.llvm.org/D47813
Authored by: Guillaume Chatelet
llvm-svn: 334079
diff --git a/llvm/unittests/tools/llvm-exegesis/BenchmarkResultTest.cpp b/llvm/unittests/tools/llvm-exegesis/BenchmarkResultTest.cpp
index 2c12c82..181b5af 100644
--- a/llvm/unittests/tools/llvm-exegesis/BenchmarkResultTest.cpp
+++ b/llvm/unittests/tools/llvm-exegesis/BenchmarkResultTest.cpp
@@ -45,8 +45,8 @@
ToDisk.Key.OpcodeName = "name";
ToDisk.Key.Instructions.push_back(llvm::MCInstBuilder(kInstrId));
- ToDisk.Key.Mode = InstructionBenchmarkKey::Latency;
ToDisk.Key.Config = "config";
+ ToDisk.Mode = InstructionBenchmark::Latency;
ToDisk.CpuName = "cpu_name";
ToDisk.LLVMTriple = "llvm_triple";
ToDisk.NumRepetitions = 1;
@@ -69,8 +69,8 @@
EXPECT_EQ(FromDisk.Key.OpcodeName, ToDisk.Key.OpcodeName);
EXPECT_THAT(FromDisk.Key.Instructions,
Pointwise(EqMCInst(), ToDisk.Key.Instructions));
- EXPECT_EQ(FromDisk.Key.Mode, ToDisk.Key.Mode);
EXPECT_EQ(FromDisk.Key.Config, ToDisk.Key.Config);
+ EXPECT_EQ(FromDisk.Mode, ToDisk.Mode);
EXPECT_EQ(FromDisk.CpuName, ToDisk.CpuName);
EXPECT_EQ(FromDisk.LLVMTriple, ToDisk.LLVMTriple);
EXPECT_EQ(FromDisk.NumRepetitions, ToDisk.NumRepetitions);
@@ -87,8 +87,8 @@
EXPECT_EQ(FromDisk.Key.OpcodeName, ToDisk.Key.OpcodeName);
EXPECT_THAT(FromDisk.Key.Instructions,
Pointwise(EqMCInst(), ToDisk.Key.Instructions));
- EXPECT_EQ(FromDisk.Key.Mode, ToDisk.Key.Mode);
EXPECT_EQ(FromDisk.Key.Config, ToDisk.Key.Config);
+ EXPECT_EQ(FromDisk.Mode, ToDisk.Mode);
EXPECT_EQ(FromDisk.CpuName, ToDisk.CpuName);
EXPECT_EQ(FromDisk.LLVMTriple, ToDisk.LLVMTriple);
EXPECT_EQ(FromDisk.NumRepetitions, ToDisk.NumRepetitions);