[llvm] [Exegesis] Add supports to serialize/deserialize object files into benchmarks (PR #121993)
Min-Yih Hsu via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 13 12:10:15 PST 2025
================
@@ -654,12 +669,54 @@ BenchmarkRunner::getRunnableConfiguration(
LoopBodySize, GenerateMemoryInstructions);
if (Error E = Snippet.takeError())
return std::move(E);
+ // There is no need to serialize/deserialize the object file if we're
+ // simply running end-to-end measurements.
+ // Same goes for any repetition mode that requires more than a single
+ // snippet.
+ if (BenchmarkPhaseSelector < BenchmarkPhaseSelectorE::Measure &&
+ (RepetitionMode == Benchmark::Loop ||
----------------
mshockwave wrote:
> Is it significantly more complicated to support the other repetition modes?
Sort of. Take `--repetition-mode=min` which requires two snippets as an example, there are two ways to do it:
1. Store both the `loop` and `duplicate` snippets in the same benchmark YAML record. In this case we also have to store the repetition mode but more importantly, we either have to "re-split" each benchmark record into their own benchmark instances, or teach both the benchmark runner and result aggregator about this.
2. Store the `loop` and `duplicate` snippets in separate benchmark YAML records. In this case we might need to figure out which of these benchmarks belong to the same "group" (same opcode and same configuration).
Option (2) would probably be easier, but even that I think it will make this patch too big. So I rather add this feature incrementally.
https://github.com/llvm/llvm-project/pull/121993
More information about the llvm-commits
mailing list