[MLIR] Introduce applyOpPatternsAndFold for op local rewrites
authorUday Bondhugula <uday@polymagelabs.com>
Sun, 5 Apr 2020 02:40:33 +0000 (08:10 +0530)
committerUday Bondhugula <uday@polymagelabs.com>
Wed, 15 Apr 2020 08:40:01 +0000 (14:10 +0530)
commit04b5274ede3ebc1de98c47e34cb762bae474696b
treedf2d5f627f9c54c8640d4335bca393e7ee82dd60
parentbd47c470d13b1c57ecf37c1faf0324833d3a4542
[MLIR] Introduce applyOpPatternsAndFold for op local rewrites

Introduce mlir::applyOpPatternsAndFold which applies patterns as well as
any folding only on a specified op (in contrast to
applyPatternsAndFoldGreedily which applies patterns only on the regions
of an op isolated from above).  The caller is made aware of the op being
folded away or erased.

Depends on D77485.

Differential Revision: https://reviews.llvm.org/D77487
mlir/include/mlir/IR/PatternMatch.h
mlir/lib/Dialect/Affine/Transforms/AffineDataCopyGeneration.cpp
mlir/lib/Dialect/Affine/Transforms/SimplifyAffineStructures.cpp
mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp
mlir/lib/Transforms/Utils/LoopUtils.cpp
mlir/test/Dialect/Affine/affine-data-copy.mlir
mlir/test/Dialect/Affine/simplify-affine-structures.mlir
mlir/test/lib/Dialect/Affine/TestAffineDataCopy.cpp