diff --git a/mlir/lib/IR/AsmPrinter.cpp b/mlir/lib/IR/AsmPrinter.cpp index bb92cfd4f62c..b6a781c449b8 100644 --- a/mlir/lib/IR/AsmPrinter.cpp +++ b/mlir/lib/IR/AsmPrinter.cpp @@ -1622,7 +1622,7 @@ void ModulePrinter::print(ModuleOp module) { auto *moduleBody = module.getBody(); for (auto &op : llvm::make_range(moduleBody->begin(), --moduleBody->end())) { opPrinter.print(&op); - os << '\n'; + os << "\n\n"; } } diff --git a/mlir/lib/IR/Function.cpp b/mlir/lib/IR/Function.cpp index d34f4b4044e1..99045a84046d 100644 --- a/mlir/lib/IR/Function.cpp +++ b/mlir/lib/IR/Function.cpp @@ -236,12 +236,9 @@ void FuncOp::print(OpAsmPrinter *p) { } // Print the body if this is not an external function. - if (!isExternal()) { + if (!isExternal()) p->printRegion(getBody(), /*printEntryBlockArgs=*/false, /*printBlockTerminators=*/true); - *p << '\n'; - } - *p << '\n'; } LogicalResult FuncOp::verify() {