[Mlir-commits] [mlir] 9fbf752 - [MLIR] Adopt LDBG() macro in ControlFlowSinkUtils.cpp (NFC)

Mehdi Amini llvmlistbot at llvm.org
Sat Aug 23 12:49:44 PDT 2025


Author: Mehdi Amini
Date: 2025-08-23T12:49:31-07:00
New Revision: 9fbf75298666c27277f086bf4900cc55694a657c

URL: https://github.com/llvm/llvm-project/commit/9fbf75298666c27277f086bf4900cc55694a657c
DIFF: https://github.com/llvm/llvm-project/commit/9fbf75298666c27277f086bf4900cc55694a657c.diff

LOG: [MLIR] Adopt LDBG() macro in ControlFlowSinkUtils.cpp (NFC)

Added: 
    

Modified: 
    mlir/lib/Transforms/Utils/ControlFlowSinkUtils.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Transforms/Utils/ControlFlowSinkUtils.cpp b/mlir/lib/Transforms/Utils/ControlFlowSinkUtils.cpp
index cfd568f028721..19cf4646bddd4 100644
--- a/mlir/lib/Transforms/Utils/ControlFlowSinkUtils.cpp
+++ b/mlir/lib/Transforms/Utils/ControlFlowSinkUtils.cpp
@@ -21,7 +21,10 @@
 #include "mlir/Transforms/ControlFlowSinkUtils.h"
 #include "mlir/IR/Dominance.h"
 #include "mlir/IR/Matchers.h"
+#include "mlir/IR/Operation.h"
+#include "mlir/IR/OperationSupport.h"
 #include "mlir/Interfaces/ControlFlowInterfaces.h"
+#include "llvm/Support/DebugLog.h"
 #include <vector>
 
 #define DEBUG_TYPE "cf-sink"
@@ -84,13 +87,15 @@ bool Sinker::allUsersDominatedBy(Operation *op, Region *region) {
 
 void Sinker::tryToSinkPredecessors(Operation *user, Region *region,
                                    std::vector<Operation *> &stack) {
-  LLVM_DEBUG(user->print(llvm::dbgs() << "\nContained op:\n"));
+  LDBG() << "Contained op: "
+         << OpWithFlags(user, OpPrintingFlags().skipRegions());
   for (Value value : user->getOperands()) {
     Operation *op = value.getDefiningOp();
     // Ignore block arguments and ops that are already inside the region.
     if (!op || op->getParentRegion() == region)
       continue;
-    LLVM_DEBUG(op->print(llvm::dbgs() << "\nTry to sink:\n"));
+    LDBG() << "Try to sink:\n"
+           << OpWithFlags(op, OpPrintingFlags().skipRegions());
 
     // If the op's users are all in the region and it can be moved, then do so.
     if (allUsersDominatedBy(op, region) && shouldMoveIntoRegion(op, region)) {


        


More information about the Mlir-commits mailing list