MLIR  21.0.0git
Passes.h
Go to the documentation of this file.
1 //===- Passes.h - Pass Entrypoints ------------------------------*- 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 header file defines prototypes that expose pass constructors in the
10 // shape transformation library.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef MLIR_DIALECT_SHAPE_TRANSFORMS_PASSES_H_
15 #define MLIR_DIALECT_SHAPE_TRANSFORMS_PASSES_H_
16 
17 #include "mlir/Pass/Pass.h"
18 
19 namespace mlir {
20 class ConversionTarget;
21 class ModuleOp;
22 class TypeConverter;
23 namespace func {
24 class FuncOp;
25 } // namespace func
26 } // namespace mlir
27 
28 namespace mlir {
29 
30 #define GEN_PASS_DECL
31 #include "mlir/Dialect/Shape/Transforms/Passes.h.inc"
32 
33 /// Collects a set of patterns to rewrite ops within the Shape dialect.
34 void populateShapeRewritePatterns(RewritePatternSet &patterns);
35 
36 // Collects a set of patterns to replace all constraints with passing witnesses.
37 // This is intended to then allow all ShapeConstraint related ops and data to
38 // have no effects and allow them to be freely removed such as through
39 // canonicalization and dead code elimination.
40 //
41 // After this pass, no cstr_ operations exist.
42 void populateRemoveShapeConstraintsPatterns(RewritePatternSet &patterns);
43 
44 //===----------------------------------------------------------------------===//
45 // Registration
46 //===----------------------------------------------------------------------===//
47 
48 /// Generate the code for registering passes.
49 #define GEN_PASS_REGISTRATION
50 #include "mlir/Dialect/Shape/Transforms/Passes.h.inc"
51 
52 } // namespace mlir
53 
54 #endif // MLIR_DIALECT_SHAPE_TRANSFORMS_PASSES_H_
Include the generated interface declarations.
void populateShapeRewritePatterns(RewritePatternSet &patterns)
Collects a set of patterns to rewrite ops within the Shape dialect.
const FrozenRewritePatternSet & patterns
void populateRemoveShapeConstraintsPatterns(RewritePatternSet &patterns)