diff options
author | Mehdi Amini <joker.eph@gmail.com> | 2025-08-23 12:46:59 -0700 |
---|---|---|
committer | Mehdi Amini <joker.eph@gmail.com> | 2025-08-23 12:49:31 -0700 |
commit | 9fbf75298666c27277f086bf4900cc55694a657c (patch) | |
tree | 2dd43fc1352ec13d6af6c757466840d529ee6ca2 | |
parent | 513c52cd614898bcef95f97b72db2bc8a240115e (diff) | |
download | llvm-9fbf75298666c27277f086bf4900cc55694a657c.zip llvm-9fbf75298666c27277f086bf4900cc55694a657c.tar.gz llvm-9fbf75298666c27277f086bf4900cc55694a657c.tar.bz2 |
[MLIR] Adopt LDBG() macro in ControlFlowSinkUtils.cpp (NFC)
-rw-r--r-- | mlir/lib/Transforms/Utils/ControlFlowSinkUtils.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/mlir/lib/Transforms/Utils/ControlFlowSinkUtils.cpp b/mlir/lib/Transforms/Utils/ControlFlowSinkUtils.cpp index cfd568f..19cf464 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)) { |