diff --git a/mlir/lib/Dialect/Affine/Analysis/LoopAnalysis.cpp b/mlir/lib/Dialect/Affine/Analysis/LoopAnalysis.cpp index 2f85e0b5da043..166d39e88d41e 100644 --- a/mlir/lib/Dialect/Affine/Analysis/LoopAnalysis.cpp +++ b/mlir/lib/Dialect/Affine/Analysis/LoopAnalysis.cpp @@ -21,6 +21,7 @@ #include "llvm/Support/MathExtras.h" #include "llvm/Support/Debug.h" +#include "llvm/Support/DebugLog.h" #include #include @@ -548,19 +549,19 @@ bool mlir::affine::isTilingValid(ArrayRef loops) { // Check whether there is any negative direction vector in the // dependence components found above, which means that dependence is // violated by the default hyper-rect tiling method. - LLVM_DEBUG(llvm::dbgs() << "Checking whether tiling legality violated " - "for dependence at depth: " - << Twine(d) << " between:\n";); - LLVM_DEBUG(srcAccess.opInst->dump()); - LLVM_DEBUG(dstAccess.opInst->dump()); + LDBG() << "Checking whether tiling legality violated " + << "for dependence at depth: " << Twine(d) << " between:" + << OpWithFlags(srcAccess.opInst, OpPrintingFlags().skipRegions()) + << "\nand:\n" + << OpWithFlags(dstAccess.opInst, + OpPrintingFlags().skipRegions()); for (const DependenceComponent &depComp : depComps) { if (depComp.lb.has_value() && depComp.ub.has_value() && *depComp.lb < *depComp.ub && *depComp.ub < 0) { - LLVM_DEBUG(llvm::dbgs() - << "Dependence component lb = " << Twine(*depComp.lb) - << " ub = " << Twine(*depComp.ub) - << " is negative at depth: " << Twine(d) - << " and thus violates the legality rule.\n"); + LDBG() << "Dependence component lb = " << Twine(*depComp.lb) + << " ub = " << Twine(*depComp.ub) + << " is negative at depth: " << Twine(d) + << " and thus violates the legality rule."; return false; } }