MLIR  22.0.0git
PatternLoggingListener.cpp
Go to the documentation of this file.
1 #include "mlir/IR/PatternMatch.h"
2 #include "llvm/Support/DebugLog.h"
3 
4 #define DEBUG_TYPE "pattern-logging-listener"
5 
6 using namespace mlir;
7 
9  Operation *op, InsertPoint previous) {
10  LDBG() << patternName << " | notifyOperationInserted"
11  << " | " << op->getName();
13 }
14 
16  Operation *op) {
17  LDBG() << patternName << " | notifyOperationModified"
18  << " | " << op->getName();
20 }
21 
23  Operation *op, Operation *newOp) {
24  LDBG() << patternName << " | notifyOperationReplaced (with op)"
25  << " | " << op->getName() << " | " << newOp->getName();
27 }
28 
30  Operation *op, ValueRange replacement) {
31  LDBG() << patternName << " | notifyOperationReplaced (with values)"
32  << " | " << op->getName();
34 }
35 
37  Operation *op) {
38  LDBG() << patternName << " | notifyOperationErased"
39  << " | " << op->getName();
41 }
42 
44  const Pattern &pattern, Operation *op) {
45  LDBG() << patternName << " | notifyPatternBegin"
46  << " | " << op->getName();
48 }
This class represents a saved insertion point.
Definition: Builders.h:325
Operation is the basic unit of execution within MLIR.
Definition: Operation.h:88
OperationName getName()
The name of an operation is the key identifier for it.
Definition: Operation.h:119
This class contains all of the data related to a pattern, but does not contain any methods or logic f...
Definition: PatternMatch.h:73
This class provides an abstraction over the different types of ranges over Values.
Definition: ValueRange.h:387
Include the generated interface declarations.
void notifyOperationInserted(Operation *op, InsertPoint previous) override
Notify the listener that the specified operation was inserted.
Definition: PatternMatch.h:427
void notifyOperationModified(Operation *op) override
Notify the listener that the specified operation was modified in-place.
Definition: PatternMatch.h:440
void notifyPatternBegin(const Pattern &pattern, Operation *op) override
Notify the listener that the specified pattern is about to be applied at the specified root operation...
Definition: PatternMatch.h:457
void notifyOperationReplaced(Operation *op, Operation *newOp) override
Notify the listener that all uses of the specified operation's results are about to be replaced with ...
Definition: PatternMatch.h:444
void notifyOperationErased(Operation *op) override
Notify the listener that the specified operation is about to be erased.
Definition: PatternMatch.h:453
void notifyOperationModified(Operation *op) override
Notify the listener that the specified operation was modified in-place.
void notifyOperationErased(Operation *op) override
Notify the listener that the specified operation is about to be erased.
void notifyOperationReplaced(Operation *op, Operation *newOp) override
Notify the listener that all uses of the specified operation's results are about to be replaced with ...
void notifyOperationInserted(Operation *op, InsertPoint previous) override
Notify the listener that the specified operation was inserted.
void notifyPatternBegin(const Pattern &pattern, Operation *op) override
Notify the listener that the specified pattern is about to be applied at the specified root operation...