CIRCT 22.0.0git
Loading...
Searching...
No Matches
SynthOps.h
Go to the documentation of this file.
1//===----------------------------------------------------------------------===//
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 defines the operations of the Synth dialect.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef CIRCT_DIALECT_SYNTH_SYNTHOPS_H
14#define CIRCT_DIALECT_SYNTH_SYNTHOPS_H
15
17#include "circt/Support/LLVM.h"
18#include "mlir/IR/Attributes.h"
19#include "mlir/IR/Builders.h"
20#include "mlir/IR/BuiltinOps.h"
21#include "mlir/IR/BuiltinTypes.h"
22#include "mlir/IR/Dialect.h"
23#include "mlir/IR/Operation.h"
24#include "mlir/Interfaces/InferTypeOpInterface.h"
25#include "mlir/Interfaces/SideEffectInterfaces.h"
26#include "mlir/Rewrite/PatternApplicator.h"
27
28#define GET_OP_CLASSES
29#include "circt/Dialect/Synth/Synth.h.inc"
30
31namespace circt {
32namespace synth {
34 : mlir::OpRewritePattern<aig::AndInverterOp> {
35 using OpRewritePattern<aig::AndInverterOp>::OpRewritePattern;
36 mlir::LogicalResult
37 matchAndRewrite(aig::AndInverterOp op,
38 mlir::PatternRewriter &rewriter) const override;
39};
40
41/// This function performs a topological sort on the operations within each
42/// block of graph regions in the given operation. It uses MLIR's topological
43/// sort utility as a wrapper, ensuring that operations are ordered such that
44/// all operands are defined before their uses. The `isOperandReady` callback
45/// allows customization of when an operand is considered ready for sorting.
47 mlir::Operation *op,
48 llvm::function_ref<bool(mlir::Value, mlir::Operation *)> isOperandReady);
49
50} // namespace synth
51} // namespace circt
52
53#endif // CIRCT_DIALECT_SYNTH_SYNTHOPS_H
LogicalResult topologicallySortGraphRegionBlocks(mlir::Operation *op, llvm::function_ref< bool(mlir::Value, mlir::Operation *)> isOperandReady)
This function performs a topological sort on the operations within each block of graph regions in the...
Definition SynthOps.cpp:307
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
Definition synth.py:1
mlir::LogicalResult matchAndRewrite(aig::AndInverterOp op, mlir::PatternRewriter &rewriter) const override
Definition SynthOps.cpp:295