[llvm-exegesis] Make BenchmarkRunner handle multiple configurations.

Summary: BenchmarkRunner subclasses can now create many configurations - although this patch still generates one.

Reviewers: courbet

Subscribers: tschuett, llvm-commits

Differential Revision: https://reviews.llvm.org/D47877

llvm-svn: 334197
diff --git a/llvm/tools/llvm-exegesis/llvm-exegesis.cpp b/llvm/tools/llvm-exegesis/llvm-exegesis.cpp
index e59843b..47f2dd9 100644
--- a/llvm/tools/llvm-exegesis/llvm-exegesis.cpp
+++ b/llvm/tools/llvm-exegesis/llvm-exegesis.cpp
@@ -144,9 +144,12 @@
   if (BenchmarkFile.empty())
     BenchmarkFile = "-";
 
-  ExitOnErr(
-      Runner->run(GetOpcodeOrDie(State.getInstrInfo()), Filter, NumRepetitions)
-          .writeYaml(getBenchmarkResultContext(State), BenchmarkFile));
+  const BenchmarkResultContext Context = getBenchmarkResultContext(State);
+  std::vector<InstructionBenchmark> Results = ExitOnErr(Runner->run(
+      GetOpcodeOrDie(State.getInstrInfo()), Filter, NumRepetitions));
+  for (InstructionBenchmark &Result : Results)
+    Result.writeYaml(Context, BenchmarkFile);
+
   exegesis::pfm::pfmTerminate();
 }