diff --git a/libc/benchmarks/automemcpy/lib/ResultAnalyzerMain.cpp b/libc/benchmarks/automemcpy/lib/ResultAnalyzerMain.cpp --- a/libc/benchmarks/automemcpy/lib/ResultAnalyzerMain.cpp +++ b/libc/benchmarks/automemcpy/lib/ResultAnalyzerMain.cpp @@ -20,6 +20,11 @@ static cl::list InputFilenames(cl::Positional, cl::OneOrMore, cl::desc("")); +// User can filter the distributions to be taken into account. +static cl::list FilterDistributions( + "filter-distributions", cl::ZeroOrMore, + cl::desc("")); + namespace automemcpy { // This is defined in the autogenerated 'Implementations.cpp' file. @@ -121,6 +126,15 @@ llvm::append_range(Samples, Result.Samples); } + if (!FilterDistributions.empty()) { + llvm::StringSet<> ValidDistributions; + ValidDistributions.insert(FilterDistributions.begin(), + FilterDistributions.end()); + llvm::erase_if(Samples, [&ValidDistributions](const Sample &S) { + return !ValidDistributions.contains(S.Id.Distribution.Name); + }); + } + // Extracts median of throughputs. std::vector Functions = getThroughputs(Samples); fillScores(Functions);