LatencyBenchmarkRunner.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. //===-- LatencyBenchmarkRunner.h --------------------------------*- C++ -*-===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. ///
  9. /// \file
  10. /// A BenchmarkRunner implementation to measure instruction latencies.
  11. ///
  12. //===----------------------------------------------------------------------===//
  13. #ifndef LLVM_TOOLS_LLVM_EXEGESIS_LATENCY_H
  14. #define LLVM_TOOLS_LLVM_EXEGESIS_LATENCY_H
  15. #include "BenchmarkRunner.h"
  16. namespace llvm {
  17. namespace exegesis {
  18. class LatencyBenchmarkRunner : public BenchmarkRunner {
  19. public:
  20. LatencyBenchmarkRunner(
  21. const LLVMState &State, InstructionBenchmark::ModeE Mode,
  22. BenchmarkPhaseSelectorE BenchmarkPhaseSelector,
  23. InstructionBenchmark::ResultAggregationModeE ResultAggMode);
  24. ~LatencyBenchmarkRunner() override;
  25. private:
  26. Expected<std::vector<BenchmarkMeasure>>
  27. runMeasurements(const FunctionExecutor &Executor) const override;
  28. InstructionBenchmark::ResultAggregationModeE ResultAggMode;
  29. };
  30. } // namespace exegesis
  31. } // namespace llvm
  32. #endif // LLVM_TOOLS_LLVM_EXEGESIS_LATENCY_H