MLIR
15.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={}) | |
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... | |
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 606 of file OperationSupport.h.
OperationState::OperationState | ( | Location | location, |
StringRef | name | ||
) |
Definition at line 167 of file OperationSupport.cpp.
OperationState::OperationState | ( | Location | location, |
OperationName | name | ||
) |
Definition at line 170 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 173 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 186 of file OperationSupport.cpp.
Add an attribute with the specified name.
Definition at line 643 of file OperationSupport.h.
Referenced by mlir::function_interface_impl::addArgAndResultAttrs(), mlir::gpu::addAsyncDependency(), mlir::AffineDmaStartOp::build(), mlir::AffineDmaWaitOp::build(), buildAvgPool2dOpWithQuantInfo(), buildConvOpWithQuantInfo(), buildExplicitValuePadOpWithQuantInfo(), buildFCOpWithQuantInfo(), buildLLVMFunctionType(), mlir::scf::buildLoopNest(), buildMatMulOpWithQuantInfo(), buildPadOpWithQuantInfo(), buildStructuredOp(), buildTransConvOpWithQuantInfo(), buildUnaryOpWithQuantInfo(), computeCollapsedType(), computeTensorReshapeCollapsedType(), eachHasOnlyOneOfTypes(), extractVectorElementType(), mlir::AffineDmaWaitOp::fold(), foldTransferInBoundsAttribute(), getLoadStoreElementType(), hasOneBranchOpTo(), inferStridedSliceOpResultType(), mlir::scf::insideMutuallyExclusiveBranches(), isComputeOperation(), isIntegerPtxType(), isZeroAttribute(), lookupSymbolInModule(), FoldLaunchArguments::matchAndRewrite(), CanonicalizeSingleResultAffineMinMaxOp< T >::matchAndRewrite(), mlirOperationCreate(), parseAttributions(), parseBound(), parseCommonStructuredOpParts(), parseControlAttribute(), parseEnumKeywordAttr(), parseEnumStrAttr(), mlir::function_interface_impl::parseFunctionOp(), parseGlobalMemrefOpTypeAndInitialValue(), parseOptionalLLVMKeyword(), parseSizeAssignment(), mlir::bufferization::populateDynamicDimSizes(), printLaunchFuncOperands(), printTransferAttrs(), mlir::replaceForOpWithNewYields(), verifyAtomicCompareExchangeImpl(), verifyConstantType(), verifyCoopMatrixMulAdd(), verifyMemoryOpIndexing(), verifyMemoryOpMetadata(), and verifyVectorMemoryOp().
Add an attribute with the specified name.
Definition at line 648 of file OperationSupport.h.
|
inline |
Add an array of named attributes.
Definition at line 653 of file OperationSupport.h.
Referenced by buildStructuredOp(), mlir::tensor::createCanonicalRankReducingExtractSliceOp(), extractOpcode(), extractVectorElementType(), foldMemRefCast(), getGenericEffectsImpl(), getLoadStoreElementType(), isZeroAttribute(), parseGlobalMemrefOpTypeAndInitialValue(), parseInferType(), printAtomicReductionRegion(), printLaunchFuncOperands(), verifySynchronizationHint(), and verifyTensorReshapeOp().
void OperationState::addOperands | ( | ValueRange | newOperands | ) |
Definition at line 194 of file OperationSupport.cpp.
References operands.
Referenced by mlir::gpu::addAsyncDependency(), mlir::AffineDmaStartOp::build(), mlir::AffineDmaWaitOp::build(), buildAvgPool2dOpWithQuantInfo(), buildConvOpWithQuantInfo(), buildExplicitValuePadOpWithQuantInfo(), buildFCOpWithQuantInfo(), buildLogicalUnaryOp(), mlir::scf::buildLoopNest(), buildMatMulOpWithQuantInfo(), buildPadOpWithQuantInfo(), buildStructuredOp(), buildTransConvOpWithQuantInfo(), buildUnaryOpWithQuantInfo(), computeMemRefRankReductionMask(), eachHasOnlyOneOfTypes(), extractOpcode(), extractVectorElementType(), mlir::AffineDmaWaitOp::fold(), getLLVMAtomicOrdering(), getLoadStoreElementType(), mlir::scf::getParallelForInductionVarOwner(), inferStridedSliceOpResultType(), mlir::scf::insideMutuallyExclusiveBranches(), isIntegerPtxType(), isMemRefNormalizable(), joinShapes(), makeI64ArrayAttr(), FoldLaunchArguments::matchAndRewrite(), CanonicalizeContractAdd< AddOpType >::matchAndRewrite(), CanonicalizeSingleResultAffineMinMaxOp< T >::matchAndRewrite(), mlirOperationCreate(), mlir::replaceForOpWithNewYields(), verifyAtomicCompareExchangeImpl(), verifyMemoryOpIndexing(), verifyMemoryOpMetadata(), and verifyVectorMemoryOp().
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 202 of file OperationSupport.cpp.
References regions.
Referenced by mlir::gpu::addAsyncDependency(), addRegions(), mlir::scf::buildLoopNest(), buildStructuredOp(), computeMemRefRankReductionMask(), eachHasOnlyOneOfTypes(), mlir::AffineDmaWaitOp::fold(), foldMemRefCast(), mlir::scf::getForeachThreadOpThreadIndexOwner(), mlir::scf::getParallelForInductionVarOwner(), hasOneBranchOpTo(), mlir::scf::insideMutuallyExclusiveBranches(), isZeroAttribute(), lookupSymbolInModule(), CanonicalizeSingleResultAffineMinMaxOp< T >::matchAndRewrite(), mlirOperationCreate(), parseAttributions(), parseBound(), mlir::function_interface_impl::parseFunctionOp(), parseNamedStructuredOp(), parseOptionalLLVMKeyword(), parseRegions(), parseSizeAssignment(), printCreateOperationOpResults(), printInitializationList(), printLaunchFuncOperands(), mlir::replaceForOpWithNewYields(), replaceOpWithRegion(), verifyAllocLikeOp(), verifyAttributions(), verifyConstantType(), and verifyCoopMatrixMulAdd().
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 211 of file OperationSupport.cpp.
References addRegion(), and regions.
Definition at line 657 of file OperationSupport.h.
Referenced by getLoadStoreElementType(), mlirOperationCreate(), printCreateOperationOpResults(), and verifyAtomicCompareExchangeImpl().
void OperationState::addSuccessors | ( | BlockRange | newSuccessors | ) |
Definition at line 198 of file OperationSupport.cpp.
References successors.
Definition at line 633 of file OperationSupport.h.
References value.
Referenced by buildConvOpWithQuantInfo(), buildFCOpWithQuantInfo(), buildLogicalUnaryOp(), mlir::scf::buildLoopNest(), buildMatMulOpWithQuantInfo(), buildStructuredOp(), buildTransConvOpWithQuantInfo(), computeMemRefRankReductionMask(), eachHasOnlyOneOfTypes(), extractOpcode(), extractVectorElementType(), mlir::AffineDmaWaitOp::fold(), foldMemRefCast(), getElementPtrType(), getInsertExtractValueElementType(), getLLVMAtomicOrdering(), getLoadStoreElementType(), mlir::scf::getParallelForInductionVarOwner(), hasOneBranchOpTo(), inferStridedSliceOpResultType(), mlir::scf::insideMutuallyExclusiveBranches(), isZeroAttribute(), joinShapes(), CanonicalizeContractAdd< AddOpType >::matchAndRewrite(), SelectToExtUI::matchAndRewrite(), CanonicalizeSingleResultAffineMinMaxOp< T >::matchAndRewrite(), mlirOperationCreate(), parseNamedStructuredOp(), parseOneResultSameOperandTypeOp(), parsePtrAccessChainOpImpl(), parseTileLikeOp(), mlir::bufferization::populateDynamicDimSizes(), mlir::replaceForOpWithNewYields(), verifyAtomicCompareExchangeImpl(), verifyConstantType(), verifyCoopMatrixMulAdd(), and verifyMemoryOpMetadata().
|
inline |
Definition at line 638 of file OperationSupport.h.
|
inline |
Get the context held by this operation state.
Definition at line 675 of file OperationSupport.h.
References mlir::Attribute::getContext().
Referenced by mlir::Operation::create(), and inferOperationTypes().
NamedAttrList mlir::OperationState::attributes |
Definition at line 612 of file OperationSupport.h.
Referenced by mlir::scf::buildLoopNest(), buildStructuredOp(), computeMemRefRankReductionMask(), mlir::Operation::create(), eachHasOnlyOneOfTypes(), foldMemRefCast(), foldTransferInBoundsAttribute(), mlir::scf::getForeachThreadOpThreadIndexOwner(), getGenericEffectsImpl(), getInsertExtractValueElementType(), getLoadStoreElementType(), mlir::scf::getParallelForInductionVarOwner(), hasOneBranchOpTo(), inferOperationTypes(), mlir::scf::insideMutuallyExclusiveBranches(), isComputeOperation(), isZeroAttribute(), lookupSymbolInModule(), SelectToExtUI::matchAndRewrite(), CanonicalizeSingleResultAffineMinMaxOp< T >::matchAndRewrite(), mlirOperationCreate(), mlir::AffineDmaStartOp::parse(), mlir::AffineDmaWaitOp::parse(), parseAffineMinMaxOp(), parseAttributions(), parseBound(), parseCommonStructuredOpParts(), mlir::function_interface_impl::parseFunctionOp(), parseGlobalMemrefOpTypeAndInitialValue(), parseMemoryAccessAttributes(), parseNamedStructuredOp(), parseOneResultSameOperandTypeOp(), parseOptionalLLVMKeyword(), parseSizeAssignment(), parseSourceMemoryAccessAttributes(), parseTileLikeOp(), parseVariableDecorations(), mlir::bufferization::populateDynamicDimSizes(), printCreateOperationOpResults(), printInitializationList(), printNVVMIntrinsicOp(), printTransferAttrs(), mlir::replaceForOpWithNewYields(), replaceOpWithRegion(), verifyAllocLikeOp(), verifyAtomicCompareExchangeImpl(), verifyAttributions(), verifyConstantType(), verifyCoopMatrixMulAdd(), verifyDimAndSymbolIdentifiers(), verifyMemoryOpIndexing(), and verifyVectorMemoryOp().
Location mlir::OperationState::location |
Definition at line 607 of file OperationSupport.h.
Referenced by mlir::gpu::addAsyncDependency(), mlir::scf::buildLoopNest(), concatElemAndIndices(), mlir::Operation::create(), eachHasOnlyOneOfTypes(), mlir::AffineDmaWaitOp::fold(), foldExtractStridedOpFromInsertChain(), foldMemRefCast(), getElementPtrType(), mlir::scf::getParallelForInductionVarOwner(), inferOperationTypes(), mlir::scf::insideMutuallyExclusiveBranches(), joinShapes(), AllocaScopeHoister::matchAndRewrite(), CanonicalizeSingleResultAffineMinMaxOp< T >::matchAndRewrite(), parseBound(), parsePtrAccessChainOpImpl(), printCreateOperationOpResults(), printInitializationList(), printLaunchFuncOperands(), mlir::replaceForOpWithNewYields(), verifyAllocLikeOp(), verifyAtomicCompareExchangeImpl(), verifyAttributions(), and verifyCoopMatrixMulAdd().
OperationName mlir::OperationState::name |
Definition at line 608 of file OperationSupport.h.
Referenced by buildLLVMFunctionType(), mlir::Operation::create(), inferOperationTypes(), isZeroAttribute(), lookupSymbolInModule(), mlir::OpState::parse(), parseOptionalLLVMKeyword(), and parseTileLikeOp().
SmallVector<Value, 4> mlir::OperationState::operands |
Definition at line 609 of file OperationSupport.h.
Referenced by addOperands(), mlir::scf::buildLoopNest(), computeMemRefRankReductionMask(), mlir::Operation::create(), eachHasOnlyOneOfTypes(), foldTransferInBoundsAttribute(), getElementPtrType(), getGenericEffectsImpl(), getInsertExtractValueElementType(), getLoadStoreElementType(), mlir::scf::getParallelForInductionVarOwner(), hasOneBranchOpTo(), inferOperationTypes(), mlir::scf::insideMutuallyExclusiveBranches(), isZeroAttribute(), SelectToExtUI::matchAndRewrite(), CanonicalizeSingleResultAffineMinMaxOp< T >::matchAndRewrite(), mlir::AffineDmaStartOp::parse(), mlir::AffineDmaWaitOp::parse(), parseAffineMinMaxOp(), parseAtomicCompareExchangeImpl(), parseAtomicUpdateOp(), parseBound(), parseCommonStructuredOpParts(), parseGlobalMemrefOpTypeAndInitialValue(), parseGroupNonUniformArithmeticOp(), parseOneResultSameOperandTypeOp(), parseOperandAndType(), parseOperandList(), parseOptionalOperand(), parsePtrAccessChainOpImpl(), parseSizeAssignment(), parseTileLikeOp(), mlir::bufferization::populateDynamicDimSizes(), printCreateOperationOpResults(), printInitializationList(), printNVVMIntrinsicOp(), printTransferAttrs(), mlir::replaceAllMemRefUsesWith(), mlir::replaceForOpWithNewYields(), verifyAtomicCompareExchangeImpl(), verifyConstantType(), verifyCoopMatrixMulAdd(), verifyDimAndSymbolIdentifiers(), verifyMemoryOpIndexing(), verifyPointerAndCoopMatrixType(), and verifyVectorMemoryOp().
SmallVector<std::unique_ptr<Region>, 1> mlir::OperationState::regions |
Regions that the op will hold.
Definition at line 616 of file OperationSupport.h.
Referenced by addRegion(), addRegions(), mlir::Operation::create(), eachHasOnlyOneOfTypes(), foldMemRefCast(), inferOperationTypes(), mlir::scf::insideMutuallyExclusiveBranches(), joinShapes(), OperationState(), printCreateOperationOpResults(), mlir::replaceForOpWithNewYields(), verifyAllocLikeOp(), and verifyResultTypesAreInferrable().
SmallVector<Block *, 1> mlir::OperationState::successors |
Successors of this operation and their respective operands.
Definition at line 614 of file OperationSupport.h.
Referenced by addSuccessors(), and mlir::Operation::create().
SmallVector<Type, 4> mlir::OperationState::types |
Types of the results of this operation.
Definition at line 611 of file OperationSupport.h.
Referenced by mlir::gpu::addAsyncDependency(), buildAvgPool2dOpWithQuantInfo(), buildExplicitValuePadOpWithQuantInfo(), mlir::scf::buildLoopNest(), buildPadOpWithQuantInfo(), buildUnaryOpWithQuantInfo(), computeMemRefRankReductionMask(), mlir::Operation::create(), eachHasOnlyOneOfTypes(), foldTransferInBoundsAttribute(), inferOperationTypes(), mlir::scf::insideMutuallyExclusiveBranches(), isComputeOperation(), FoldLaunchArguments::matchAndRewrite(), mlirOperationCreate(), parseAffineMinMaxOp(), parseAtomicCompareExchangeImpl(), parseAtomicUpdateOp(), parseBound(), parseGroupNonUniformArithmeticOp(), parseOneResultSameOperandTypeOp(), parseSizeAssignment(), printInitializationList(), printNVVMIntrinsicOp(), printTransferAttrs(), mlir::replaceForOpWithNewYields(), replaceOpWithRegion(), verifyAllocLikeOp(), verifyAtomicCompareExchangeImpl(), and verifyDimAndSymbolIdentifiers().