diff --git a/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td b/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td --- a/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td +++ b/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td @@ -16,6 +16,7 @@ include "mlir/Dialect/Linalg/IR/LinalgBase.td" include "mlir/Dialect/Linalg/IR/LinalgInterfaces.td" +include "mlir/Interfaces/ControlFlowInterfaces.td" include "mlir/Interfaces/InferTypeOpInterface.td" include "mlir/Interfaces/SideEffectInterfaces.td" @@ -28,6 +29,7 @@ SingleBlockImplicitTerminator<"YieldOp">, DeclareOpInterfaceMethods, LinalgStructuredInterface, + RegionBranchOpInterface, ReifyRankedShapedTypeOpInterface], props)> { code structuredOpsBaseDecls = [{ // Return whether the op accesses the iteration indices. @@ -40,6 +42,13 @@ return llvm::cast(getOperation()).reifyResultShapes(b, reifiedReturnShapes); } + + void getSuccessorRegions( + Optional index, ArrayRef operands, + SmallVectorImpl ®ions) { + // Op has a region, but conceptually the control flow does not enter the + // region. + } }]; } diff --git a/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp b/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp --- a/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp +++ b/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp @@ -661,10 +661,6 @@ SmallVectorImpl> &effects, ValueRange results, ValueRange inputBuffers, ValueRange outputs) { - for (Value value : results) { - effects.emplace_back(MemoryEffects::Allocate::get(), value, - SideEffects::DefaultResource::get()); - } for (Value value : inputBuffers) { effects.emplace_back(MemoryEffects::Read::get(), value, SideEffects::DefaultResource::get());