From e4bdcbbf288e752bc93815280e4dfedc2e8a8c06 Mon Sep 17 00:00:00 2001 From: Tuomas Karna Date: Tue, 17 Dec 2024 16:53:09 +0200 Subject: [PATCH] Region dialect: clean up EnvironmentRegionOp bufferization --- .../Transforms/BufferizableOpInterfaceImpl.cpp | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/lib/Dialect/Region/Transforms/BufferizableOpInterfaceImpl.cpp b/lib/Dialect/Region/Transforms/BufferizableOpInterfaceImpl.cpp index bcbe8c8f3..1687a8c98 100644 --- a/lib/Dialect/Region/Transforms/BufferizableOpInterfaceImpl.cpp +++ b/lib/Dialect/Region/Transforms/BufferizableOpInterfaceImpl.cpp @@ -15,16 +15,6 @@ namespace imex { namespace region { namespace { -/// Return true if none of the values is TensorType. -bool noTensorsIn(::mlir::ValueRange values) { - auto isTensor = [](::mlir::Value v) { - return ::llvm::isa<::mlir::TensorType>(v.getType()); - }; - if (::llvm::any_of(values, isTensor)) - return false; - return true; -} - /// Convert values to buffers. If a value is a tensor, get a buffer for it. ::mlir::LogicalResult convertToBuffers(::mlir::ValueRange values, @@ -81,10 +71,6 @@ struct EnvironmentRegionOpInterface bufferize(::mlir::Operation *op, ::mlir::RewriterBase &rewriter, const ::mlir::bufferization::BufferizationOptions &options) const { auto envOp = ::mlir::cast(op); - if (noTensorsIn(envOp.getArgs()) && noTensorsIn(envOp.getResults())) { - // Nothing to do. - return ::mlir::success(); - } // Convert op arguments to memrefs. ::mlir::SmallVector<::mlir::Value> newArguments; if (failed(convertToBuffers(envOp.getArgs(), newArguments, rewriter,