mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 11:13:28 +01:00
882cd9ac82
Summary: Functional No Op. Reviewers: gchatelet Subscribers: tschuett, courbet, llvm-commits Differential Revision: https://reviews.llvm.org/D50231 llvm-svn: 338836
48 lines
1.4 KiB
C++
48 lines
1.4 KiB
C++
//===-- Latency.h -----------------------------------------------*- C++ -*-===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
///
|
|
/// \file
|
|
/// A BenchmarkRunner implementation to measure instruction latencies.
|
|
///
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLVM_TOOLS_LLVM_EXEGESIS_LATENCY_H
|
|
#define LLVM_TOOLS_LLVM_EXEGESIS_LATENCY_H
|
|
|
|
#include "BenchmarkRunner.h"
|
|
#include "MCInstrDescView.h"
|
|
|
|
namespace exegesis {
|
|
|
|
class LatencyBenchmarkRunner : public BenchmarkRunner {
|
|
public:
|
|
LatencyBenchmarkRunner(const LLVMState &State)
|
|
: BenchmarkRunner(State, InstructionBenchmark::Latency) {}
|
|
~LatencyBenchmarkRunner() override;
|
|
|
|
llvm::Expected<CodeTemplate>
|
|
generateCodeTemplate(unsigned Opcode) const override;
|
|
|
|
private:
|
|
llvm::Error isInfeasible(const llvm::MCInstrDesc &MCInstrDesc) const;
|
|
|
|
llvm::Expected<CodeTemplate>
|
|
generateTwoInstructionPrototype(const Instruction &Instr) const;
|
|
|
|
std::vector<BenchmarkMeasure>
|
|
runMeasurements(const ExecutableFunction &EF, ScratchSpace &Scratch,
|
|
const unsigned NumRepetitions) const override;
|
|
|
|
virtual const char *getCounterName() const;
|
|
};
|
|
|
|
} // namespace exegesis
|
|
|
|
#endif // LLVM_TOOLS_LLVM_EXEGESIS_LATENCY_H
|