CIRCT 20.0.0git
Loading...
Searching...
No Matches
PassDetails.h
Go to the documentation of this file.
1//===- PassDetails.h - MSFT pass class details ------------------*- 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// Stuff shared between the different MSFT passes.
10//
11//===----------------------------------------------------------------------===//
12
13// clang-tidy seems to expect the absolute path in the header guard on some
14// systems, so just disable it.
15// NOLINTNEXTLINE(llvm-header-guard)
16#ifndef DIALECT_MSFT_TRANSFORMS_PASSDETAILS_H
17#define DIALECT_MSFT_TRANSFORMS_PASSDETAILS_H
18
24#include "mlir/Pass/Pass.h"
25#include "mlir/Transforms/DialectConversion.h"
26
27namespace circt {
28namespace msft {
29
30/// Utility for creating {0, 1, 2, ..., size}.
31SmallVector<unsigned> makeSequentialRange(unsigned size);
32
33/// Try to get a "good" name for the given Value.
34StringRef getValueName(Value v, const SymbolCache &syms, std::string &buff);
35
36/// Generic pattern for removing an op during pattern conversion.
37template <typename OpTy>
39 using OpConversionPattern<OpTy>::OpConversionPattern;
41
42 LogicalResult
43 matchAndRewrite(OpTy op, OpAdaptor adaptor,
44 ConversionPatternRewriter &rewriter) const final {
45 rewriter.eraseOp(op);
46 return success();
47 }
48};
49
50} // namespace msft
51} // namespace circt
52
53#endif // DIALECT_MSFT_TRANSFORMS_PASSDETAILS_H
StringRef getValueName(Value v, const SymbolCache &syms, std::string &buff)
Try to get a "good" name for the given Value.
SmallVector< unsigned > makeSequentialRange(unsigned size)
Utility for creating {0, 1, 2, ..., size}.
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
Definition msft.py:1
Generic pattern for removing an op during pattern conversion.
Definition PassDetails.h:38
typename OpConversionPattern< OpTy >::OpAdaptor OpAdaptor
Definition PassDetails.h:40
LogicalResult matchAndRewrite(OpTy op, OpAdaptor adaptor, ConversionPatternRewriter &rewriter) const final
Definition PassDetails.h:43