CIRCT 20.0.0git
Loading...
Searching...
No Matches
ArcInterfaces.h
Go to the documentation of this file.
1//===- ArcInterfaces.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// This file provides registration functions for all external interfaces.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef CIRCT_DIALECT_ARC_ARCINTERFACES_H
14#define CIRCT_DIALECT_ARC_ARCINTERFACES_H
15
16#include "mlir/IR/DialectInterface.h"
17
18// Forward declarations.
19namespace mlir {
20class DialectRegistry;
21} // namespace mlir
22
23namespace circt {
24namespace arc {
25
26void registerCombRuntimeCostEstimateInterface(mlir::DialectRegistry &registry);
27void registerHWRuntimeCostEstimateInterface(mlir::DialectRegistry &registry);
28void registerSCFRuntimeCostEstimateInterface(mlir::DialectRegistry &registry);
29
30inline void initAllExternalInterfaces(mlir::DialectRegistry &registry) {
34}
35
36/// A dialect interface to get runtime cost estimates of MLIR operations. This
37/// is useful for implementing heuristics in optimization passes.
39 : public mlir::DialectInterface::Base<RuntimeCostEstimateDialectInterface> {
40public:
41 RuntimeCostEstimateDialectInterface(mlir::Dialect *dialect) : Base(dialect) {}
42
43 /// Returns a number indicating the expected number of cycles the given
44 /// operation will take to execute on hardware times 10 (to allow a bit more
45 /// fine tuning for high-throughput operations)
46 virtual uint32_t getCostEstimate(mlir::Operation *op) const = 0;
47};
48
49} // namespace arc
50} // namespace circt
51
52#endif // CIRCT_DIALECT_ARC_ARCINTERFACES_H
A dialect interface to get runtime cost estimates of MLIR operations.
virtual uint32_t getCostEstimate(mlir::Operation *op) const =0
Returns a number indicating the expected number of cycles the given operation will take to execute on...
RuntimeCostEstimateDialectInterface(mlir::Dialect *dialect)
void initAllExternalInterfaces(mlir::DialectRegistry &registry)
void registerCombRuntimeCostEstimateInterface(mlir::DialectRegistry &registry)
void registerSCFRuntimeCostEstimateInterface(mlir::DialectRegistry &registry)
void registerHWRuntimeCostEstimateInterface(mlir::DialectRegistry &registry)
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.