Skip to content

Commit 2f8c926

Browse files
authored
[MLIR] Migrate PatternLoggingListener to the standard LDBG output (#150686)
1 parent fd65b20 commit 2f8c926

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed
Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,48 @@
11
#include "mlir/IR/PatternMatch.h"
2-
#include "llvm/Support/Debug.h"
2+
#include "llvm/Support/DebugLog.h"
33

44
#define DEBUG_TYPE "pattern-logging-listener"
5-
#define DBGS() (llvm::dbgs() << "[" << DEBUG_TYPE << "] ")
6-
#define LDBG(X) LLVM_DEBUG(DBGS() << X << "\n")
75

86
using namespace mlir;
97

108
void RewriterBase::PatternLoggingListener::notifyOperationInserted(
119
Operation *op, InsertPoint previous) {
12-
LDBG(patternName << " | notifyOperationInserted"
13-
<< " | " << op->getName());
10+
LDBG() << patternName << " | notifyOperationInserted"
11+
<< " | " << op->getName();
1412
ForwardingListener::notifyOperationInserted(op, previous);
1513
}
1614

1715
void RewriterBase::PatternLoggingListener::notifyOperationModified(
1816
Operation *op) {
19-
LDBG(patternName << " | notifyOperationModified"
20-
<< " | " << op->getName());
17+
LDBG() << patternName << " | notifyOperationModified"
18+
<< " | " << op->getName();
2119
ForwardingListener::notifyOperationModified(op);
2220
}
2321

2422
void RewriterBase::PatternLoggingListener::notifyOperationReplaced(
2523
Operation *op, Operation *newOp) {
26-
LDBG(patternName << " | notifyOperationReplaced (with op)"
27-
<< " | " << op->getName() << " | " << newOp->getName());
24+
LDBG() << patternName << " | notifyOperationReplaced (with op)"
25+
<< " | " << op->getName() << " | " << newOp->getName();
2826
ForwardingListener::notifyOperationReplaced(op, newOp);
2927
}
3028

3129
void RewriterBase::PatternLoggingListener::notifyOperationReplaced(
3230
Operation *op, ValueRange replacement) {
33-
LDBG(patternName << " | notifyOperationReplaced (with values)"
34-
<< " | " << op->getName());
31+
LDBG() << patternName << " | notifyOperationReplaced (with values)"
32+
<< " | " << op->getName();
3533
ForwardingListener::notifyOperationReplaced(op, replacement);
3634
}
3735

3836
void RewriterBase::PatternLoggingListener::notifyOperationErased(
3937
Operation *op) {
40-
LDBG(patternName << " | notifyOperationErased"
41-
<< " | " << op->getName());
38+
LDBG() << patternName << " | notifyOperationErased"
39+
<< " | " << op->getName();
4240
ForwardingListener::notifyOperationErased(op);
4341
}
4442

4543
void RewriterBase::PatternLoggingListener::notifyPatternBegin(
4644
const Pattern &pattern, Operation *op) {
47-
LDBG(patternName << " | notifyPatternBegin"
48-
<< " | " << op->getName());
45+
LDBG() << patternName << " | notifyPatternBegin"
46+
<< " | " << op->getName();
4947
ForwardingListener::notifyPatternBegin(pattern, op);
5048
}

0 commit comments

Comments
 (0)