MLIR
18.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, function_ref< InFlightDiagnostic()> emitError) 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 946 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 1033 of file OperationSupport.h.
References mlir::NamedAttrList::append(), attributes, and name.
|
inline |
Add an attribute with the specified name.
Definition at line 1028 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(), buildTransConvOpWithQuantInfo(), buildUnaryOpWithQuantInfo(), parseBound(), parseCommonStructuredOpParts(), mlir::function_interface_impl::parseFunctionOp(), and parseOptionalInterchange().
|
inline |
Add an array of named attributes.
Definition at line 1038 of file OperationSupport.h.
References mlir::NamedAttrList::append(), and attributes.
void OperationState::addOperands | ( | ValueRange | newOperands | ) |
Definition at line 212 of file OperationSupport.cpp.
References operands.
Referenced by mlir::affine::AffineDmaStartOp::build(), mlir::affine::AffineDmaWaitOp::build(), buildAvgPool2dOpWithQuantInfo(), buildConvOpWithQuantInfo(), buildExplicitValuePadOpWithQuantInfo(), buildFCOpWithQuantInfo(), buildMatMulOpWithQuantInfo(), buildPadOpWithQuantInfo(), buildTransConvOpWithQuantInfo(), and buildUnaryOpWithQuantInfo().
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 220 of file OperationSupport.cpp.
References regions.
Referenced by addBodyWithPayloadOp(), addRegions(), mlir::function_interface_impl::parseFunctionOp(), and parseNamedStructuredOp().
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 229 of file OperationSupport.cpp.
References addRegion(), and regions.
|
inline |
Definition at line 1042 of file OperationSupport.h.
References successors.
void OperationState::addSuccessors | ( | BlockRange | newSuccessors | ) |
Definition at line 216 of file OperationSupport.cpp.
References successors.
Definition at line 1018 of file OperationSupport.h.
References types.
Referenced by buildConvOpWithQuantInfo(), buildFCOpWithQuantInfo(), buildMatMulOpWithQuantInfo(), buildTransConvOpWithQuantInfo(), parseArithmeticExtendedBinaryOp(), parseCallTypeAndResolveOperands(), parseCmpOp(), parseDstStyleOp(), parseNamedStructuredOp(), and parseOneResultSameOperandTypeOp().
|
inline |
Definition at line 1023 of file OperationSupport.h.
References types.
|
inline |
Get the context held by this operation state.
Definition at line 1060 of file OperationSupport.h.
References mlir::Attribute::getContext(), and location.
Referenced by addAttribute().
|
inline |
Get (or create) a properties of the provided type to be set on the operation on creation.
Definition at line 992 of file OperationSupport.h.
References mlir::OpaqueProperties::as().
Referenced by mlir::Op< ConcreteType, Traits >::parseProperties().
|
inline |
Definition at line 1008 of file OperationSupport.h.
|
default |
|
default |
LogicalResult OperationState::setProperties | ( | Operation * | op, |
function_ref< InFlightDiagnostic()> | emitError | ||
) | const |
Definition at line 201 of file OperationSupport.cpp.
Definition at line 969 of file OperationSupport.h.
NamedAttrList mlir::OperationState::attributes |
Definition at line 952 of file OperationSupport.h.
Referenced by addAttribute(), addAttributes(), mlir::affine::AffineDmaStartOp::parse(), mlir::affine::AffineDmaWaitOp::parse(), parseAffineMinMaxOp(), parseArithmeticExtendedBinaryOp(), parseBound(), parseCmpOp(), parseCommonStructuredOpParts(), parseDstStyleOp(), mlir::function_interface_impl::parseFunctionOp(), parseNamedStructuredOp(), and parseOneResultSameOperandTypeOp().
Location mlir::OperationState::location |
Definition at line 947 of file OperationSupport.h.
Referenced by addBodyWithPayloadOp(), and getContext().
OperationName mlir::OperationState::name |
Definition at line 948 of file OperationSupport.h.
Referenced by addAttribute(), mlir::OpState::parse(), parseBound(), parseCommonStructuredOpParts(), and parseOptionalInterchange().
SmallVector<Value, 4> mlir::OperationState::operands |
Definition at line 949 of file OperationSupport.h.
Referenced by addOperands(), mlir::affine::AffineDmaStartOp::parse(), mlir::affine::AffineDmaWaitOp::parse(), parseAffineMinMaxOp(), parseArithmeticExtendedBinaryOp(), parseBound(), parseCallTypeAndResolveOperands(), parseCmpOp(), parseCommonStructuredOpParts(), and parseOneResultSameOperandTypeOp().
Attribute mlir::OperationState::propertiesAttr |
Definition at line 961 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 956 of file OperationSupport.h.
Referenced by addRegion(), addRegions(), and OperationState().
SmallVector<Block *, 1> mlir::OperationState::successors |
Successors of this operation and their respective operands.
Definition at line 954 of file OperationSupport.h.
Referenced by addSuccessors().
SmallVector<Type, 4> mlir::OperationState::types |
Types of the results of this operation.
Definition at line 951 of file OperationSupport.h.
Referenced by addTypes(), buildAvgPool2dOpWithQuantInfo(), buildExplicitValuePadOpWithQuantInfo(), buildPadOpWithQuantInfo(), buildUnaryOpWithQuantInfo(), parseAffineMinMaxOp(), and parseOneResultSameOperandTypeOp().