[Mlir-commits] [mlir] 9bb0f46 - [mlir][licm] Fix debug output with newlines

Cullen Rhodes llvmlistbot at llvm.org
Tue May 17 06:29:22 PDT 2022


Author: Cullen Rhodes
Date: 2022-05-17T13:28:30Z
New Revision: 9bb0f4616a75515e93981af05e58f186ac7714ce

URL: https://github.com/llvm/llvm-project/commit/9bb0f4616a75515e93981af05e58f186ac7714ce
DIFF: https://github.com/llvm/llvm-project/commit/9bb0f4616a75515e93981af05e58f186ac7714ce.diff

LOG: [mlir][licm] Fix debug output with newlines

Added: 
    

Modified: 
    mlir/lib/Transforms/Utils/LoopInvariantCodeMotionUtils.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Transforms/Utils/LoopInvariantCodeMotionUtils.cpp b/mlir/lib/Transforms/Utils/LoopInvariantCodeMotionUtils.cpp
index 4bb24571671fa..e7a6bd7b4b616 100644
--- a/mlir/lib/Transforms/Utils/LoopInvariantCodeMotionUtils.cpp
+++ b/mlir/lib/Transforms/Utils/LoopInvariantCodeMotionUtils.cpp
@@ -55,7 +55,8 @@ size_t mlir::moveLoopInvariantCode(
   size_t numMoved = 0;
 
   for (Region *region : regions) {
-    LLVM_DEBUG(llvm::dbgs() << "Original loop:\n" << *region->getParentOp());
+    LLVM_DEBUG(llvm::dbgs() << "Original loop:\n"
+                            << *region->getParentOp() << "\n");
 
     std::queue<Operation *> worklist;
     // Add top-level operations in the loop body to the worklist.
@@ -73,12 +74,12 @@ size_t mlir::moveLoopInvariantCode(
       if (op->getParentRegion() != region)
         continue;
 
-      LLVM_DEBUG(llvm::dbgs() << "Checking op: " << *op);
+      LLVM_DEBUG(llvm::dbgs() << "Checking op: " << *op << "\n");
       if (!shouldMoveOutOfRegion(op, region) ||
           !canBeHoisted(op, definedOutside))
         continue;
 
-      LLVM_DEBUG(llvm::dbgs() << "Moving loop-invariant op: " << *op);
+      LLVM_DEBUG(llvm::dbgs() << "Moving loop-invariant op: " << *op << "\n");
       moveOutOfRegion(op, region);
       ++numMoved;
 


        


More information about the Mlir-commits mailing list