48struct SelectOpInterface
49 :
public BufferDeallocationOpInterface::ExternalModel<SelectOpInterface,
51 FailureOr<Operation *> process(Operation *op, DeallocationState &state,
52 const DeallocationOptions &
options)
const {
56 std::pair<Value, Value>
57 materializeUniqueOwnershipForMemref(Operation *op, DeallocationState &state,
58 const DeallocationOptions &
options,
59 OpBuilder &builder, Value value)
const {
60 auto selectOp = cast<arith::SelectOp>(op);
61 assert(value == selectOp.getResult() &&
62 "Value not defined by this operation");
70 Value ownership = arith::SelectOp::create(
71 builder, op->
getLoc(), selectOp.getCondition(),
74 return {selectOp.getResult(), ownership};
83 SelectOp::attachInterface<SelectOpInterface>(*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.
Location getLoc()
The source location the operation was defined or derived from.
Block * getParentBlock()
Return the Block in which this Value is defined.
Ownership getOwnership(Value memref, Block *block) const
Returns the ownership of 'memref' for the given basic block.
std::pair< Value, Value > getMemrefWithUniqueOwnership(OpBuilder &builder, Value memref, Block *block)
Given an SSA value of MemRef type, this function queries the ownership and if it is not already in th...
bool isUnique() const
Check if this ownership value is in the 'Unique' state.
Value getIndicator() const
If this ownership value is in 'Unique' state, this function can be used to get the indicator paramete...
void registerBufferDeallocationOpInterfaceExternalModels(DialectRegistry ®istry)
Include the generated interface declarations.