[Mlir-commits] [mlir] 03dc2a4 - [MLIR] Update MLIR tutorial to use LDBG() macro (#150763)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Sun Jul 27 11:21:21 PDT 2025
Author: Mehdi Amini
Date: 2025-07-27T20:21:18+02:00
New Revision: 03dc2a41f3d9a500e47b513de5c5008c06860d65
URL: https://github.com/llvm/llvm-project/commit/03dc2a41f3d9a500e47b513de5c5008c06860d65
DIFF: https://github.com/llvm/llvm-project/commit/03dc2a41f3d9a500e47b513de5c5008c06860d65.diff
LOG: [MLIR] Update MLIR tutorial to use LDBG() macro (#150763)
Added:
Modified:
mlir/docs/Tutorials/Toy/Ch-4.md
mlir/examples/toy/Ch4/mlir/ShapeInferencePass.cpp
mlir/examples/toy/Ch5/mlir/ShapeInferencePass.cpp
mlir/examples/toy/Ch6/mlir/ShapeInferencePass.cpp
mlir/examples/toy/Ch7/mlir/ShapeInferencePass.cpp
Removed:
################################################################################
diff --git a/mlir/docs/Tutorials/Toy/Ch-4.md b/mlir/docs/Tutorials/Toy/Ch-4.md
index 1bba269ca9a1e..e9abe36afc4d7 100644
--- a/mlir/docs/Tutorials/Toy/Ch-4.md
+++ b/mlir/docs/Tutorials/Toy/Ch-4.md
@@ -445,7 +445,7 @@ When processing an operation like described, we query if it registered the
```c++
// Ask the operation to infer its output shapes.
- LLVM_DEBUG(llvm::dbgs() << "Inferring shape for: " << *op << "\n");
+ LDBG() << "Inferring shape for: " << *op;
/// We check if an operation has a particular interface by casting.
if (ShapeInference shapeOp = dyn_cast<ShapeInference>(op)) {
diff --git a/mlir/examples/toy/Ch4/mlir/ShapeInferencePass.cpp b/mlir/examples/toy/Ch4/mlir/ShapeInferencePass.cpp
index 2522abe1a46f9..a552e1f08a84a 100644
--- a/mlir/examples/toy/Ch4/mlir/ShapeInferencePass.cpp
+++ b/mlir/examples/toy/Ch4/mlir/ShapeInferencePass.cpp
@@ -23,7 +23,7 @@
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/Support/Casting.h"
-#include "llvm/Support/Debug.h"
+#include "llvm/Support/DebugLog.h"
#include "llvm/Support/raw_ostream.h"
#include <memory>
@@ -81,7 +81,7 @@ struct ShapeInferencePass
opWorklist.erase(op);
// Ask the operation to infer its output shapes.
- LLVM_DEBUG(llvm::dbgs() << "Inferring shape for: " << *op << "\n");
+ LDBG() << "Inferring shape for: " << *op;
if (auto shapeOp = dyn_cast<ShapeInference>(op)) {
shapeOp.inferShapes();
} else {
diff --git a/mlir/examples/toy/Ch5/mlir/ShapeInferencePass.cpp b/mlir/examples/toy/Ch5/mlir/ShapeInferencePass.cpp
index 2522abe1a46f9..a552e1f08a84a 100644
--- a/mlir/examples/toy/Ch5/mlir/ShapeInferencePass.cpp
+++ b/mlir/examples/toy/Ch5/mlir/ShapeInferencePass.cpp
@@ -23,7 +23,7 @@
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/Support/Casting.h"
-#include "llvm/Support/Debug.h"
+#include "llvm/Support/DebugLog.h"
#include "llvm/Support/raw_ostream.h"
#include <memory>
@@ -81,7 +81,7 @@ struct ShapeInferencePass
opWorklist.erase(op);
// Ask the operation to infer its output shapes.
- LLVM_DEBUG(llvm::dbgs() << "Inferring shape for: " << *op << "\n");
+ LDBG() << "Inferring shape for: " << *op;
if (auto shapeOp = dyn_cast<ShapeInference>(op)) {
shapeOp.inferShapes();
} else {
diff --git a/mlir/examples/toy/Ch6/mlir/ShapeInferencePass.cpp b/mlir/examples/toy/Ch6/mlir/ShapeInferencePass.cpp
index 2522abe1a46f9..a552e1f08a84a 100644
--- a/mlir/examples/toy/Ch6/mlir/ShapeInferencePass.cpp
+++ b/mlir/examples/toy/Ch6/mlir/ShapeInferencePass.cpp
@@ -23,7 +23,7 @@
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/Support/Casting.h"
-#include "llvm/Support/Debug.h"
+#include "llvm/Support/DebugLog.h"
#include "llvm/Support/raw_ostream.h"
#include <memory>
@@ -81,7 +81,7 @@ struct ShapeInferencePass
opWorklist.erase(op);
// Ask the operation to infer its output shapes.
- LLVM_DEBUG(llvm::dbgs() << "Inferring shape for: " << *op << "\n");
+ LDBG() << "Inferring shape for: " << *op;
if (auto shapeOp = dyn_cast<ShapeInference>(op)) {
shapeOp.inferShapes();
} else {
diff --git a/mlir/examples/toy/Ch7/mlir/ShapeInferencePass.cpp b/mlir/examples/toy/Ch7/mlir/ShapeInferencePass.cpp
index 2522abe1a46f9..a552e1f08a84a 100644
--- a/mlir/examples/toy/Ch7/mlir/ShapeInferencePass.cpp
+++ b/mlir/examples/toy/Ch7/mlir/ShapeInferencePass.cpp
@@ -23,7 +23,7 @@
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/Support/Casting.h"
-#include "llvm/Support/Debug.h"
+#include "llvm/Support/DebugLog.h"
#include "llvm/Support/raw_ostream.h"
#include <memory>
@@ -81,7 +81,7 @@ struct ShapeInferencePass
opWorklist.erase(op);
// Ask the operation to infer its output shapes.
- LLVM_DEBUG(llvm::dbgs() << "Inferring shape for: " << *op << "\n");
+ LDBG() << "Inferring shape for: " << *op;
if (auto shapeOp = dyn_cast<ShapeInference>(op)) {
shapeOp.inferShapes();
} else {
More information about the Mlir-commits
mailing list