Skip to content

Commit ffbc8da

Browse files
authored
[MLIR] Migrate LICM utils to the LDBG() macro style logging (NFC) (#154615)
1 parent 780750b commit ffbc8da

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

mlir/lib/Transforms/Utils/LoopInvariantCodeMotionUtils.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@
1313
#include "mlir/Transforms/LoopInvariantCodeMotionUtils.h"
1414

1515
#include "mlir/IR/Operation.h"
16+
#include "mlir/IR/OperationSupport.h"
1617
#include "mlir/IR/PatternMatch.h"
1718
#include "mlir/Interfaces/LoopLikeInterface.h"
1819
#include "mlir/Interfaces/SideEffectInterfaces.h"
1920
#include "mlir/Interfaces/SubsetOpInterface.h"
2021
#include "llvm/Support/Debug.h"
22+
#include "llvm/Support/DebugLog.h"
2123
#include <queue>
2224

2325
#define DEBUG_TYPE "licm"
@@ -64,8 +66,7 @@ size_t mlir::moveLoopInvariantCode(
6466
size_t numMoved = 0;
6567

6668
for (Region *region : regions) {
67-
LLVM_DEBUG(llvm::dbgs() << "Original loop:\n"
68-
<< *region->getParentOp() << "\n");
69+
LDBG() << "Original loop:\n" << *region->getParentOp();
6970

7071
std::queue<Operation *> worklist;
7172
// Add top-level operations in the loop body to the worklist.
@@ -83,12 +84,13 @@ size_t mlir::moveLoopInvariantCode(
8384
if (op->getParentRegion() != region)
8485
continue;
8586

86-
LLVM_DEBUG(llvm::dbgs() << "Checking op: " << *op << "\n");
87+
LDBG() << "Checking op: "
88+
<< OpWithFlags(op, OpPrintingFlags().skipRegions());
8789
if (!shouldMoveOutOfRegion(op, region) ||
8890
!canBeHoisted(op, definedOutside))
8991
continue;
9092

91-
LLVM_DEBUG(llvm::dbgs() << "Moving loop-invariant op: " << *op << "\n");
93+
LDBG() << "Moving loop-invariant op: " << *op;
9294
moveOutOfRegion(op, region);
9395
++numMoved;
9496

0 commit comments

Comments
 (0)