|
MLIR 24.0.0git
|
This represents an operation in an abstracted form, suitable for use with the builder APIs. More...
#include "mlir/IR/OperationSupport.h"
Public Member Functions | |
| OperationState (Location location, StringRef name) | |
| OperationState (Location location, OperationName name) | |
| OperationState (Location location, OperationName name, ValueRange operands, TypeRange types, ArrayRef< NamedAttribute > attributes={}, BlockRange successors={}, MutableArrayRef< std::unique_ptr< Region > > regions={}) | |
| OperationState (Location location, StringRef name, ValueRange operands, TypeRange types, ArrayRef< NamedAttribute > attributes={}, BlockRange successors={}, MutableArrayRef< std::unique_ptr< Region > > regions={}) | |
| OperationState (OperationState &&other)=default | |
| OperationState & | operator= (OperationState &&other)=default |
| OperationState (const OperationState &other)=delete | |
| OperationState & | operator= (const OperationState &other)=delete |
| ~OperationState () | |
| template<typename T> | |
| T & | getOrAddProperties () |
| Get (or create) the properties of the provided type to be set on the operation on creation. | |
| PropertyRef | getRawProperties () |
| LogicalResult | setProperties (Operation *op, function_ref< InFlightDiagnostic()> emitError) const |
| template<typename T> | |
| void | useProperties (T &newProperties) |
| void | addOperands (ValueRange newOperands) |
| void | addTypes (ArrayRef< Type > newTypes) |
| template<typename RangeT> | |
| std::enable_if_t<!std::is_convertible< RangeT, ArrayRef< Type > >::value > | addTypes (RangeT &&newTypes) |
| void | addAttribute (StringRef name, Attribute attr) |
| Add an attribute with the specified name. | |
| void | addAttribute (StringAttr name, Attribute attr) |
| Add an attribute with the specified name. | |
| void | addAttributes (ArrayRef< NamedAttribute > newAttributes) |
| Add an array of named attributes. | |
| void | addSuccessors (Block *successor) |
| Adds a successor to the operation sate. successor must not be null. | |
| void | addSuccessors (BlockRange newSuccessors) |
| Region * | addRegion () |
| Create a region that should be attached to the operation. | |
| void | addRegion (std::unique_ptr< Region > &®ion) |
| Take a region that should be attached to the Operation. | |
| void | addRegions (MutableArrayRef< std::unique_ptr< Region > > regions) |
| Take ownership of a set of regions that should be attached to the Operation. | |
| MLIRContext * | getContext () const |
| Get the context held by this operation state. | |
Public Attributes | |
| Location | location |
| OperationName | name |
| SmallVector< Value, 4 > | operands |
| SmallVector< Type, 4 > | types |
| Types of the results of this operation. | |
| NamedAttrList | attributes |
| SmallVector< Block *, 1 > | successors |
| Successors of this operation and their respective operands. | |
| SmallVector< std::unique_ptr< Region >, 1 > | regions |
| Regions that the op will hold. | |
| Attribute | propertiesAttr |
| This Attribute is used to opaquely construct the properties of the operation. | |
Friends | |
| class | Operation |
This represents an operation in an abstracted form, suitable for use with the builder APIs.
This object is a large and heavy weight object meant to be used as a temporary object on the stack. It is generally unwise to put this in a collection.
Definition at line 1020 of file OperationSupport.h.
| OperationState::OperationState | ( | Location | location, |
| StringRef | name ) |
Definition at line 216 of file OperationSupport.cpp.
References getContext(), location, and name.
Referenced by Operation, OperationState(), OperationState(), OperationState(), operator=(), and operator=().
| OperationState::OperationState | ( | Location | location, |
| OperationName | name ) |
Definition at line 219 of file OperationSupport.cpp.
| OperationState::OperationState | ( | Location | location, |
| OperationName | name, | ||
| ValueRange | operands, | ||
| TypeRange | types, | ||
| ArrayRef< NamedAttribute > | attributes = {}, | ||
| BlockRange | successors = {}, | ||
| MutableArrayRef< std::unique_ptr< Region > > | regions = {} ) |
Definition at line 222 of file OperationSupport.cpp.
References attributes, location, name, operands, regions, successors, and types.
| OperationState::OperationState | ( | Location | location, |
| StringRef | name, | ||
| ValueRange | operands, | ||
| TypeRange | types, | ||
| ArrayRef< NamedAttribute > | attributes = {}, | ||
| BlockRange | successors = {}, | ||
| MutableArrayRef< std::unique_ptr< Region > > | regions = {} ) |
Definition at line 235 of file OperationSupport.cpp.
References attributes, getContext(), location, name, operands, OperationState(), regions, successors, and types.
|
default |
References OperationState().
|
delete |
References OperationState().
| OperationState::~OperationState | ( | ) |
Definition at line 243 of file OperationSupport.cpp.
Add an attribute with the specified name.
name and attr must not be null.
Definition at line 1148 of file OperationSupport.h.
References attributes, and name.
Add an attribute with the specified name.
Definition at line 1142 of file OperationSupport.h.
References addAttribute(), getContext(), and name.
Referenced by addAttribute(), buildBatchMatmulOp(), buildBatchReduceMatmulOp(), buildMatmulOp(), buildStructuredOp(), mlirOperationCreate(), mlir::spirv::parseControlAttribute(), mlir::spirv::parseEnumKeywordAttr(), mlir::spirv::parseEnumStrAttr(), parseUsedCoordList(), resolveOpBundleOperands(), and mlir::detail::splitPropertiesAndDiscardableAttributes().
|
inline |
Add an array of named attributes.
Definition at line 1155 of file OperationSupport.h.
References attributes.
Referenced by buildStructuredOp(), and mlir::spirv::Deserializer::processOpWithoutGrammarAttr().
| void OperationState::addOperands | ( | ValueRange | newOperands | ) |
Definition at line 259 of file OperationSupport.cpp.
References operands.
Referenced by buildStructuredOp(), mlirOperationCreate(), and mlir::spirv::Deserializer::processOpWithoutGrammarAttr().
| Region * OperationState::addRegion | ( | ) |
Create a region that should be attached to the operation.
These regions can be filled in immediately without waiting for Operation to be created. When it is, the region bodies will be transferred.
Definition at line 267 of file OperationSupport.cpp.
References regions.
Referenced by addRegions(), buildQuantifier(), buildStructuredOp(), mlir::clone(), mlir::cloneWithoutRegions(), mlir::RewriterBase::eraseOpResults(), mlirOperationCreate(), and mlir::memoryslot::replaceWithNewResults().
| void OperationState::addRegions | ( | MutableArrayRef< std::unique_ptr< Region > > | regions | ) |
Take ownership of a set of regions that should be attached to the Operation.
Definition at line 276 of file OperationSupport.cpp.
References addRegion(), and regions.
Adds a successor to the operation sate. successor must not be null.
Definition at line 1160 of file OperationSupport.h.
References successors.
Referenced by mlirOperationCreate().
| void OperationState::addSuccessors | ( | BlockRange | newSuccessors | ) |
Definition at line 263 of file OperationSupport.cpp.
References successors.
Definition at line 1132 of file OperationSupport.h.
References types.
Referenced by buildQuantifier(), buildStructuredOp(), mlirOperationCreate(), and mlir::spirv::Deserializer::processOpWithoutGrammarAttr().
|
inline |
Definition at line 1137 of file OperationSupport.h.
References types.
|
inline |
Get the context held by this operation state.
Definition at line 1181 of file OperationSupport.h.
References location.
Referenced by mlir::Operation::create(), inferOperationTypes(), OperationState(), OperationState(), and mlir::detail::splitPropertiesAndDiscardableAttributes().
|
inline |
Get (or create) the properties of the provided type to be set on the operation on creation.
Definition at line 1069 of file OperationSupport.h.
References mlir::PropertyRef::as(), and mlir::TypeID::get().
Referenced by buildQuantifier().
|
inline |
Definition at line 1094 of file OperationSupport.h.
Referenced by inferOperationTypes().
|
delete |
References OperationState().
|
default |
References OperationState().
| LogicalResult OperationState::setProperties | ( | Operation * | op, |
| function_ref< InFlightDiagnostic()> | emitError ) const |
Definition at line 248 of file OperationSupport.cpp.
References mlir::emitError(), mlir::Operation::getPropertiesStorage(), Operation, propertiesAttr, mlir::Operation::setPropertiesFromAttribute(), and success().
|
inline |
Definition at line 1108 of file OperationSupport.h.
References mlir::PropertyRef::as(), and mlir::TypeID::get().
|
friend |
Definition at line 1046 of file OperationSupport.h.
References attributes, location, name, operands, Operation, OperationState(), and types.
Referenced by Operation, and setProperties().
| NamedAttrList mlir::OperationState::attributes |
Definition at line 1026 of file OperationSupport.h.
Referenced by addAttribute(), addAttributes(), buildStructuredOp(), mlir::Operation::create(), inferOperationTypes(), mlirOperationCreate(), Operation, OperationState(), OperationState(), mlir::spirv::parseMemoryAccessAttributes(), mlir::spirv::parseSourceMemoryAccessAttributes(), mlir::spirv::parseVariableDecorations(), and mlir::detail::reportFatalInferReturnTypesError().
| Location mlir::OperationState::location |
Definition at line 1021 of file OperationSupport.h.
Referenced by buildQuantifier(), buildSequenceBody(), mlir::Operation::create(), getContext(), inferOperationTypes(), Operation, OperationState(), OperationState(), OperationState(), OperationState(), and mlir::detail::reportFatalInferReturnTypesError().
| OperationName mlir::OperationState::name |
Definition at line 1022 of file OperationSupport.h.
Referenced by addAttribute(), addAttribute(), mlir::Operation::create(), inferOperationTypes(), Operation, OperationState(), OperationState(), OperationState(), OperationState(), mlir::spirv::parseMemoryAccessAttributes(), mlir::spirv::parseSourceMemoryAccessAttributes(), and mlir::detail::reportFatalInferReturnTypesError().
| SmallVector<Value, 4> mlir::OperationState::operands |
Definition at line 1023 of file OperationSupport.h.
Referenced by addOperands(), mlir::Operation::create(), inferOperationTypes(), Operation, OperationState(), OperationState(), parseSparseCoIterateLoop(), parseSparseIterateLoop(), mlir::detail::reportFatalInferReturnTypesError(), and resolveOpBundleOperands().
| Attribute mlir::OperationState::propertiesAttr |
This Attribute is used to opaquely construct the properties of the operation.
If we're creating an unregistered operation, the Attribute is used as-is as the Properties storage of the operation. Otherwise, the operation properties are constructed opaquely using its setPropertiesFromAttr hook. Note that getOrAddProperties is the preferred method to construct properties from C++.
Definition at line 1038 of file OperationSupport.h.
Referenced by mlir::clone(), cloneOpWithOperandsAndTypes(), mlir::cloneWithoutRegions(), mlir::Operation::create(), createWithProperties(), createWithProperties(), mlir::RewriterBase::eraseOpResults(), mlir::LLVM::detail::oneToOneRewrite(), mlir::memoryslot::replaceWithNewResults(), scalarizeVectorOpHelper(), setProperties(), mlir::LLVM::detail::vectorOneToOneRewrite(), and widenOp().
| SmallVector<std::unique_ptr<Region>, 1> mlir::OperationState::regions |
Regions that the op will hold.
Definition at line 1030 of file OperationSupport.h.
Referenced by addRegion(), addRegion(), addRegions(), buildSequenceBody(), mlir::Operation::create(), inferOperationTypes(), OperationState(), and OperationState().
| SmallVector<Block *, 1> mlir::OperationState::successors |
Successors of this operation and their respective operands.
Definition at line 1028 of file OperationSupport.h.
Referenced by addSuccessors(), addSuccessors(), mlir::Operation::create(), OperationState(), and OperationState().
| SmallVector<Type, 4> mlir::OperationState::types |
Types of the results of this operation.
Definition at line 1025 of file OperationSupport.h.
Referenced by addTypes(), addTypes(), mlir::Operation::create(), inferOperationTypes(), mlirOperationCreate(), Operation, OperationState(), OperationState(), parseSparseCoIterateLoop(), and parseSparseIterateLoop().