Skip to content

Commit 9fbf752

Browse files
committed
[MLIR] Adopt LDBG() macro in ControlFlowSinkUtils.cpp (NFC)
1 parent 513c52c commit 9fbf752

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

mlir/lib/Transforms/Utils/ControlFlowSinkUtils.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@
2121
#include "mlir/Transforms/ControlFlowSinkUtils.h"
2222
#include "mlir/IR/Dominance.h"
2323
#include "mlir/IR/Matchers.h"
24+
#include "mlir/IR/Operation.h"
25+
#include "mlir/IR/OperationSupport.h"
2426
#include "mlir/Interfaces/ControlFlowInterfaces.h"
27+
#include "llvm/Support/DebugLog.h"
2528
#include <vector>
2629

2730
#define DEBUG_TYPE "cf-sink"
@@ -84,13 +87,15 @@ bool Sinker::allUsersDominatedBy(Operation *op, Region *region) {
8487

8588
void Sinker::tryToSinkPredecessors(Operation *user, Region *region,
8689
std::vector<Operation *> &stack) {
87-
LLVM_DEBUG(user->print(llvm::dbgs() << "\nContained op:\n"));
90+
LDBG() << "Contained op: "
91+
<< OpWithFlags(user, OpPrintingFlags().skipRegions());
8892
for (Value value : user->getOperands()) {
8993
Operation *op = value.getDefiningOp();
9094
// Ignore block arguments and ops that are already inside the region.
9195
if (!op || op->getParentRegion() == region)
9296
continue;
93-
LLVM_DEBUG(op->print(llvm::dbgs() << "\nTry to sink:\n"));
97+
LDBG() << "Try to sink:\n"
98+
<< OpWithFlags(op, OpPrintingFlags().skipRegions());
9499

95100
// If the op's users are all in the region and it can be moved, then do so.
96101
if (allUsersDominatedBy(op, region) && shouldMoveIntoRegion(op, region)) {

0 commit comments

Comments
 (0)