[Mlir-commits] [mlir] 5ab3449 - [mlir][bufferize] Fix dropped return type in ModuleBufferization
Matthias Springer
llvmlistbot at llvm.org
Wed Apr 6 07:52:53 PDT 2022
Author: Matthias Springer
Date: 2022-04-06T23:48:15+09:00
New Revision: 5ab34492d6847e3d9e71062a48bc1a2fd6c9b34e
URL: https://github.com/llvm/llvm-project/commit/5ab34492d6847e3d9e71062a48bc1a2fd6c9b34e
DIFF: https://github.com/llvm/llvm-project/commit/5ab34492d6847e3d9e71062a48bc1a2fd6c9b34e.diff
LOG: [mlir][bufferize] Fix dropped return type in ModuleBufferization
Differential Revision: https://reviews.llvm.org/D123192
Added:
Modified:
mlir/lib/Dialect/Linalg/ComprehensiveBufferize/ModuleBufferization.cpp
mlir/test/Dialect/Linalg/comprehensive-module-bufferize.mlir
Removed:
################################################################################
diff --git a/mlir/lib/Dialect/Linalg/ComprehensiveBufferize/ModuleBufferization.cpp b/mlir/lib/Dialect/Linalg/ComprehensiveBufferize/ModuleBufferization.cpp
index e410befcbe2b2..03a754d3e8443 100644
--- a/mlir/lib/Dialect/Linalg/ComprehensiveBufferize/ModuleBufferization.cpp
+++ b/mlir/lib/Dialect/Linalg/ComprehensiveBufferize/ModuleBufferization.cpp
@@ -437,8 +437,8 @@ static LogicalResult bufferizeFuncOpBoundary(FuncOp funcOp,
return funcOp->emitError() << "cannot bufferize bodiless function that "
<< "returns a tensor";
FunctionType bufferizedFuncType = getBufferizedFunctionType(
- funcOp.getContext(), funcOp.getFunctionType().getInputs(), TypeRange{},
- state.getOptions());
+ funcOp.getContext(), funcOp.getFunctionType().getInputs(),
+ funcOp.getFunctionType().getResults(), state.getOptions());
funcOp.setType(bufferizedFuncType);
return success();
}
diff --git a/mlir/test/Dialect/Linalg/comprehensive-module-bufferize.mlir b/mlir/test/Dialect/Linalg/comprehensive-module-bufferize.mlir
index 1f080025002f2..563e22f5d6a45 100644
--- a/mlir/test/Dialect/Linalg/comprehensive-module-bufferize.mlir
+++ b/mlir/test/Dialect/Linalg/comprehensive-module-bufferize.mlir
@@ -455,6 +455,11 @@ func @main() {
// -----
+// CHECK: func private @external_func_with_return_val(memref<4xi32, #{{.*}}>) -> f32
+func private @external_func_with_return_val(tensor<4xi32>) -> f32
+
+// -----
+
// CHECK-LABEL: func @execute_region_test(
// CHECK-SAME: %[[m1:.*]]: memref<?xf32
func @execute_region_test(%t1 : tensor<?xf32> {linalg.inplaceable = "true"})
More information about the Mlir-commits
mailing list