Scratch(Scratch) {}
private:
- Expected<int64_t> runAndMeasure(const char *Counters) const override {
- auto ResultOrError = runAndSample(Counters);
- if (ResultOrError)
- return ResultOrError.get()[0];
- return ResultOrError.takeError();
- }
-
static void
accumulateCounterValues(const llvm::SmallVector<int64_t, 4> &NewValues,
llvm::SmallVector<int64_t, 4> *Result) {
class FunctionExecutor {
public:
virtual ~FunctionExecutor();
- // FIXME deprecate this.
- virtual Expected<int64_t> runAndMeasure(const char *Counters) const = 0;
virtual Expected<llvm::SmallVector<int64_t, 4>>
runAndSample(const char *Counters) const = 0;
IssueCounter != IssueCounterEnd; ++IssueCounter) {
if (!IssueCounter->Counter)
continue;
- auto ExpectedCounterValue = Executor.runAndMeasure(IssueCounter->Counter);
+ auto ExpectedCounterValue = Executor.runAndSample(IssueCounter->Counter);
if (!ExpectedCounterValue)
return ExpectedCounterValue.takeError();
Result.push_back(BenchmarkMeasure::Create(IssueCounter->ProcResName,
- *ExpectedCounterValue));
+ (*ExpectedCounterValue)[0]));
}
// NumMicroOps.
if (const char *const UopsCounter = PCI.UopsCounter) {
- auto ExpectedCounterValue = Executor.runAndMeasure(UopsCounter);
+ auto ExpectedCounterValue = Executor.runAndSample(UopsCounter);
if (!ExpectedCounterValue)
return ExpectedCounterValue.takeError();
Result.push_back(
- BenchmarkMeasure::Create("NumMicroOps", *ExpectedCounterValue));
+ BenchmarkMeasure::Create("NumMicroOps", (*ExpectedCounterValue)[0]));
}
return std::move(Result);
}