Skip to content

Commit 26167ca

Browse files
committed
Print the // ---- separator between modules when using -split-input-file with mlir-opt
This allows to pipe sequences of `mlir-opt -split-input-file | mlir-opt -split-input-file`. Depends On D117750 Reviewed By: rriddle Differential Revision: https://reviews.llvm.org/D117756
1 parent 7b3d307 commit 26167ca

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

mlir/lib/Support/MlirOptMain.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,12 @@ LogicalResult mlir::MlirOptMain(raw_ostream &outputStream,
158158
return splitAndProcessBuffer(
159159
std::move(buffer),
160160
[&](std::unique_ptr<MemoryBuffer> chunkBuffer, raw_ostream &os) {
161-
return processBuffer(os, std::move(chunkBuffer), verifyDiagnostics,
162-
verifyPasses, allowUnregisteredDialects,
163-
preloadDialectsInContext, passManagerSetupFn,
164-
registry, threadPool);
161+
LogicalResult result = processBuffer(
162+
os, std::move(chunkBuffer), verifyDiagnostics, verifyPasses,
163+
allowUnregisteredDialects, preloadDialectsInContext,
164+
passManagerSetupFn, registry, threadPool);
165+
os << "// -----\n";
166+
return result;
165167
},
166168
outputStream);
167169

mlir/test/Dialect/OpenACC/ops.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// RUN: mlir-opt -split-input-file %s | FileCheck %s
22
// Verify the printed output can be parsed.
3-
// RUN: mlir-opt -split-input-file %s | mlir-opt -allow-unregistered-dialect | FileCheck %s
3+
// RUN: mlir-opt -split-input-file %s | mlir-opt -split-input-file | FileCheck %s
44
// Verify the generic form can be parsed.
5-
// RUN: mlir-opt -split-input-file -mlir-print-op-generic %s | mlir-opt -allow-unregistered-dialect | FileCheck %s
5+
// RUN: mlir-opt -split-input-file -mlir-print-op-generic %s | mlir-opt -split-input-file | FileCheck %s
66

77
func @compute1(%A: memref<10x10xf32>, %B: memref<10x10xf32>, %C: memref<10x10xf32>) -> memref<10x10xf32> {
88
%c0 = arith.constant 0 : index

0 commit comments

Comments
 (0)