MLIR
17.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 (const OperationState &other)=default | |
OperationState & | operator= (OperationState &&other)=default |
OperationState & | operator= (const OperationState &other)=default |
~OperationState () | |
template<typename T > | |
T & | getOrAddProperties () |
Get (or create) a properties of the provided type to be set on the operation on creation. More... | |
OpaqueProperties | getRawProperties () |
LogicalResult | setProperties (Operation *op, InFlightDiagnostic *diagnostic) const |
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. More... | |
void | addAttribute (StringAttr name, Attribute attr) |
Add an attribute with the specified name. More... | |
void | addAttributes (ArrayRef< NamedAttribute > newAttributes) |
Add an array of named attributes. More... | |
void | addSuccessors (Block *successor) |
void | addSuccessors (BlockRange newSuccessors) |
Region * | addRegion () |
Create a region that should be attached to the operation. More... | |
void | addRegion (std::unique_ptr< Region > &®ion) |
Take a region that should be attached to the Operation. More... | |
void | addRegions (MutableArrayRef< std::unique_ptr< Region >> regions) |
Take ownership of a set of regions that should be attached to the Operation. More... | |
MLIRContext * | getContext () const |
Get the context held by this operation state. More... | |
Public Attributes | |
Location | location |
OperationName | name |
SmallVector< Value, 4 > | operands |
SmallVector< Type, 4 > | types |
Types of the results of this operation. More... | |
NamedAttrList | attributes |
SmallVector< Block *, 1 > | successors |
Successors of this operation and their respective operands. More... | |
SmallVector< std::unique_ptr< Region >, 1 > | regions |
Regions that the op will hold. More... | |
Attribute | propertiesAttr |
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 912 of file OperationSupport.h.
OperationState::OperationState | ( | Location | location, |
StringRef | name | ||
) |
Definition at line 169 of file OperationSupport.cpp.
OperationState::OperationState | ( | Location | location, |
OperationName | name | ||
) |
Definition at line 172 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 175 of file OperationSupport.cpp.
References regions.
OperationState::OperationState | ( | Location | location, |
StringRef | name, | ||
ValueRange | operands, | ||
TypeRange | types, | ||
ArrayRef< NamedAttribute > | attributes = {} , |
||
BlockRange | successors = {} , |
||
MutableArrayRef< std::unique_ptr< Region >> | regions = {} |
||
) |
Definition at line 188 of file OperationSupport.cpp.
|
default |
|
default |
OperationState::~OperationState | ( | ) |
Definition at line 196 of file OperationSupport.cpp.
|
inline |
Add an attribute with the specified name.
Definition at line 998 of file OperationSupport.h.
References mlir::NamedAttrList::append(), attributes, and name.
|
inline |
Add an attribute with the specified name.
Definition at line 993 of file OperationSupport.h.
References mlir::get(), getContext(), and name.
Referenced by mlir::affine::AffineDmaStartOp::build(), mlir::affine::AffineDmaWaitOp::build(), buildAvgPool2dOpWithQuantInfo(), buildConvOpWithQuantInfo(), buildExplicitValuePadOpWithQuantInfo(), buildFCOpWithQuantInfo(), buildMatMulOpWithQuantInfo(), buildPadOpWithQuantInfo(), buildStructuredOp(), buildTransConvOpWithQuantInfo(), buildUnaryOpWithQuantInfo(), mlirOperationCreate(), parseBound(), parseCommonStructuredOpParts(), parseControlAttribute(), parseEnumKeywordAttr(), parseEnumStrAttr(), mlir::function_interface_impl::parseFunctionOp(), and parseOptionalInterchange().
|
inline |
Add an array of named attributes.
Definition at line 1003 of file OperationSupport.h.
References mlir::NamedAttrList::append(), and attributes.
Referenced by buildStructuredOp().
void OperationState::addOperands | ( | ValueRange | newOperands | ) |
Definition at line 213 of file OperationSupport.cpp.
References operands.
Referenced by mlir::affine::AffineDmaStartOp::build(), mlir::affine::AffineDmaWaitOp::build(), buildAvgPool2dOpWithQuantInfo(), buildConvOpWithQuantInfo(), buildExplicitValuePadOpWithQuantInfo(), buildFCOpWithQuantInfo(), buildMatMulOpWithQuantInfo(), buildPadOpWithQuantInfo(), buildStructuredOp(), buildTransConvOpWithQuantInfo(), buildUnaryOpWithQuantInfo(), and mlirOperationCreate().
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 221 of file OperationSupport.cpp.
References regions.
Referenced by addBodyWithPayloadOp(), addRegions(), buildStructuredOp(), mlirOperationCreate(), mlir::function_interface_impl::parseFunctionOp(), parseNamedStructuredOp(), and parseRegions().
void OperationState::addRegion | ( | std::unique_ptr< Region > && | region | ) |
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 230 of file OperationSupport.cpp.
References addRegion(), and regions.
|
inline |
Definition at line 1007 of file OperationSupport.h.
References successors.
Referenced by mlirOperationCreate().
void OperationState::addSuccessors | ( | BlockRange | newSuccessors | ) |
Definition at line 217 of file OperationSupport.cpp.
References successors.
Definition at line 983 of file OperationSupport.h.
References types.
Referenced by buildConvOpWithQuantInfo(), buildFCOpWithQuantInfo(), buildMatMulOpWithQuantInfo(), buildStructuredOp(), buildTransConvOpWithQuantInfo(), mlirOperationCreate(), parseArithmeticExtendedBinaryOp(), parseCallTypeAndResolveOperands(), parseCmpOp(), parseDstStyleOp(), parseNamedStructuredOp(), parseOneResultSameOperandTypeOp(), and parsePtrAccessChainOpImpl().
|
inline |
Definition at line 988 of file OperationSupport.h.
References types.
|
inline |
Get the context held by this operation state.
Definition at line 1025 of file OperationSupport.h.
References mlir::Attribute::getContext(), and location.
Referenced by addAttribute(), and inferOperationTypes().
|
inline |
Get (or create) a properties of the provided type to be set on the operation on creation.
Definition at line 958 of file OperationSupport.h.
References mlir::OpaqueProperties::as().
Referenced by mlir::Op< ConcreteType, Traits >::parseProperties().
|
inline |
Definition at line 974 of file OperationSupport.h.
Referenced by inferOperationTypes().
|
default |
|
default |
LogicalResult OperationState::setProperties | ( | Operation * | op, |
InFlightDiagnostic * | diagnostic | ||
) | const |
Definition at line 202 of file OperationSupport.cpp.
Definition at line 935 of file OperationSupport.h.
NamedAttrList mlir::OperationState::attributes |
Definition at line 918 of file OperationSupport.h.
Referenced by addAttribute(), addAttributes(), buildStructuredOp(), inferOperationTypes(), mlirOperationCreate(), mlir::affine::AffineDmaStartOp::parse(), mlir::affine::AffineDmaWaitOp::parse(), parseAffineMinMaxOp(), parseArithmeticExtendedBinaryOp(), parseBound(), parseCmpOp(), parseCommonStructuredOpParts(), parseDstStyleOp(), mlir::function_interface_impl::parseFunctionOp(), parseMemoryAccessAttributes(), parseNamedStructuredOp(), parseOneResultSameOperandTypeOp(), parseSourceMemoryAccessAttributes(), and parseVariableDecorations().
Location mlir::OperationState::location |
Definition at line 913 of file OperationSupport.h.
Referenced by addBodyWithPayloadOp(), buildSequenceBody(), getContext(), inferOperationTypes(), and parsePtrAccessChainOpImpl().
OperationName mlir::OperationState::name |
Definition at line 914 of file OperationSupport.h.
Referenced by addAttribute(), inferOperationTypes(), mlir::OpState::parse(), and parseCommonStructuredOpParts().
SmallVector<Value, 4> mlir::OperationState::operands |
Definition at line 915 of file OperationSupport.h.
Referenced by addOperands(), inferOperationTypes(), mlir::affine::AffineDmaStartOp::parse(), mlir::affine::AffineDmaWaitOp::parse(), parseAffineMinMaxOp(), parseArithmeticExtendedBinaryOp(), parseAtomicCompareExchangeImpl(), parseAtomicUpdateOp(), parseBound(), parseCallTypeAndResolveOperands(), parseCmpOp(), parseCommonStructuredOpParts(), parseGroupNonUniformArithmeticOp(), parseOneResultSameOperandTypeOp(), and parsePtrAccessChainOpImpl().
Attribute mlir::OperationState::propertiesAttr |
Definition at line 927 of file OperationSupport.h.
Referenced by parseCommonStructuredOpParts(), and mlir::Op< ConcreteType, Traits >::parseProperties().
SmallVector<std::unique_ptr<Region>, 1> mlir::OperationState::regions |
Regions that the op will hold.
Definition at line 922 of file OperationSupport.h.
Referenced by addRegion(), addRegions(), buildSequenceBody(), inferOperationTypes(), and OperationState().
SmallVector<Block *, 1> mlir::OperationState::successors |
Successors of this operation and their respective operands.
Definition at line 920 of file OperationSupport.h.
Referenced by addSuccessors().
SmallVector<Type, 4> mlir::OperationState::types |
Types of the results of this operation.
Definition at line 917 of file OperationSupport.h.
Referenced by addTypes(), buildAvgPool2dOpWithQuantInfo(), buildExplicitValuePadOpWithQuantInfo(), buildPadOpWithQuantInfo(), buildUnaryOpWithQuantInfo(), inferOperationTypes(), mlirOperationCreate(), parseAffineMinMaxOp(), parseAtomicCompareExchangeImpl(), parseAtomicUpdateOp(), parseGroupNonUniformArithmeticOp(), and parseOneResultSameOperandTypeOp().