|
21 | 21 | #include "mlir/Transforms/ControlFlowSinkUtils.h" |
22 | 22 | #include "mlir/IR/Dominance.h" |
23 | 23 | #include "mlir/IR/Matchers.h" |
| 24 | +#include "mlir/IR/Operation.h" |
| 25 | +#include "mlir/IR/OperationSupport.h" |
24 | 26 | #include "mlir/Interfaces/ControlFlowInterfaces.h" |
| 27 | +#include "llvm/Support/DebugLog.h" |
25 | 28 | #include <vector> |
26 | 29 |
|
27 | 30 | #define DEBUG_TYPE "cf-sink" |
@@ -84,13 +87,15 @@ bool Sinker::allUsersDominatedBy(Operation *op, Region *region) { |
84 | 87 |
|
85 | 88 | void Sinker::tryToSinkPredecessors(Operation *user, Region *region, |
86 | 89 | std::vector<Operation *> &stack) { |
87 | | - LLVM_DEBUG(user->print(llvm::dbgs() << "\nContained op:\n")); |
| 90 | + LDBG() << "Contained op: " |
| 91 | + << OpWithFlags(user, OpPrintingFlags().skipRegions()); |
88 | 92 | for (Value value : user->getOperands()) { |
89 | 93 | Operation *op = value.getDefiningOp(); |
90 | 94 | // Ignore block arguments and ops that are already inside the region. |
91 | 95 | if (!op || op->getParentRegion() == region) |
92 | 96 | continue; |
93 | | - LLVM_DEBUG(op->print(llvm::dbgs() << "\nTry to sink:\n")); |
| 97 | + LDBG() << "Try to sink:\n" |
| 98 | + << OpWithFlags(op, OpPrintingFlags().skipRegions()); |
94 | 99 |
|
95 | 100 | // If the op's users are all in the region and it can be moved, then do so. |
96 | 101 | if (allUsersDominatedBy(op, region) && shouldMoveIntoRegion(op, region)) { |
|
0 commit comments