17 #define GEN_PASS_DEF_REMOVESHAPECONSTRAINTS
18 #include "mlir/Dialect/Shape/Transforms/Passes.h.inc"
25 class RemoveCstrBroadcastableOp
30 LogicalResult matchAndRewrite(shape::CstrBroadcastableOp op,
41 LogicalResult matchAndRewrite(shape::CstrEqOp op,
49 class RemoveShapeConstraintsPass
50 :
public impl::RemoveShapeConstraintsBase<RemoveShapeConstraintsPass> {
52 void runOnOperation()
override {
65 patterns.
add<RemoveCstrBroadcastableOp, RemoveCstrEqOp>(
69 std::unique_ptr<OperationPass<func::FuncOp>>
71 return std::make_unique<RemoveShapeConstraintsPass>();
static MLIRContext * getContext(OpFoldResult val)
MLIRContext is the top-level object for a collection of MLIR operations.
A special type of RewriterBase that coordinates the application of a rewrite pattern on the current I...
MLIRContext * getContext() const
RewritePatternSet & add(ConstructorArg &&arg, ConstructorArgs &&...args)
Add an instance of each of the pattern types 'Ts' to the pattern list with the given arguments.
OpTy replaceOpWithNewOp(Operation *op, Args &&...args)
Replace the results of the given (original) op with a new op that is created without verification (re...
Include the generated interface declarations.
LogicalResult applyPatternsAndFoldGreedily(Region ®ion, const FrozenRewritePatternSet &patterns, GreedyRewriteConfig config=GreedyRewriteConfig(), bool *changed=nullptr)
Rewrite ops in the given region, which must be isolated from above, by repeatedly applying the highes...
void populateRemoveShapeConstraintsPatterns(RewritePatternSet &patterns)
std::unique_ptr< OperationPass< func::FuncOp > > createRemoveShapeConstraintsPass()
OpRewritePattern is a wrapper around RewritePattern that allows for matching and rewriting against an...
OpRewritePattern(MLIRContext *context, PatternBenefit benefit=1, ArrayRef< StringRef > generatedNames={})
Patterns must specify the root operation name they match against, and can also specify the benefit of...