Skip to content

Commit

Permalink
Region dialect: clean up EnvironmentRegionOp bufferization
Browse files Browse the repository at this point in the history
  • Loading branch information
tkarna committed Dec 18, 2024
1 parent 7f2ded8 commit e4bdcbb
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions lib/Dialect/Region/Transforms/BufferizableOpInterfaceImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -81,10 +71,6 @@ struct EnvironmentRegionOpInterface
bufferize(::mlir::Operation *op, ::mlir::RewriterBase &rewriter,
const ::mlir::bufferization::BufferizationOptions &options) const {
auto envOp = ::mlir::cast<region::EnvironmentRegionOp>(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,
Expand Down

0 comments on commit e4bdcbb

Please sign in to comment.