llvm-project/mlir/test/lib/Transforms
Matthias Springer 9bdfa8df0d [mlir][IR] Use Listener for IR callbacks in OperationFolder
Remove the IR modification callbacks from `OperationFolder`. Instead, an optional `RewriterBase::Listener` can be specified.
* `processGeneratedConstants` => `notifyOperationCreated`
* `preReplaceAction` => `notifyOperationReplaced`

This simplifies the GreedyPatternRewriterDriver because we no longer need special handling for IR modifications due to op folding.

A folded operation is now enqueued on the GreedyPatternRewriteDriver's worklist if it was modified in-place. (There may be new patterns that apply after folding.)

Also fixes a bug in `TestOpInPlaceFold::fold`. The folder could previously be applied over and over and did not return a "null" OpFoldResult if the IR was not modified. (This is similar to a pattern that returns `success` without modifying IR; it can trigger an infinite loop in the GreedyPatternRewriteDriver.)

Differential Revision: https://reviews.llvm.org/D144463
2023-02-23 08:56:43 +01:00
..
CMakeLists.txt
lit.local.cfg
TestCommutativityUtils.cpp
TestConstantFold.cpp [mlir][IR] Use Listener for IR callbacks in OperationFolder 2023-02-23 08:56:43 +01:00
TestControlFlowSink.cpp
TestDialectConversion.cpp mlir/DialectConversion: use std::optional (NFC) 2022-12-19 18:48:59 +01:00
TestDialectConversion.pdll [mlir:PDLL] Don't require users to provide operands/results when all are variadic 2022-11-08 01:57:58 -08:00
TestInlining.cpp [mlir] Add operations to BlockAndValueMapping and rename it to IRMapping 2023-01-12 13:16:05 -08:00
TestIntRangeInference.cpp [mlir] Use std::optional instead of llvm::Optional (NFC) 2023-01-14 01:25:58 -08:00
TestTopologicalSort.cpp