Skip to content

Commit 4be19e2

Browse files
authored
[MLIR] Adopt LDBG() debug macros in Affine LoopAnalysis.cpp (NFC) (#154621)
1 parent deab049 commit 4be19e2

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

mlir/lib/Dialect/Affine/Analysis/LoopAnalysis.cpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "llvm/Support/MathExtras.h"
2222

2323
#include "llvm/Support/Debug.h"
24+
#include "llvm/Support/DebugLog.h"
2425
#include <numeric>
2526
#include <optional>
2627

@@ -548,19 +549,19 @@ bool mlir::affine::isTilingValid(ArrayRef<AffineForOp> loops) {
548549
// Check whether there is any negative direction vector in the
549550
// dependence components found above, which means that dependence is
550551
// violated by the default hyper-rect tiling method.
551-
LLVM_DEBUG(llvm::dbgs() << "Checking whether tiling legality violated "
552-
"for dependence at depth: "
553-
<< Twine(d) << " between:\n";);
554-
LLVM_DEBUG(srcAccess.opInst->dump());
555-
LLVM_DEBUG(dstAccess.opInst->dump());
552+
LDBG() << "Checking whether tiling legality violated "
553+
<< "for dependence at depth: " << Twine(d) << " between:"
554+
<< OpWithFlags(srcAccess.opInst, OpPrintingFlags().skipRegions())
555+
<< "\nand:\n"
556+
<< OpWithFlags(dstAccess.opInst,
557+
OpPrintingFlags().skipRegions());
556558
for (const DependenceComponent &depComp : depComps) {
557559
if (depComp.lb.has_value() && depComp.ub.has_value() &&
558560
*depComp.lb < *depComp.ub && *depComp.ub < 0) {
559-
LLVM_DEBUG(llvm::dbgs()
560-
<< "Dependence component lb = " << Twine(*depComp.lb)
561-
<< " ub = " << Twine(*depComp.ub)
562-
<< " is negative at depth: " << Twine(d)
563-
<< " and thus violates the legality rule.\n");
561+
LDBG() << "Dependence component lb = " << Twine(*depComp.lb)
562+
<< " ub = " << Twine(*depComp.ub)
563+
<< " is negative at depth: " << Twine(d)
564+
<< " and thus violates the legality rule.";
564565
return false;
565566
}
566567
}

0 commit comments

Comments
 (0)