44 struct InParallelOpInterface
45 :
public BufferDeallocationOpInterface::ExternalModel<InParallelOpInterface,
49 auto inParallelOp = cast<scf::InParallelOp>(op);
50 if (!inParallelOp.getBody()->empty())
51 return op->
emitError(
"only supported when nested region is empty");
55 state, op, {}, updatedOperandOwnership);
59 struct ReduceReturnOpInterface
60 :
public BufferDeallocationOpInterface::ExternalModel<
61 ReduceReturnOpInterface, scf::ReduceReturnOp> {
64 auto reduceReturnOp = cast<scf::ReduceReturnOp>(op);
65 if (isa<BaseMemRefType>(reduceReturnOp.getOperand().getType()))
66 return op->
emitError(
"only supported when operand is not a MemRef");
70 state, op, {}, updatedOperandOwnership);
79 InParallelOp::attachInterface<InParallelOpInterface>(*ctx);
80 ReduceReturnOp::attachInterface<ReduceReturnOpInterface>(*ctx);
static llvm::ManagedStatic< PassManagerOptions > options
The DialectRegistry maps a dialect namespace to a constructor for the matching dialect.
bool addExtension(TypeID extensionID, std::unique_ptr< DialectExtensionBase > extension)
Add the given extension to the registry.
MLIRContext is the top-level object for a collection of MLIR operations.
Operation is the basic unit of execution within MLIR.
InFlightDiagnostic emitError(const Twine &message={})
Emit an error about fatal conditions with this operation, reporting up to any diagnostic handlers tha...
This class collects all the state that we need to perform the buffer deallocation pass with associate...
FailureOr< Operation * > insertDeallocOpForReturnLike(DeallocationState &state, Operation *op, ValueRange operands, SmallVectorImpl< Value > &updatedOperandOwnerships)
Insert a bufferization.dealloc operation right before op which has to be a terminator without any suc...
void registerBufferDeallocationOpInterfaceExternalModels(DialectRegistry ®istry)
Include the generated interface declarations.
Options for BufferDeallocationOpInterface-based buffer deallocation.