[llvm] [mlir] [mlir][core] Add an MLIR "pattern catalog" generator (PR #146228)
Mehdi Amini via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 1 05:36:13 PDT 2025
================
@@ -0,0 +1,55 @@
+#include "mlir/IR/PatternMatch.h"
+#include "llvm/Support/Debug.h"
+
+#define DEBUG_TYPE "pattern-logging-listener"
+
+using namespace mlir;
+
+static constexpr StringLiteral catalogPrefix = "PatternLoggingListener: ";
----------------
joker-eph wrote:
A pattern we used in other files is something like this:
```
#define DEBUG_TYPE "liveness-analysis"
#define DBGS() (llvm::dbgs() << '[' << DEBUG_TYPE << "] ")
#define LDBG(X) LLVM_DEBUG(DBGS() << X << "\n")
```
And then adjusting the macro usage.
(I think it'd be best if we standardize it in the codebase by moving these macros in a common header though)
https://github.com/llvm/llvm-project/pull/146228
More information about the llvm-commits
mailing list