MLIR
20.0.0git
|
Operation is the basic unit of execution within MLIR. More...
#include "mlir/IR/Operation.h"
Classes | |
class | CloneOptions |
Class encompassing various options related to cloning an operation. More... | |
class | dialect_attr_iterator |
A utility iterator that filters out non-dialect attributes. More... | |
Public Types | |
using | operand_range = OperandRange |
using | operand_iterator = operand_range::iterator |
using | operand_type_iterator = operand_range::type_iterator |
using | operand_type_range = operand_range::type_range |
using | result_range = ResultRange |
Support result iteration. More... | |
using | result_iterator = result_range::iterator |
using | result_type_iterator = result_range::type_iterator |
Support result type iteration. More... | |
using | result_type_range = result_range::type_range |
using | dialect_attr_range = iterator_range< dialect_attr_iterator > |
using | succ_iterator = SuccessorRange::iterator |
using | use_iterator = result_range::use_iterator |
using | use_range = result_range::use_range |
using | user_iterator = ValueUserIterator< use_iterator, OpOperand > |
using | user_range = iterator_range< user_iterator > |
Public Member Functions | |
OperationName | getName () |
The name of an operation is the key identifier for it. More... | |
std::optional< RegisteredOperationName > | getRegisteredInfo () |
If this operation has a registered operation description, return it. More... | |
bool | isRegistered () |
Returns true if this operation has a registered operation description, otherwise false. More... | |
void | erase () |
Remove this operation from its parent block and delete it. More... | |
void | remove () |
Remove the operation from its parent block, but don't delete it. More... | |
Operation * | clone (IRMapping &mapper, CloneOptions options=CloneOptions::all()) |
Create a deep copy of this operation, remapping any operands that use values outside of the operation using the map that is provided (leaving them alone if no entry is present). More... | |
Operation * | clone (CloneOptions options=CloneOptions::all()) |
Operation * | cloneWithoutRegions (IRMapping &mapper) |
Create a partial copy of this operation without traversing into attached regions. More... | |
Operation * | cloneWithoutRegions () |
Create a partial copy of this operation without traversing into attached regions. More... | |
Block * | getBlock () |
Returns the operation block that contains this operation. More... | |
MLIRContext * | getContext () |
Return the context this operation is associated with. More... | |
Dialect * | getDialect () |
Return the dialect this operation is associated with, or nullptr if the associated dialect is not loaded. More... | |
Location | getLoc () |
The source location the operation was defined or derived from. More... | |
void | setLoc (Location loc) |
Set the source location the operation was defined or derived from. More... | |
Region * | getParentRegion () |
Returns the region to which the instruction belongs. More... | |
Operation * | getParentOp () |
Returns the closest surrounding operation that contains this operation or nullptr if this is a top-level operation. More... | |
template<typename OpTy > | |
OpTy | getParentOfType () |
Return the closest surrounding parent operation that is of type 'OpTy'. More... | |
template<template< typename T > class Trait> | |
Operation * | getParentWithTrait () |
Returns the closest surrounding parent operation with trait Trait . More... | |
bool | isProperAncestor (Operation *other) |
Return true if this operation is a proper ancestor of the other operation. More... | |
bool | isAncestor (Operation *other) |
Return true if this operation is an ancestor of the other operation. More... | |
void | replaceUsesOfWith (Value from, Value to) |
Replace any uses of 'from' with 'to' within this operation. More... | |
template<typename ValuesT > | |
void | replaceAllUsesWith (ValuesT &&values) |
Replace all uses of results of this operation with the provided 'values'. More... | |
template<typename ValuesT > | |
void | replaceUsesWithIf (ValuesT &&values, function_ref< bool(OpOperand &)> shouldReplace) |
Replace uses of results of this operation with the provided values if the given callback returns true. More... | |
void | destroy () |
Destroys this operation and its subclass data. More... | |
void | dropAllReferences () |
This drops all operand uses from this operation, which is an essential step in breaking cyclic dependences between references when they are to be deleted. More... | |
void | dropAllDefinedValueUses () |
Drop uses of all values defined by this operation or its nested regions. More... | |
void | moveBefore (Operation *existingOp) |
Unlink this operation from its current block and insert it right before existingOp which may be in the same or another block in the same function. More... | |
void | moveBefore (Block *block, llvm::iplist< Operation >::iterator iterator) |
Unlink this operation from its current block and insert it right before iterator in the specified block. More... | |
void | moveAfter (Operation *existingOp) |
Unlink this operation from its current block and insert it right after existingOp which may be in the same or another block in the same function. More... | |
void | moveAfter (Block *block, llvm::iplist< Operation >::iterator iterator) |
Unlink this operation from its current block and insert it right after iterator in the specified block. More... | |
bool | isBeforeInBlock (Operation *other) |
Given an operation 'other' that is within the same parent block, return whether the current operation is before 'other' in the operation list of the parent block. More... | |
void | print (raw_ostream &os, const OpPrintingFlags &flags=std::nullopt) |
void | print (raw_ostream &os, AsmState &state) |
void | dump () |
void | setOperands (ValueRange operands) |
Replace the current operands of this operation with the ones provided in 'operands'. More... | |
void | setOperands (unsigned start, unsigned length, ValueRange operands) |
Replace the operands beginning at 'start' and ending at 'start' + 'length' with the ones provided in 'operands'. More... | |
void | insertOperands (unsigned index, ValueRange operands) |
Insert the given operands into the operand list at the given 'index'. More... | |
unsigned | getNumOperands () |
Value | getOperand (unsigned idx) |
void | setOperand (unsigned idx, Value value) |
void | eraseOperand (unsigned idx) |
Erase the operand at position idx . More... | |
void | eraseOperands (unsigned idx, unsigned length=1) |
Erase the operands starting at position idx and ending at position 'idx'+'length'. More... | |
void | eraseOperands (const BitVector &eraseIndices) |
Erases the operands that have their corresponding bit set in eraseIndices and removes them from the operand list. More... | |
operand_iterator | operand_begin () |
operand_iterator | operand_end () |
operand_range | getOperands () |
Returns an iterator on the underlying Value's. More... | |
MutableArrayRef< OpOperand > | getOpOperands () |
OpOperand & | getOpOperand (unsigned idx) |
operand_type_iterator | operand_type_begin () |
operand_type_iterator | operand_type_end () |
operand_type_range | getOperandTypes () |
unsigned | getNumResults () |
Return the number of results held by this operation. More... | |
OpResult | getResult (unsigned idx) |
Get the 'idx'th result of this operation. More... | |
result_iterator | result_begin () |
result_iterator | result_end () |
result_range | getResults () |
result_range | getOpResults () |
OpResult | getOpResult (unsigned idx) |
result_type_iterator | result_type_begin () |
result_type_iterator | result_type_end () |
result_type_range | getResultTypes () |
std::optional< Attribute > | getInherentAttr (StringRef name) |
Access an inherent attribute by name: returns an empty optional if there is no inherent attribute with this name. More... | |
void | setInherentAttr (StringAttr name, Attribute value) |
Set an inherent attribute by name. More... | |
Attribute | getDiscardableAttr (StringRef name) |
Access a discardable attribute by name, returns an null Attribute if the discardable attribute does not exist. More... | |
Attribute | getDiscardableAttr (StringAttr name) |
Access a discardable attribute by name, returns an null Attribute if the discardable attribute does not exist. More... | |
void | setDiscardableAttr (StringAttr name, Attribute value) |
Set a discardable attribute by name. More... | |
void | setDiscardableAttr (StringRef name, Attribute value) |
Attribute | removeDiscardableAttr (StringAttr name) |
Remove the discardable attribute with the specified name if it exists. More... | |
Attribute | removeDiscardableAttr (StringRef name) |
auto | getDiscardableAttrs () |
Return a range of all of discardable attributes on this operation. More... | |
DictionaryAttr | getDiscardableAttrDictionary () |
Return all of the discardable attributes on this operation as a DictionaryAttr. More... | |
DictionaryAttr | getRawDictionaryAttrs () |
Return all attributes that are not stored as properties. More... | |
ArrayRef< NamedAttribute > | getAttrs () |
Return all of the attributes on this operation. More... | |
DictionaryAttr | getAttrDictionary () |
Return all of the attributes on this operation as a DictionaryAttr. More... | |
void | setAttrs (DictionaryAttr newAttrs) |
Set the attributes from a dictionary on this operation. More... | |
void | setAttrs (ArrayRef< NamedAttribute > newAttrs) |
void | setDiscardableAttrs (DictionaryAttr newAttrs) |
Set the discardable attribute dictionary on this operation. More... | |
void | setDiscardableAttrs (ArrayRef< NamedAttribute > newAttrs) |
Attribute | getAttr (StringAttr name) |
Return the specified attribute if present, null otherwise. More... | |
Attribute | getAttr (StringRef name) |
template<typename AttrClass > | |
AttrClass | getAttrOfType (StringAttr name) |
template<typename AttrClass > | |
AttrClass | getAttrOfType (StringRef name) |
bool | hasAttr (StringAttr name) |
Return true if the operation has an attribute with the provided name, false otherwise. More... | |
bool | hasAttr (StringRef name) |
template<typename AttrClass , typename NameT > | |
bool | hasAttrOfType (NameT &&name) |
void | setAttr (StringAttr name, Attribute value) |
If the an attribute exists with the specified name, change it to the new value. More... | |
void | setAttr (StringRef name, Attribute value) |
Attribute | removeAttr (StringAttr name) |
Remove the attribute with the specified name if it exists. More... | |
Attribute | removeAttr (StringRef name) |
dialect_attr_range | getDialectAttrs () |
Return a range corresponding to the dialect attributes for this operation. More... | |
dialect_attr_iterator | dialect_attr_begin () |
dialect_attr_iterator | dialect_attr_end () |
template<typename DialectAttrT > | |
void | setDialectAttrs (DialectAttrT &&dialectAttrs) |
Set the dialect attributes for this operation, and preserve all inherent. More... | |
void | populateDefaultAttrs () |
Sets default attributes on unset attributes. More... | |
unsigned | getNumRegions () |
Returns the number of regions held by this operation. More... | |
MutableArrayRef< Region > | getRegions () |
Returns the regions held by this operation. More... | |
Region & | getRegion (unsigned index) |
Returns the region held by this operation at position 'index'. More... | |
MutableArrayRef< BlockOperand > | getBlockOperands () |
succ_iterator | successor_begin () |
succ_iterator | successor_end () |
SuccessorRange | getSuccessors () |
bool | hasSuccessors () |
unsigned | getNumSuccessors () |
Block * | getSuccessor (unsigned index) |
void | setSuccessor (Block *block, unsigned index) |
LogicalResult | fold (ArrayRef< Attribute > operands, SmallVectorImpl< OpFoldResult > &results) |
Attempt to fold this operation with the specified constant operand values. More... | |
LogicalResult | fold (SmallVectorImpl< OpFoldResult > &results) |
Attempt to fold this operation. More... | |
template<typename InterfaceT > | |
bool | hasPromiseOrImplementsInterface () const |
Returns true if InterfaceT has been promised by the dialect or implemented. More... | |
template<template< typename T > class Trait> | |
bool | hasTrait () |
Returns true if the operation was registered with a particular trait, e.g. More... | |
template<template< typename T > class Trait> | |
bool | mightHaveTrait () |
Returns true if the operation might have the provided trait. More... | |
template<WalkOrder Order = WalkOrder::PostOrder, typename Iterator = ForwardIterator, typename FnT , typename RetT = detail::walkResultType<FnT>> | |
std::enable_if_t< llvm::function_traits< std::decay_t< FnT > >::num_args==1, RetT > | walk (FnT &&callback) |
Walk the operation by calling the callback for each nested operation (including this one), block or region, depending on the callback provided. More... | |
template<typename FnT , typename RetT = detail::walkResultType<FnT>> | |
std::enable_if_t< llvm::function_traits< std::decay_t< FnT > >::num_args==2, RetT > | walk (FnT &&callback) |
Generic walker with a stage aware callback. More... | |
void | dropAllUses () |
Drop all uses of results of this operation. More... | |
use_iterator | use_begin () |
use_iterator | use_end () |
use_range | getUses () |
Returns a range of all uses, which is useful for iterating over all uses. More... | |
bool | hasOneUse () |
Returns true if this operation has exactly one use. More... | |
bool | use_empty () |
Returns true if this operation has no uses. More... | |
bool | isUsedOutsideOfBlock (Block *block) |
Returns true if the results of this operation are used outside of the given block. More... | |
user_iterator | user_begin () |
user_iterator | user_end () |
user_range | getUsers () |
Returns a range of all users. More... | |
InFlightDiagnostic | emitOpError (const Twine &message={}) |
Emit an error with the op name prefixed, like "'dim' op " which is convenient for verifiers. More... | |
InFlightDiagnostic | emitError (const Twine &message={}) |
Emit an error about fatal conditions with this operation, reporting up to any diagnostic handlers that may be listening. More... | |
InFlightDiagnostic | emitWarning (const Twine &message={}) |
Emit a warning about this operation, reporting up to any diagnostic handlers that may be listening. More... | |
InFlightDiagnostic | emitRemark (const Twine &message={}) |
Emit a remark about this operation, reporting up to any diagnostic handlers that may be listening. More... | |
int | getPropertiesStorageSize () const |
Returns the properties storage size. More... | |
OpaqueProperties | getPropertiesStorage () |
Returns the properties storage. More... | |
OpaqueProperties | getPropertiesStorage () const |
OpaqueProperties | getPropertiesStorageUnsafe () |
Returns the properties storage without checking whether properties are present. More... | |
Attribute | getPropertiesAsAttribute () |
Return the properties converted to an attribute. More... | |
LogicalResult | setPropertiesFromAttribute (Attribute attr, function_ref< InFlightDiagnostic()> emitError) |
Set the properties from the provided attribute. More... | |
void | copyProperties (OpaqueProperties rhs) |
Copy properties from an existing other properties object. More... | |
llvm::hash_code | hashProperties () |
Compute a hash for the op properties (if any). More... | |
Static Public Member Functions | |
static Operation * | create (Location location, OperationName name, TypeRange resultTypes, ValueRange operands, NamedAttrList &&attributes, OpaqueProperties properties, BlockRange successors, unsigned numRegions) |
Create a new Operation with the specific fields. More... | |
static Operation * | create (Location location, OperationName name, TypeRange resultTypes, ValueRange operands, DictionaryAttr attributes, OpaqueProperties properties, BlockRange successors, unsigned numRegions) |
Create a new Operation with the specific fields. More... | |
static Operation * | create (const OperationState &state) |
Create a new Operation from the fields stored in state . More... | |
static Operation * | create (Location location, OperationName name, TypeRange resultTypes, ValueRange operands, NamedAttrList &&attributes, OpaqueProperties properties, BlockRange successors={}, RegionRange regions={}) |
Create a new Operation with the specific fields. More... | |
Friends | |
struct | llvm::ilist_traits< Operation > |
class | Block |
class | Value |
class | llvm::ilist_node_with_parent< Operation, Block > |
Operation is the basic unit of execution within MLIR.
The following documentation are recommended to understand this class:
An Operation is defined first by its name, which is a unique string. The name is interpreted so that if it contains a '.' character, the part before is the dialect name this operation belongs to, and everything that follows is this operation name within the dialect.
An Operation defines zero or more SSA Value
that we refer to as the Operation results. This array of Value is actually stored in memory before the Operation itself in reverse order. That is for an Operation with 3 results we allocate the following memory layout:
[Result2, Result1, Result0, Operation] ^ this is where Operation*
pointer points to.
A consequence of this is that this class must be heap allocated, which is handled by the various create
methods. Each result contains:
OpOperand
)ValueImpl
, and more precisely as the only two subclasses of OpResultImpl
: InlineOpResult
and OutOfLineOpResult
. The former is used for the first 5 results and the latter for the subsequent ones. They differ in how they store their index: the first 5 results only need 3 bits and thus are packed with the Type pointer, while the subsequent one have an extra unsigned
value and thus need more space.An Operation also has zero or more operands: these are uses of SSA Value, which can be the results of other operations or Block arguments. Each of these uses is an instance of OpOperand
. This optional array is initially tail allocated with the operation class itself, but can be dynamically moved out-of-line in a dynamic allocation as needed.
An Operation may contain optionally one or multiple Regions, stored in a tail allocated array. Each Region
is a list of Blocks. Each Block
is itself a list of Operations. This structure is effectively forming a tree.
Some operations like branches also refer to other Block, in which case they would have an array of BlockOperand
.
An Operation may contain optionally a "Properties" object: this is a pre-defined C++ object with a fixed size. This object is owned by the operation and deleted with the operation. It can be converted to an Attribute on demand, or loaded from an Attribute.
Finally an Operation also contain an optional DictionaryAttr
, a Location, and a pointer to its parent Block (if any).
Definition at line 84 of file Operation.h.
Definition at line 629 of file Operation.h.
using mlir::Operation::operand_iterator = operand_range::iterator |
Definition at line 367 of file Operation.h.
Definition at line 366 of file Operation.h.
Definition at line 388 of file Operation.h.
Definition at line 389 of file Operation.h.
using mlir::Operation::result_iterator = result_range::iterator |
Definition at line 406 of file Operation.h.
Support result iteration.
Definition at line 405 of file Operation.h.
Support result type iteration.
Definition at line 419 of file Operation.h.
Definition at line 420 of file Operation.h.
using mlir::Operation::succ_iterator = SuccessorRange::iterator |
Definition at line 696 of file Operation.h.
Definition at line 835 of file Operation.h.
Definition at line 836 of file Operation.h.
Definition at line 862 of file Operation.h.
Definition at line 863 of file Operation.h.
Operation * Operation::clone | ( | CloneOptions | options = CloneOptions::all() | ) |
Definition at line 751 of file Operation.cpp.
Operation * Operation::clone | ( | IRMapping & | mapper, |
CloneOptions | options = CloneOptions::all() |
||
) |
Create a deep copy of this operation, remapping any operands that use values outside of the operation using the map that is provided (leaving them alone if no entry is present).
Replaces references to cloned sub-operations to the corresponding operation that is copied, and adds those mappings to the map. Optionally, one may configure what parts of the operation to clone using the options parameter.
Calling this method from multiple threads is generally safe if through the process of cloning no new uses of 'Value's from outside the operation are created. Cloning an isolated-from-above operation with no operands, such as top level function operations, is therefore always safe. Using the mapper, it is possible to avoid adding uses to outside operands by remapping them to 'Value's owned by the caller thread.
Replaces references to cloned sub-operations to the corresponding operation that is copied, and adds those mappings to the map.
Definition at line 717 of file Operation.cpp.
References mlir::Region::cloneInto(), create(), getLoc(), getName(), getNumOperands(), getNumRegions(), getNumResults(), getNumSuccessors(), getOperands(), getPropertiesStorage(), getRegion(), getResult(), getResultTypes(), getSuccessors(), mlir::IRMapping::lookupOrDefault(), mlir::IRMapping::map(), and options.
Referenced by mlir::applyAnalysisConversion(), clone(), mlir::OpBuilder::clone(), cloneWithoutRegions(), generateUnrolledLoop(), specializeForLoopForUnrolling(), specializeParallelLoopForUnrolling(), and mlir::linalg::splitReductionByScaling().
Operation * Operation::cloneWithoutRegions | ( | ) |
Create a partial copy of this operation without traversing into attached regions.
The new operation will have the same number of regions as the original one, but they will be left empty.
Definition at line 707 of file Operation.cpp.
Create a partial copy of this operation without traversing into attached regions.
Create a deep copy of this operation but keep the operation regions empty.
The new operation will have the same number of regions as the original one, but they will be left empty. Operands are remapped using mapper
(if present), and mapper
is updated to contain the results.
Operands are remapped using mapper
(if present), and mapper
is updated to contain the results. The mapResults
flag specifies whether the results of the cloned operation should be added to the map.
Definition at line 703 of file Operation.cpp.
References mlir::Operation::CloneOptions::all(), and clone().
Referenced by mlir::OpBuilder::cloneWithoutRegions().
void Operation::copyProperties | ( | OpaqueProperties | rhs | ) |
Copy properties from an existing other properties object.
The two objects must be the same type.
Definition at line 366 of file Operation.cpp.
References mlir::OperationName::copyOpProperties(), and getPropertiesStorage().
|
static |
Create a new Operation from the fields stored in state
.
Create a new Operation from operation state.
Definition at line 34 of file Operation.cpp.
|
static |
Create a new Operation with the specific fields.
Overload of create that takes an existing DictionaryAttr to avoid unnecessarily uniquing a list of attributes.
This constructor uses an existing attribute dictionary to avoid uniquing a list of attributes.
Definition at line 82 of file Operation.cpp.
References getBlockOperands(), mlir::OperationName::getOpPropertyByteSize(), getRegion(), mlir::OperationName::hasTrait(), mightHaveTrait(), and setAttrs().
|
static |
Create a new Operation with the specific fields.
This constructor populates the provided attribute list with default attributes if necessary.
Definition at line 67 of file Operation.cpp.
References mlir::Location::getContext(), and mlir::OperationName::populateDefaultAttrs().
Referenced by clone(), create(), createCtlzFunc(), mlir::spirv::Deserializer::processOp< spirv::GenericCastToPtrExplicitOp >(), and mlir::query::extractFunction().
|
static |
Create a new Operation with the specific fields.
Definition at line 51 of file Operation.cpp.
References create(), getRegion(), and mlir::Region::takeBody().
void Operation::destroy | ( | ) |
Destroys this operation and its subclass data.
Destroy this operation or one of its subclasses.
Definition at line 208 of file Operation.cpp.
Referenced by llvm::ilist_traits<::mlir::Operation >::deleteNode(), and erase().
|
inline |
Definition at line 637 of file Operation.h.
References getAttrs().
|
inline |
Definition at line 641 of file Operation.h.
References getAttrs().
void Operation::dropAllDefinedValueUses | ( | ) |
Drop uses of all values defined by this operation or its nested regions.
This drops all uses of any values defined by this operation or its nested regions, wherever they are located.
Definition at line 597 of file Operation.cpp.
References mlir::Block::dropAllDefinedValueUses(), dropAllUses(), and getRegions().
void Operation::dropAllReferences | ( | ) |
This drops all operand uses from this operation, which is an essential step in breaking cyclic dependences between references when they are to be deleted.
Definition at line 584 of file Operation.cpp.
References getBlockOperands(), getOpOperands(), and getRegions().
Referenced by mlir::Block::dropAllReferences(), and mlir::BytecodeReader::Impl::finalize().
|
inline |
Drop all uses of results of this operation.
Definition at line 830 of file Operation.h.
References getOpResults().
Referenced by dropAllDefinedValueUses(), and mlir::detail::ConversionPatternRewriterImpl::SingleEraseRewriter::eraseOp().
void Operation::dump | ( | ) |
Definition at line 3972 of file AsmPrinter.cpp.
References print().
Referenced by mlir::affine::checkMemrefAccessDependence(), mlir::OpState::dump(), mlir::affine::isTilingValid(), and logSucessfulPatternApplication().
InFlightDiagnostic Operation::emitError | ( | const Twine & | message = {} | ) |
Emit an error about fatal conditions with this operation, reporting up to any diagnostic handlers that may be listening.
Definition at line 268 of file Operation.cpp.
References diag(), mlir::emitError(), getContext(), and getLoc().
Referenced by mlir::affine::affineDataCopyGenerate(), mlir::bufferization::allocateTensorForShapedValue(), mlir::NVVM::SerializeGPUModuleBase::appendStandardLibs(), mlir::ROCDL::SerializeGPUModuleBase::appendStandardLibs(), applyTilingToAll(), mlir::transform::applyTransformNamedSequence(), checkAffineLoopNestMappableImpl(), checkAndUpdateCapabilityRequirements(), checkAndUpdateExtensionRequirements(), checkImplementationStatus(), commonVerifierPackAndUnPackOp(), mlir::ROCDL::SerializeGPUModuleBase::compileToBinary(), mlir::affine::MemRefRegion::compute(), convertHostOrTargetOperation(), convertOmpThreadprivate(), mlir::convertVectorToNVVMCompatibleMMASync(), mlir::bufferization::deallocateBuffers(), diagnoseInvalidOperandDominance(), emitOpError(), findPayloadRoot(), mlir::transform::detail::findTransformEntryPoint(), generateLocationsFromIR(), getMemoryFootprintBytes(), getMeshAndVerify(), mlir::LLVM::ModuleToObject::getOrCreateTargetMachine(), mlir::spirv::getPushConstantValue(), getSegmentSizes(), getSegmentSizesFromAttr(), mlir::nvgpu::getWarpMatrixInfo(), handleError(), inferSideEffectAnnotations(), mlir::affine::insertBackwardComputationSlice(), irdlOpVerifier(), mlir::LLVM::ModuleToObject::loadBitcodeFile(), mlir::LLVM::ModuleToObject::loadBitcodeFilesFromList(), mlir::transform::detail::mergeSymbolsInto(), mlirTransformApplyNamedSequence(), mlir::ROCDL::SerializeGPUModuleBase::moduleToObjectImpl(), mlir::LLVM::ModuleToObject::optimizeModule(), printFunctionBody(), produceSliceErrorMsg(), produceSubViewErrorMsg(), mlir::dlti::query(), mlir::LLVM::ModuleToObject::run(), setPropertiesFromAttribute(), mlir::linalg::tileReductionUsingForall(), mlir::detail::verifyBranchSuccessorOperands(), verifyComdat(), mlir::OpTrait::impl::verifyCompatibleOperandBroadcast(), mlir::linalg::detail::verifyContractionInterface(), mlir::linalg::detail::verifyConvolutionInterface(), mlir::detail::verifyDataLayoutOp(), mlir::linalg::detail::verifyFillInterface(), mlir::verifyListOfOperandsOrIntegers(), mlir::spirv::verifyMemorySemantics(), verifyMmaSyncOp(), verifyPackUnPack(), mlir::detail::verifyParallelCombiningOpInterface(), verifyReductionVarList(), mlir::detail::verifyShapedDimOpInterface(), verifyShiftOp(), verifySparsifierGetterSetter(), mlir::detail::verifySymbolTable(), verifyTerminatorSuccessors(), verifyTmaDescriptorWithMemref(), mlir::OpTrait::AtMostOneChildOf< ChildOps >::Impl< ConcreteType >::verifyTrait(), mlir::transform::AtMostOneOpMatcherOpTrait< OpTy >::verifyTrait(), mlir::transform::SingleValueMatcherOpTrait< OpTy >::verifyTrait(), mlir::transform::TransformEachOpTrait< OpTy >::verifyTrait(), mlir::transform::FunctionalStyleTransformOpTrait< OpTy >::verifyTrait(), mlir::transform::NavigationTransformOpTrait< OpTy >::verifyTrait(), mlir::transform::detail::verifyTransformOpInterface(), and walkReferenceCountedValues().
InFlightDiagnostic Operation::emitOpError | ( | const Twine & | message = {} | ) |
Emit an error with the op name prefixed, like "'dim' op " which is convenient for verifiers.
Definition at line 671 of file Operation.cpp.
References emitError(), and getName().
Referenced by mlir::bufferization::bufferizeBlockSignature(), checkFoldResultTypes(), checkSymbolIsTypeOrAttribute(), checkSymOperandList(), checkTransformationPreconditions(), mlir::convertVectorToNVVMCompatibleMMASync(), mlir::ControlFlowToSCFTransformation::createStructuredBranchRegionOp(), mlir::mesh::detail::defaultGetShardingOption(), doVerifyRoundTrip(), mlir::bufferization::OpWithUnstructuredControlFlowBufferizableOpInterfaceExternalModel< ConcreteModel, ConcreteOp >::getBufferType(), irdlOpVerifier(), irdlRegionVerifier(), isArrayOf(), printFunctionBody(), printOperation(), processOperands(), verifyAlignedClause(), verifyAndGetTerminator(), mlir::OpTrait::impl::verifyAtLeastNOperands(), mlir::OpTrait::impl::verifyAtLeastNRegions(), mlir::OpTrait::impl::verifyAtLeastNResults(), mlir::OpTrait::impl::verifyAtLeastNSuccessors(), mlir::spirv::verifyAtomicUpdateOp(), verifyAttributions(), mlir::impl::verifyCastInterfaceOp(), mlir::spirv::verifyCastOp(), verifyCollapsedShape(), mlir::OpTrait::impl::verifyCompatibleOperandBroadcast(), mlir::spirv::verifyCoopMatrixAccess(), verifyCopyprivateVarList(), verifyDependVarList(), mlir::detail::verifyDestinationStyleOpInterface(), mlir::OpTrait::impl::verifyElementwise(), verifyGatherOrScatterDims(), mlir::spirv::verifyGroupNonUniformArithmeticOp(), verifyHasBindingUse(), mlir::detail::verifyInferredResultTypes(), verifyInitializationAttribute(), verifyInitLikeSingleArgRegion(), mlir::spirv::verifyIntegerDotProduct(), mlir::OpTrait::impl::verifyIsTerminator(), verifyKnownLaunchSizeAttr(), mlir::detail::verifyLoopLikeOpInterface(), verifyMemoryOpIndexing(), verifyMultShape(), verifyNontemporalClause(), mlir::OpTrait::impl::verifyNOperands(), mlir::OpTrait::impl::verifyNoRegionArguments(), mlir::OpTrait::impl::verifyNRegions(), mlir::OpTrait::impl::verifyNResults(), mlir::OpTrait::impl::verifyNSuccessors(), verifyNTTOp(), mlir::OpTrait::impl::verifyOneOperand(), mlir::OpTrait::impl::verifyOneRegion(), mlir::OpTrait::impl::verifyOneResult(), mlir::OpTrait::impl::verifyOneSuccessor(), mlir::OpTrait::impl::verifyOperandsAreFloatLike(), mlir::OpTrait::impl::verifyOperandsAreSignlessIntegerLike(), verifyOrderedParent(), mlir::transform::detail::verifyParamProducerTransformOpTrait(), mlir::transform::detail::verifyPossibleTopLevelTransformOpTrait(), verifyReductionVarList(), mlir::OpTrait::SingleBlockImplicitTerminator< TerminatorOpType >::Impl< ConcreteType >::verifyRegionTrait(), mlir::OpTrait::impl::verifyResultsAreBoolLike(), mlir::OpTrait::impl::verifyResultsAreFloatLike(), mlir::OpTrait::impl::verifyResultsAreSignlessIntegerLike(), mlir::OpTrait::impl::verifySameOperandsAndResultElementType(), mlir::OpTrait::impl::verifySameOperandsAndResultRank(), mlir::OpTrait::impl::verifySameOperandsAndResultShape(), mlir::OpTrait::impl::verifySameOperandsAndResultType(), mlir::OpTrait::impl::verifySameOperandsElementType(), mlir::OpTrait::impl::verifySameOperandsShape(), mlir::OpTrait::impl::verifySameTypeOperands(), verifyShapeOrExtentTensorOp(), verifySizeOrIndexOp(), mlir::linalg::detail::verifyStructuredOpInterface(), mlir::transform::detail::verifyStructuredOpPredicateOpTrait(), mlir::detail::verifySymbol(), verifySymbolAttrUse(), mlir::detail::verifySymbolTable(), verifySynchronizationHint(), verifyTileSize(), mlir::OpTrait::tosa::MulOperandsAndResultElementType< ConcreteType >::verifyTrait(), mlir::OpTrait::SingleBlock< ConcreteType >::verifyTrait(), mlir::OpTrait::HasParent< ParentOpTypes >::Impl< ConcreteType >::verifyTrait(), mlir::transform::verifyTransformMatchDimsOp(), verifyTypesAlongAllEdges(), mlir::detail::verifyTypesAlongControlFlowEdges(), mlir::OpTrait::impl::verifyValueSizeAttr(), verifyVectorMemoryOp(), mlir::OpTrait::impl::verifyZeroOperands(), mlir::OpTrait::impl::verifyZeroRegions(), mlir::OpTrait::impl::verifyZeroResults(), mlir::OpTrait::impl::verifyZeroSuccessors(), and visitOp().
InFlightDiagnostic Operation::emitRemark | ( | const Twine & | message = {} | ) |
Emit a remark about this operation, reporting up to any diagnostic handlers that may be listening.
Definition at line 289 of file Operation.cpp.
References diag(), mlir::emitRemark(), getContext(), and getLoc().
Referenced by mlir::ROCDL::SerializeGPUModuleBase::appendStandardLibs(), and emitRemarkForBlock().
InFlightDiagnostic Operation::emitWarning | ( | const Twine & | message = {} | ) |
Emit a warning about this operation, reporting up to any diagnostic handlers that may be listening.
Definition at line 280 of file Operation.cpp.
References diag(), mlir::emitWarning(), getContext(), and getLoc().
Referenced by mlir::affine::affineDataCopyGenerate(), checkImplementationStatus(), getMemoryFootprintBytes(), and setProfilingAttr().
void Operation::erase | ( | ) |
Remove this operation from its parent block and delete it.
Remove this operation (and its descendants) from its Block and delete all of them.
Definition at line 539 of file Operation.cpp.
References destroy(), and getBlock().
Referenced by mlir::affine::affineScalarReplace(), mlir::applyAnalysisConversion(), mlir::collapseParallelLoops(), mlir::OpState::erase(), mlir::SymbolTable::erase(), mlir::RewriterBase::eraseOp(), mlir::BytecodeReader::Impl::finalize(), mlir::affine::normalizeMemRef(), outlineKernelFuncImpl(), specializeForLoopForUnrolling(), specializeParallelLoopForUnrolling(), transformCyclesToSCFLoops(), transformToStructuredCFBranches(), mlir::OpBuilder::tryFold(), and mlir::detail::RecoveryReproducerContext::~RecoveryReproducerContext().
|
inline |
Erase the operand at position idx
.
Definition at line 351 of file Operation.h.
References eraseOperands().
|
inline |
Erases the operands that have their corresponding bit set in eraseIndices
and removes them from the operand list.
Definition at line 361 of file Operation.h.
References mlir::detail::OperandStorage::eraseOperands().
|
inline |
Erase the operands starting at position idx
and ending at position 'idx'+'length'.
Definition at line 355 of file Operation.h.
References mlir::detail::OperandStorage::eraseOperands().
Referenced by mlir::MutableOperandRange::clear(), mlir::MutableOperandRange::erase(), and eraseOperand().
LogicalResult Operation::fold | ( | ArrayRef< Attribute > | operands, |
SmallVectorImpl< OpFoldResult > & | results | ||
) |
Attempt to fold this operation with the specified constant operand values.
Attempt to fold this operation using the Op's registered foldHook.
If folding was successful, this function returns "success".
results
is empty.results
is filled with the folded results. If folding was unsuccessful, this function returns "failure". Definition at line 632 of file Operation.cpp.
References checkFoldResultTypes(), mlir::OperationName::foldHook(), and getDialect().
Referenced by fold(), mlir::detail::constant_op_binder< AttrT >::match(), mlir::OpBuilder::tryFold(), and mlir::dataflow::SparseConstantPropagation::visitOperation().
LogicalResult Operation::fold | ( | SmallVectorImpl< OpFoldResult > & | results | ) |
Attempt to fold this operation.
If folding was successful, this function returns "success".
results
is empty.results
is filled with the folded results. If folding was unsuccessful, this function returns "failure". Definition at line 660 of file Operation.cpp.
References fold(), getNumOperands(), getOperand(), mlir::m_Constant(), and mlir::matchPattern().
|
inline |
Return the specified attribute if present, null otherwise.
These methods are expensive: if the dictionnary only contains discardable attributes, getDiscardableAttr
is more efficient.
Definition at line 529 of file Operation.h.
References getInherentAttr(), and getPropertiesStorageSize().
Referenced by createConstFromIntAttribute(), mlir::LLVM::detail::createIntrinsicCall(), createLinalgBodyCalculationForElementwiseOp(), getAttrOfType(), mlir::spirv::getIntegerDotProductCapabilities(), getSegmentSizesFromAttr(), lookupSymbolInImpl(), setInPlaceOpOperand(), mlir::spirv::verifyIntegerDotProduct(), verifyNamedSequenceOp(), and mlir::detail::verifySymbol().
|
inline |
Definition at line 536 of file Operation.h.
References getInherentAttr(), and getPropertiesStorageSize().
DictionaryAttr Operation::getAttrDictionary | ( | ) |
Return all of the attributes on this operation as a DictionaryAttr.
Definition at line 296 of file Operation.cpp.
References getContext(), mlir::NamedAttrList::getDictionary(), getName(), getPropertiesStorageSize(), and mlir::OperationName::populateInherentAttrs().
Referenced by getAttrs(), irdlOpVerifier(), populateDefaultAttrs(), mlir::detail::AttrTypeReplacerBase< Concrete >::replaceElementsIn(), mlir::dataflow::SparseConstantPropagation::visitOperation(), and walkSymbolRefs().
|
inline |
Definition at line 545 of file Operation.h.
References getAttr().
Referenced by calculateMemoryRequirements(), convertOperationImpl(), createDimGetterFunctionCall(), executeGetOperandsResults(), findPayloadRoot(), mlir::impl::getDataLayoutSpec(), getNameIfSymbol(), mlir::SymbolTable::getSymbolVisibility(), mlir::impl::getTargetSystemSpec(), mlir::spirv::lookupEntryPointABI(), mlir::spirv::lookupTargetEnv(), mlir::detail::AttrOpBinder< AttrT >::match(), printIR(), mlir::spirv::printVariableDecorations(), mlir::spirv::verifyAtomicUpdateOp(), mlir::spirv::verifyGroupNonUniformArithmeticOp(), mlir::detail::verifySymbol(), mlir::detail::verifySymbolTable(), and mlir::OpTrait::impl::verifyValueSizeAttr().
|
inline |
Definition at line 549 of file Operation.h.
References getAttr().
|
inline |
Return all of the attributes on this operation.
Definition at line 507 of file Operation.h.
References getAttrDictionary().
Referenced by cloneOpWithOperandsAndTypes(), mlir::convertOpResultTypes(), dialect_attr_begin(), dialect_attr_end(), mlir::linalg::generateLibraryCallName(), getClosestQueryable(), getDialectAttrs(), mlir::getPrunedAttributeList(), insertCasts(), isLegalOp(), mlirLinalgFillBuiltinNamedOpRegion(), printArithmeticExtendedBinaryOp(), mlir::function_interface_impl::printFunctionAttributes(), printOneResultOp(), printShortForm(), mlir::spirv::printVariableDecorations(), mlir::impl::scalarizeVectorOp(), and setDialectAttrs().
|
inline |
Returns the operation block that contains this operation.
Definition at line 213 of file Operation.h.
Referenced by llvm::ilist_traits<::mlir::Operation >::addNodeToList(), canMakeGroupOpUniform(), canRemoveSrcNodeAfterFusion(), checkAssumptionForFusingConsumer(), constructTiledLoopNest(), diagnoseInvalidOperandDominance(), dominanceSort(), erase(), mlir::Region::findAncestorBlockInRegion(), findInstPosition(), mlir::affine::generateCopyForMemRegion(), generateUnrolledLoop(), getCommonBlockInAffineScope(), getConsumerFromLoopUses(), getEffectsAfter(), getEffectsBefore(), mlir::bufferization::AnalysisState::getEnclosingRepetitiveRegion(), getFirstUserOfLoop(), getPhiIncomingBlock(), getPipelineStages(), mlir::DataFlowSolver::getProgramPointAfter(), mlir::DataFlowSolver::getProgramPointBefore(), mlir::bufferization::BufferPlacementAllocs::getStartOperation(), happensBefore(), mlir::affine::hasNoInterveningEffect(), hasNonAffineUsersOnPath(), hoistAffineIfOp(), mlir::RewriterBase::inlineBlockBefore(), mlir::inlineRegion(), mlir::OperationFolder::insertKnownConstant(), mlir::sparse_tensor::isAdmissibleBranchExp(), mlir::Liveness::isDeadAfter(), mlir::isLegalForBranchOpInterfaceTypeConversionPattern(), mlir::isNotBranchOpInterfaceOrReturnLikeOp(), isOpSibling(), isRegionOrCallableReturn(), mlir::Value::isUsedOutsideOfBlock(), lastNonTerminatorInRegion(), mayExistInterleavedUses(), moveAfter(), moveBefore(), mlir::RewriterBase::moveOpAfter(), mlir::RewriterBase::moveOpBefore(), mlir::OperationFolder::notifyRemoval(), mlir::dataflow::Executable::onUpdate(), printIR(), mlir::dataflow::AbstractDenseForwardDataFlowAnalysis::processOperation(), mlir::dataflow::AbstractDenseBackwardDataFlowAnalysis::processOperation(), mlir::DominanceInfo::properlyDominates(), mlir::detail::DominanceInfoBase< IsPostDom >::properlyDominatesImpl(), remove(), mlir::OpBuilder::setInsertionPoint(), mlir::OpBuilder::setInsertionPointAfter(), transformToReduceLoop(), mlir::OperationFolder::tryToFold(), mlir::OpTrait::impl::verifyIsTerminator(), verifyResultTypesAreInferrable(), and mlir::dataflow::DeadCodeAnalysis::visit().
|
inline |
Definition at line 691 of file Operation.h.
Referenced by create(), dropAllReferences(), getSuccessor(), setSuccessor(), and mlir::SuccessorRange::SuccessorRange().
|
inline |
Return the context this operation is associated with.
Definition at line 216 of file Operation.h.
References mlir::Attribute::getContext().
Referenced by mlir::gpu::addAsyncDependency(), mlir::ROCDL::SerializeGPUModuleBase::addControlVariables(), annotateConflict(), mlir::applyPartialOneToNConversion(), mlir::bufferization::func_ext::FuncOpInterface::bufferize(), collectValidReferencesFor(), mlir::nvgpu::createAsyncGroups(), createNewAliasScopesFromNoAliasParameter(), mlir::detail::defaultOperatesOnDisjointSubset(), mlir::detail::defaultOperatesOnEquivalentSubset(), diagnoseInvalidOperandDominance(), mlir::Inliner::doInlining(), doVerifyRoundTrip(), emitError(), emitRemark(), emitWarning(), findPayloadRoot(), getAttrDictionary(), mlir::affine::getComputationSliceState(), mlir::OpState::getContext(), mlir::Region::getContext(), mlir::Pass::getContext(), mlir::LLVM::ModuleTranslation::getContext(), getDiscardableAttrDictionary(), getElementalFuncTypeForOp(), mlir::mesh::ElementwiseShardingInterface< ElemwiseOp >::getIndexingMaps(), mlir::ROCDL::getKernelMetadata(), getLibraryCallSymbolRef(), mlir::arith::getNeutralElement(), handleInlinedAllocas(), inferSideEffectAnnotations(), mlir::detail::PassCrashReproducerGenerator::initialize(), mlir::SymbolTable::insert(), mlir::NVVM::SerializeGPUModuleBase::loadBitcodeFiles(), mlir::ROCDL::SerializeGPUModuleBase::loadBitcodeFiles(), mlir::SymbolTable::lookup(), mlir::LLVM::lookupOrCreateAlignedAllocFn(), mlir::LLVM::lookupOrCreateFreeFn(), mlir::LLVM::lookupOrCreateGenericAlignedAllocFn(), mlir::LLVM::lookupOrCreateGenericAllocFn(), mlir::LLVM::lookupOrCreateGenericFreeFn(), mlir::LLVM::lookupOrCreateMallocFn(), mlir::LLVM::lookupOrCreateMemRefCopyFn(), mlir::LLVM::lookupOrCreatePrintBF16Fn(), mlir::LLVM::lookupOrCreatePrintCloseFn(), mlir::LLVM::lookupOrCreatePrintCommaFn(), mlir::LLVM::lookupOrCreatePrintF16Fn(), mlir::LLVM::lookupOrCreatePrintF32Fn(), mlir::LLVM::lookupOrCreatePrintF64Fn(), mlir::LLVM::lookupOrCreatePrintI64Fn(), mlir::LLVM::lookupOrCreatePrintNewlineFn(), mlir::LLVM::lookupOrCreatePrintOpenFn(), mlir::LLVM::lookupOrCreatePrintStringFn(), mlir::LLVM::lookupOrCreatePrintU64Fn(), mlir::SymbolTable::lookupSymbolIn(), mlir::spirv::lookupTargetEnvOrDefault(), mlir::PatternApplicator::matchAndRewrite(), mlirLinalgFillBuiltinNamedOpRegion(), mlir::nvgpu::optimizeSharedMemoryReadsAndWrites(), populateDefaultAttrs(), printBlockArgRegion(), printOffloadingHandler(), removeAttr(), removeDiscardableAttr(), mlir::query::MatchQuery::run(), setAttr(), setAttrs(), setDialectAttrs(), setDiscardableAttr(), setDiscardableAttrs(), mlir::OperationName::UnregisteredOpModel::setInherentAttr(), mlir::SymbolTable::setSymbolName(), mlir::SymbolTable::setSymbolVisibility(), mlir::affine::simplifyConstrainedMinMaxOp(), mlir::SymbolTable::SymbolTable(), tryApply(), mlir::spirv::unrollVectorsInFuncBodies(), mlir::spirv::unrollVectorsInSignatures(), mlir::detail::verifyInferredResultTypes(), verifyOpAndAdjustFlags(), and mlir::walkAndApplyPatterns().
|
inline |
Return the dialect this operation is associated with, or nullptr if the associated dialect is not loaded.
Definition at line 220 of file Operation.h.
References mlir::OperationName::getDialect(), and getName().
Referenced by fold(), mlir::detail::DialectInterfaceCollectionBase::getInterfaceFor(), mlir::Dialect::getOperationPrinter(), mlir::OperationFolder::insertKnownConstant(), mlir::bufferization::BufferizationOptions::isOpAllowed(), isPotentiallyUnknownSymbolTable(), maybeReplaceWithConstant(), opInGlobalImplicitParallelRegion(), mlir::populateConversionTargetFromOperation(), mlir::math::populateExtendToSupportedTypesConversionTarget(), mlir::OpState::print(), mlir::OpBuilder::tryFold(), and mlir::dataflow::SparseConstantPropagation::visitOperation().
|
inline |
Return a range corresponding to the dialect attributes for this operation.
Definition at line 632 of file Operation.h.
References getAttrs().
|
inline |
Access a discardable attribute by name, returns an null Attribute if the discardable attribute does not exist.
Definition at line 452 of file Operation.h.
|
inline |
Access a discardable attribute by name, returns an null Attribute if the discardable attribute does not exist.
Definition at line 448 of file Operation.h.
Referenced by mlir::LLVM::detail::DebugTranslation::DebugTranslation().
|
inline |
Return all of the discardable attributes on this operation as a DictionaryAttr.
Definition at line 496 of file Operation.h.
References mlir::get(), getContext(), getDiscardableAttrs(), and getPropertiesStorage().
|
inline |
Return a range of all of discardable attributes on this operation.
Note that for unregistered operations that are not storing inherent attributes as properties, all attributes are considered discardable.
Definition at line 481 of file Operation.h.
References getRegisteredInfo().
Referenced by getDiscardableAttrDictionary().
std::optional< Attribute > Operation::getInherentAttr | ( | StringRef | name | ) |
Access an inherent attribute by name: returns an empty optional if there is no inherent attribute with this name.
This method is available as a transient facility in the migration process to use Properties instead.
Definition at line 341 of file Operation.cpp.
References mlir::OperationName::getInherentAttr(), and getName().
Referenced by getAttr(), hasAttr(), removeAttr(), setAttr(), and setAttrs().
|
inline |
The source location the operation was defined or derived from.
Definition at line 223 of file Operation.h.
Referenced by mlir::affine::affineDataCopyGenerate(), mlir::applyPartialOneToNConversion(), mlir::ROCDL::SerializeGPUModuleBase::assembleIsa(), buildMultiDimReduce(), mlir::transform::detail::checkApplyToOne(), checkDoubleConsume(), clone(), cloneAndFuseFirstUse(), mlir::OperationEquivalence::computeHash(), convertDeclareTargetAttr(), convertElementwiseOp(), mlir::convertOpResultTypes(), mlir::affine::createAffineComputationSlice(), mlir::nvgpu::createAsyncGroups(), createConstFromIntAttribute(), mlir::emitc::createExpression(), mlir::LLVM::detail::createIntrinsicCall(), createLinalgBodyCalculationForElementwiseOp(), createLinalgBodyCalculationForReduceOp(), createNewAliasScopesFromNoAliasParameter(), createPrivateMemRef(), createSourceLocationInfo(), mlir::ControlFlowToSCFTransformation::createStructuredBranchRegionOp(), mlir::ControlFlowToSCFTransformation::createStructuredDoWhileLoopOp(), diagnoseInvalidOperandDominance(), elementwiseMatchAndRewriteHelper(), emitError(), emitRemark(), emitWarning(), ensurePayloadIsSeparateFromTransform(), mlir::detail::PassCrashReproducerGenerator::finalize(), findPayloadRoot(), mlir::transform::TrackingListener::findReplacementOp(), fuse(), getLibraryCallSymbolRef(), mlir::OpState::getLoc(), mlir::Region::getLoc(), mlir::LatticeAnchor::getLoc(), getMemoryFootprintBytes(), mlir::vector::getMixedSizesXfer(), mlir::arith::getNeutralElement(), getOrCreateOperandsMatchingResultTypes(), mlir::spirv::getPushConstantValue(), getTypeConversionFailure(), handleInlinedAllocas(), handleLoopAnnotations(), mlir::LLVM::detail::handleMultidimensionalVectors(), inlinePayload(), insertCasts(), interruptIfValidLocation(), mlir::OperationEquivalence::isEquivalentTo(), isFusionProfitable(), legalizeBlockArguments(), mlir::LLVM::lookupOrCreateFn(), lookupOrCreateSPIRVFn(), mlir::transform::gpu::mapNestedForallToThreadsImpl(), matchAndReplaceDepthwiseConv(), mlir::ConversionPattern::matchAndRewrite(), mlirLinalgFillBuiltinNamedOpRegion(), mlir::RewriterBase::notifyMatchFailure(), mlir::transform::ErrorCheckingTrackingListener::notifyPayloadReplacementNotFound(), mlir::LLVM::detail::oneToOneRewrite(), mlir::OperationFingerPrint::OperationFingerPrint(), mlir::nvgpu::optimizeSharedMemoryReadsAndWrites(), printConstantOp(), printFunctionArgs(), mlir::query::printMatch(), printOperation(), mlir::dlti::query(), reduceMatchAndRewriteHelper(), ReifyExpandOrCollapseShapeOp< OpTy >::reifyResultShapes(), mlir::affine::replaceAllMemRefUsesWith(), replaceAndPropagateMemRefType(), mlir::detail::AttrTypeReplacerBase< Concrete >::replaceElementsIn(), replaceForAllWithNewSignature(), mlir::bufferization::replaceOpWithNewBufferizedOp(), mlir::RewriterBase::replaceOpWithNewOp(), mlir::PassManager::run(), mlir::impl::scalarizeVectorOp(), setLoopAttr(), mlir::vector::splitFullAndPartialTransfer(), tileAndFuseFirstExtractUse(), tileAndFuseFirstExtractUseThroughContainingOpBlockArgument(), mlir::scf::tileAndFuseProducerOfSlice(), transformCyclesToSCFLoops(), transformMemRefLoadWithReducedRank(), transformToStructuredCFBranches(), mlir::OpBuilder::tryFold(), mlir::LLVM::detail::vectorOneToOneRewrite(), verifyAndGetTerminator(), mlir::detail::verifyDataLayoutOp(), mlir::detail::verifyInferredResultTypes(), mlir::OpTrait::impl::verifyIsIsolatedFromAbove(), verifyMapClause(), verifyNamedSequenceOp(), mlir::detail::verifySymbolTable(), verifyYieldingSingleBlockOp(), wrapInExecuteRegion(), and mlir::scf::yieldReplacementForFusedProducer().
|
inline |
The name of an operation is the key identifier for it.
Definition at line 119 of file Operation.h.
Referenced by AncestorKey::AncestorKey(), appendReproducer(), checkAndUpdateCapabilityRequirements(), checkAndUpdateExtensionRequirements(), mlir::transform::detail::checkApplyToOne(), checkImplementationStatus(), checkSymbolIsTypeOrAttribute(), mlir::Op< ConcreteType, Traits >::classof(), clone(), cloneOpWithOperandsAndTypes(), mlir::OperationEquivalence::computeHash(), convertHostOrTargetOperation(), mlir::convertOpResultTypes(), mlir::ControlFlowToSCFTransformation::createUnreachableTerminator(), mlir::ValueBoundsConstraintSet::dump(), emitOpError(), mlir::ConversionPatternRewriter::eraseOp(), mlir::transform::TrackingListener::findReplacementOp(), mlir::OpTrait::impl::foldIdempotent(), mlir::OpTrait::impl::foldInvolution(), mlir::linalg::generateLibraryCallName(), getAttrDictionary(), getDialect(), mlir::spirv::getElementPtrType(), getInherentAttr(), mlir::spirv::getIntegerDotProductCapabilities(), mlir::OpInterface< ConcreteType, Traits >::getInterfaceFor(), getRegisteredInfo(), getTargetShape(), mlir::AsmParserState::initialize(), mlir::OperationEquivalence::isEquivalentTo(), mlir::ConversionTarget::isIllegal(), mlir::ConversionTarget::isLegal(), isRegistered(), mlir::detail::NameOpMatcher::match(), mlir::PatternApplicator::matchAndRewrite(), mlirLinalgFillBuiltinNamedOpRegion(), mlir::detail::ConversionPatternRewriterImpl::notifyBlockInserted(), mlir::detail::ConversionPatternRewriterImpl::notifyOperationInserted(), mlir::detail::PassCrashReproducerGenerator::prepareReproducerFor(), mlir::CallGraph::print(), printIR(), mlir::OpState::printOpName(), printShortForm(), mlir::spirv::Serializer::printValueIDMap(), mlir::ConversionPatternRewriter::replaceOp(), mlir::ConversionPatternRewriter::replaceOpWithMultiple(), mlir::ConversionPatternRewriter::replaceUsesOfBlockArgument(), mlir::PassManager::run(), mlir::impl::scalarizeVectorOp(), setInherentAttr(), setPropertiesFromAttribute(), mlir::spirv::verifyAtomicUpdateOp(), mlir::spirv::verifyGroupNonUniformArithmeticOp(), mlir::spirv::verifyIntegerDotProduct(), verifyMmaSyncOp(), mlir::transform::detail::verifyParamProducerTransformOpTrait(), verifyRegion(), mlir::OpTrait::SingleBlockImplicitTerminator< TerminatorOpType >::Impl< ConcreteType >::verifyRegionTrait(), mlir::transform::TransformEachOpTrait< OpTy >::verifyTrait(), mlir::transform::FunctionalStyleTransformOpTrait< OpTy >::verifyTrait(), and mlir::transform::NavigationTransformOpTrait< OpTy >::verifyTrait().
|
inline |
Definition at line 341 of file Operation.h.
References mlir::detail::OperandStorage::size().
Referenced by addExecuteResults(), mlir::sparse_tensor::Merger::buildExp(), clone(), mlir::Region::cloneInto(), mlir::OperationEquivalence::computeHash(), convertOmpOpRegions(), mlir::affine::createAffineComputationSlice(), mlir::mesh::detail::defaultAddShardingAnnotations(), mlir::mesh::detail::defaultGetShardingAnnotations(), mlir::mesh::detail::defaultGetShardingOption(), elementwiseMatchAndRewriteHelper(), emitElementwiseComputation(), extractOperandTypes(), findPayloadOp(), fold(), mlir::OpTrait::impl::foldCommutative(), mlir::OpTrait::impl::foldIdempotent(), getElementalFuncTypeForOp(), mlir::mesh::ElementwiseShardingInterface< ElemwiseOp >::getIndexingMaps(), mlir::OpTrait::detail::MultiOperandTraitBase< ConcreteType, TraitType >::getNumOperands(), getOperandSegmentSizes(), mlir::mesh::getOperandShardings(), getOperandValuesImpl(), getSourceSkipUnary(), mlir::sparse_tensor::isAdmissibleBranchExp(), isaElemwiseSingleUnaryOrBinaryOpInterface(), mlir::linalg::detail::isContractionBody(), mlir::OperationEquivalence::isEquivalentTo(), isOpLoopInvariant(), mlir::detail::RecursivePatternMatcher< OpType, OperandMatchers >::match(), mlir::matchReduction(), materializeConversion(), mlir::MutableOperandRange::MutableOperandRange(), setInPlaceOpOperand(), setOperands(), mlir::OpTrait::impl::verifyAtLeastNOperands(), mlir::spirv::verifyGroupNonUniformArithmeticOp(), mlir::spirv::verifyIntegerDotProduct(), verifyNamedSequenceOp(), mlir::OpTrait::impl::verifyNOperands(), mlir::OpTrait::impl::verifyOneOperand(), mlir::OpTrait::impl::verifyOperandSizeAttr(), mlir::transform::detail::verifyPossibleTopLevelTransformOpTrait(), mlir::OpTrait::impl::verifySameTypeOperands(), mlir::linalg::detail::verifyStructuredOpInterface(), verifyYieldingSingleBlockOp(), mlir::OpTrait::impl::verifyZeroOperands(), visitOp(), and mlir::dataflow::SparseConstantPropagation::visitOperation().
|
inline |
Returns the number of regions held by this operation.
Definition at line 669 of file Operation.h.
Referenced by canBeHoisted(), clone(), mlir::affine::LoopNestStateCollector::collect(), getBackwardSliceImpl(), mlir::OpTrait::detail::MultiRegionTraitBase< ConcreteType, TraitType >::getNumRegions(), irdlRegionVerifier(), mlir::OperationEquivalence::isEquivalentTo(), isPotentiallyUnknownSymbolTable(), isVectorizableLoopBodyWithOpCond(), mlirLinalgFillBuiltinNamedOpRegion(), mlirOperationGetFirstRegion(), mlirRegionGetNextInOperation(), mlir::memref::resultIsNotRead(), mlir::impl::scalarizeVectorOp(), mlir::vector::splitFullAndPartialTransfer(), mlir::SymbolTable::SymbolTable(), traverseRegionGraph(), mlir::OpTrait::impl::verifyAtLeastNRegions(), mlir::OpTrait::impl::verifyNoRegionArguments(), mlir::OpTrait::impl::verifyNRegions(), mlir::OpTrait::impl::verifyOneRegion(), verifyOrderedParent(), mlir::detail::verifyParallelCombiningOpInterface(), mlir::transform::detail::verifyPossibleTopLevelTransformOpTrait(), mlir::OpTrait::SingleBlockImplicitTerminator< TerminatorOpType >::Impl< ConcreteType >::verifyRegionTrait(), mlir::transform::detail::verifyStructuredOpPredicateOpTrait(), mlir::detail::verifySymbolTable(), mlir::OpTrait::SingleBlock< ConcreteType >::verifyTrait(), mlir::OpTrait::impl::verifyZeroRegions(), mlir::dataflow::DeadCodeAnalysis::visit(), mlir::dataflow::SparseConstantPropagation::visitOperation(), and wrapInExecuteRegion().
|
inline |
Return the number of results held by this operation.
Definition at line 399 of file Operation.h.
Referenced by mlir::transform::detail::checkApplyToOne(), clone(), convertOperationImpl(), mlir::emitc::createExpression(), elementwiseMatchAndRewriteHelper(), mlir::ConversionPatternRewriter::eraseOp(), mlir::transform::TrackingListener::findReplacementOp(), getElementalFuncTypeForOp(), mlir::mesh::ElementwiseShardingInterface< ElemwiseOp >::getIndexingMaps(), getLibraryCallSymbolRef(), mlir::spirv::getNativeVectorShape(), mlir::OpTrait::detail::MultiResultTraitBase< ConcreteType, TraitType >::getNumResults(), getResultSegmentSizes(), mlir::mesh::getResultShardings(), getTypeConversionFailure(), inferFragType(), isaElemwiseSingleUnaryOrBinaryOpInterface(), mlir::linalg::detail::isContractionBody(), mlir::OperationEquivalence::isEquivalentTo(), VectorizeConvolution::matchAndRewrite(), mlir::matchReduction(), materializeConversion(), mlir::detail::ConversionPatternRewriterImpl::notifyOpReplaced(), mlir::LLVM::detail::oneToOneRewrite(), mlir::OpAsmPrinter::printFunctionalType(), printNVVMIntrinsicOp(), printOneResultOp(), replaceAndPropagateMemRefType(), mlir::RewriterBase::replaceOp(), mlir::ConversionPatternRewriter::replaceOp(), mlir::bufferization::replaceOpWithBufferizedValues(), mlir::ConversionPatternRewriter::replaceOpWithMultiple(), mlir::memref::resultIsNotRead(), mlir::impl::scalarizeVectorOp(), mlir::transform::detail::setApplyToOneResults(), mlir::scf::tileConsumerAndFuseProducersUsingSCF(), mlir::OpTrait::impl::verifyAtLeastNResults(), mlir::OpTrait::impl::verifyElementwise(), verifyInitializationAttribute(), mlir::spirv::verifyIntegerDotProduct(), mlir::OpTrait::impl::verifyNResults(), mlir::OpTrait::impl::verifyOneResult(), mlir::OpTrait::impl::verifyResultSizeAttr(), mlir::detail::verifyShapedDimOpInterface(), verifyShapeOrExtentTensorOp(), verifySizeOrIndexOp(), mlir::OpTrait::impl::verifyZeroResults(), visitOp(), mlir::dataflow::SparseConstantPropagation::visitOperation(), walkReferenceCountedValues(), and mlir::scf::yieldReplacementForFusedProducer().
|
inline |
Definition at line 702 of file Operation.h.
Referenced by checkTransformationPreconditions(), clone(), eraseTerminatorSuccessorOperands(), mlir::Block::getNumSuccessors(), mlir::OpTrait::detail::MultiSuccessorTraitBase< ConcreteType, TraitType >::getNumSuccessors(), getPHISourceValue(), getSuccessor(), mlir::OperationEquivalence::isEquivalentTo(), isRegionOrCallableReturn(), mlir::OperationFingerPrint::OperationFingerPrint(), propagateTerminatorLiveness(), mlir::impl::scalarizeVectorOp(), setSuccessor(), mlir::SuccessorRange::SuccessorRange(), mlir::OpTrait::impl::verifyAtLeastNSuccessors(), mlir::OpTrait::impl::verifyNSuccessors(), mlir::OpTrait::impl::verifyOneSuccessor(), mlir::OpTrait::impl::verifyZeroSuccessors(), and mlir::dataflow::DeadCodeAnalysis::visit().
|
inline |
Definition at line 345 of file Operation.h.
References mlir::IROperand< DerivedT, IRValueT >::get(), and getOpOperand().
Referenced by mlir::affine::affineParallelize(), mlir::sparse_tensor::Merger::buildExp(), mlir::sparse_tensor::Merger::buildTensorExpFromLinalg(), mlir::OperationEquivalence::computeHash(), convertOmpAtomicCapture(), convertOmpAtomicUpdate(), convertOmpOpRegions(), createLinalgBodyCalculationForElementwiseOp(), diagnoseInvalidOperandDominance(), fold(), foldExtractFromBroadcast(), mlir::OpTrait::impl::foldIdempotent(), mlir::OpTrait::impl::foldInvolution(), mlir::mesh::ElementwiseShardingInterface< ElemwiseOp >::getIndexingMaps(), mlir::spirv::getIntegerDotProductCapabilities(), mlir::mesh::ElementwiseShardingInterface< ElemwiseOp >::getLoopIteratorTypes(), mlir::OpTrait::OneOperand< ConcreteType >::getOperand(), mlir::OpTrait::detail::MultiOperandTraitBase< ConcreteType, TraitType >::getOperand(), getPHISourceValue(), getSourceSkipUnary(), mlir::sparse_tensor::isAdmissibleBranch(), mlir::sparse_tensor::isAdmissibleBranchExp(), mlir::linalg::detail::isContractionBody(), isOpLoopInvariant(), mlir::detail::matchOperandOrValueAtIndex(), mlir::matchReduction(), materializeConversion(), printBinaryOperation(), printOperation(), printUnaryOperation(), reduceMatchAndRewriteHelper(), mlir::spirv::verifyAtomicUpdateOp(), mlir::spirv::verifyCastOp(), mlir::spirv::verifyGroupNonUniformArithmeticOp(), mlir::spirv::verifyIntegerDotProduct(), mlir::transform::detail::verifyPossibleTopLevelTransformOpTrait(), mlir::OpTrait::impl::verifySameOperandsElementType(), mlir::OpTrait::impl::verifySameTypeOperands(), verifyShiftOp(), and mlir::OpTrait::tosa::MulOperandsAndResultElementType< ConcreteType >::verifyTrait().
|
inline |
Returns an iterator on the underlying Value's.
Definition at line 373 of file Operation.h.
References getOpOperands().
Referenced by canBeHoisted(), canonicalizeMinMaxOp(), mlir::scf::canonicalizeMinMaxOpInLoop(), checkAssumptionForLoop(), clone(), mlir::Region::cloneInto(), mlir::coalesceLoops(), mlir::OperationEquivalence::computeHash(), mlir::ValueBoundsConstraintSet::computeIndependentBound(), convertElementwiseOp(), convertOmpAtomicCapture(), convertOmpAtomicUpdate(), mlir::affine::createAffineComputationSlice(), mlir::LLVM::detail::createIntrinsicCall(), defaultIsSmallAlloc(), mlir::arm_sme::eraseTriviallyDeadTileOps(), extractBeneficiaryOps(), findPayloadOp(), mlir::transform::TrackingListener::findReplacementOp(), mlir::impl::foldCastInterfaceOp(), mlir::MutableOperandRange::getAsOperandRange(), mlir::OpTrait::detail::MultiOperandTraitBase< ConcreteType, TraitType >::getOperands(), mlir::mesh::getOperandShardings(), getOperandTypes(), getOperandValuesImpl(), getOrCreateOperandsMatchingResultTypes(), getOutermostInvariantForOp(), getReshardingRquirementKind(), mlir::sparse_tensor::hasAnyNonIdentityOperandsOrResults(), mlir::sparse_tensor::hasAnySparseOperand(), hasBufferSemantics(), hasNonAffineUsersOnPath(), inlineConvertOmpRegions(), inlinePayload(), insertCasts(), mlir::OperationEquivalence::isEquivalentTo(), isOpReady(), isOpSibling(), mlir::makeRegionIsolatedFromAbove(), mlir::detail::infer_int_range_op_binder::match(), AllocaScopeInliner::matchAndRewrite(), mlir::ConversionPattern::matchAndRewrite(), mlir::OneToNConversionPattern::matchAndRewrite(), SortCommutativeOperands::matchAndRewrite(), matchSimpleReduction(), operand_begin(), operand_end(), operandsAndResultsRanked(), mlir::OperationFingerPrint::OperationFingerPrint(), mlir::outlineSingleBlockRegion(), CommutativeOperand::popFrontAndPushAdjacentUnvisitedAncestors(), printArithmeticExtendedBinaryOp(), mlir::OpAsmPrinter::printFunctionalType(), printNVVMIntrinsicOp(), printOneResultOp(), mlir::affine::replaceAllMemRefUsesWith(), replaceOpWithRegion(), mlir::sparse_tensor::SparsificationAndBufferizationPass::runDenseBufferization(), mlir::affine::simplifyConstrainedMinMaxOp(), mlir::mesh::spmdizeFullyReplicatedOperation(), mlir::mesh::spmdizeOperation(), staticallyNonNegative(), mlir::detail::verifyInferredResultTypes(), verifyNamedSequenceOp(), mlir::OpTrait::impl::verifySameOperandsAndResultElementType(), mlir::OpTrait::impl::verifySameOperandsElementType(), verifyYieldingSingleBlockOp(), mlir::dataflow::IntegerRangeAnalysis::visitNonControlFlowArguments(), and mlir::dataflow::SparseConstantPropagation::visitOperation().
|
inline |
Definition at line 392 of file Operation.h.
References getOperands(), and mlir::OperandRange::getTypes().
Referenced by checkSourceOpTypes(), extractOperandTypes(), mlir::linalg::generateLibraryCallName(), mlir::mesh::IndependentParallelIteratorDomainShardingInterface< Op >::getLoopIteratorTypes(), mlir::OpTrait::detail::MultiOperandTraitBase< ConcreteType, TraitType >::getOperandTypes(), getOpToConvert(), hasZeroDimVectors(), insertCasts(), irdlOpVerifier(), isElementwiseMappableOpOnRankedTensors(), mlir::TypeConverter::isLegal(), isLegalOp(), isVectorizableLoopBodyWithOpCond(), mlir::OneToNConversionPattern::matchAndRewrite(), mlir::outlineSingleBlockRegion(), printOneResultOp(), mlir::mesh::spmdizeFuncOp(), mlir::impl::verifyCastInterfaceOp(), mlir::OpTrait::impl::verifyCompatibleOperandBroadcast(), mlir::OpTrait::impl::verifyElementwise(), mlir::OpTrait::impl::verifyOperandsAreFloatLike(), mlir::OpTrait::impl::verifyOperandsAreSignlessIntegerLike(), mlir::OpTrait::impl::verifySameOperandsAndResultRank(), mlir::OpTrait::impl::verifySameOperandsAndResultShape(), mlir::OpTrait::impl::verifySameOperandsAndResultType(), mlir::OpTrait::impl::verifySameOperandsShape(), mlir::OpTrait::impl::verifySameTypeOperands(), verifyShapeOrExtentTensorOp(), and verifySizeOrIndexOp().
|
inline |
Definition at line 383 of file Operation.h.
References mlir::detail::OperandStorage::getOperands().
Referenced by areBinOpsSwapped(), mlir::affine::AffineDmaStartOp::getDstMemRefMutable(), getOperand(), mlir::affine::AffineDmaStartOp::getSrcMemRefMutable(), mlir::affine::AffineDmaStartOp::getTagMemRefMutable(), mlir::affine::AffineDmaWaitOp::getTagMemRefMutable(), mlir::MutableOperandRange::operator[](), and setOperand().
|
inline |
Definition at line 378 of file Operation.h.
References mlir::detail::OperandStorage::getOperands().
Referenced by mlir::bufferization::OneShotAnalysisState::analyzeSingleOp(), mlir::MutableOperandRange::begin(), mlir::mesh::detail::defaultAddShardingAnnotations(), mlir::mesh::detail::defaultGetShardingAnnotations(), dropAllReferences(), mlir::MutableOperandRange::end(), mlir::OpTrait::impl::foldCommutative(), mlir::memref::foldMemRefCast(), mlir::tensor::foldTensorCast(), getBackwardSliceImpl(), getOperands(), mlir::transform::detail::getParamProducerTransformOpTraitEffects(), mlir::transform::detail::getPotentialTopLevelEffects(), inlineRegionAndEmitStore(), mlir::MutableOperandRange::operator MutableArrayRef< OpOperand >(), replaceUsesOfWith(), setInPlaceOpOperand(), mlir::transform::detail::verifyTransformOpInterface(), visitOp(), and mlir::visitUsedValuesDefinedAbove().
|
inline |
Definition at line 416 of file Operation.h.
References getResult().
Referenced by applyTilingToAll().
|
inline |
Definition at line 415 of file Operation.h.
References getResults().
Referenced by cloneAndFuseFirstUse(), dropAllUses(), mlir::bufferization::OneShotAnalysisState::gatherUndefinedTensorUses(), mlir::transform::detail::getPotentialTopLevelEffects(), isUsedOutsideOfBlock(), and mlir::bufferization::replaceOpWithBufferizedValues().
|
inline |
Return the closest surrounding parent operation that is of type 'OpTy'.
Definition at line 238 of file Operation.h.
Referenced by convertDeclareTargetAttr(), convertOmpTarget(), convertOmpTargetData(), mlir::sparse_tensor::createFuncCall(), mlir::LLVM::createGlobalString(), createSourceLocationInfo(), getAllocEffectFor(), getFirstUserOfLoop(), getLibraryCallSymbolRef(), getTargetSystemSpec(), handleLoopAnnotations(), mlir::linalg::hoistPaddingOnTensors(), mlir::scf::insideMutuallyExclusiveBranches(), mlir::insideMutuallyExclusiveRegions(), isInsideLaunch(), isTargetDeviceOp(), numEnclosingInvariantLoops(), mlir::affine::replaceAllMemRefUsesWith(), mlir::bufferization::runOneShotModuleBufferize(), mlir::scf::tileAndFuseConsumerOfSlice(), validateSupportedControlFlow(), verifyNamedSequenceOp(), verifyOrderedParent(), and verifyYieldingSingleBlockOp().
|
inline |
Returns the closest surrounding operation that contains this operation or nullptr if this is a top-level operation.
Definition at line 234 of file Operation.h.
References mlir::Block::getParentOp().
Referenced by canMakeGroupOpUniform(), mlir::DataLayout::closest(), collectParentLayouts(), collectSymbolScopes(), collectValidReferencesFor(), mlir::DataLayoutAnalysis::DataLayoutAnalysis(), declareReduction(), ensurePayloadIsSeparateFromTransform(), mlir::Block::findAncestorOpInBlock(), mlir::Region::findAncestorOpInRegion(), findAncestorOpInRegion(), findCommonAncestor(), findParent(), mlir::DataLayoutAnalysis::getAbove(), mlir::affine::getAffineForIVs(), mlir::affine::getAffineIVs(), mlir::affine::getAffineParallelInductionVarOwner(), getAllocEffectFor(), getAtMostNEnclosingLoops(), getAutomaticAllocationScope(), mlir::getBackwardSlice(), mlir::AnalysisManager::getCachedChildAnalysis(), mlir::Pass::getCachedParentAnalysis(), getClosestQueryable(), getEffectsAfter(), getEffectsBefore(), mlir::affine::getEnclosingAffineOps(), getEnclosingLoopsUntil(), mlir::SymbolTable::getNearestSymbolTable(), mlir::affine::getNestingDepth(), mlir::bufferization::getOwnerOfValue(), getOwnerOfValue(), mlir::OpTrait::HasParent< ParentOpTypes >::Impl< ConcreteType >::getParentOp(), getParentWithTrait(), mlir::spirv::getPushConstantValue(), mlir::sparse_tensor::getTop(), getUntiledConsumerFromSlice(), handleInlinedAllocas(), happensBefore(), mlir::affine::hasNoInterveningEffect(), mlir::SymbolTable::insert(), mlir::spirv::isNestedInFunctionOpInterface(), mlir::isNotBranchOpInterfaceOrReturnLikeOp(), isOpReady(), isProperAncestor(), isRegionOrCallableReturn(), mlir::affine::isTopLevelValue(), mlir::affine::isValidDim(), lookupDialectOp(), mlir::spirv::lookupEntryPointABI(), mlir::spirv::lookupTargetEnv(), AllocaScopeHoister::matchAndRewrite(), mlir::matchReduction(), mlirAsmStateCreateForValue(), movePaddingToFillOrGenericOp(), mlir::AnalysisManager::nest(), mlir::detail::ConversionPatternRewriterImpl::notifyOperationInserted(), mlir::OperationFingerPrint::OperationFingerPrint(), opInGlobalImplicitParallelRegion(), parentLLVMModule(), mlir::detail::PassCrashReproducerGenerator::prepareReproducerFor(), mlir::Block::print(), mlir::CallGraph::print(), mlir::Value::printAsOperand(), printFunctionBody(), mlir::SymbolTable::remove(), mlir::SymbolTable::rename(), mlir::SymbolUserMap::replaceAllUsesWith(), verifyHasBindingUse(), verifyOrderedParent(), mlir::transform::detail::verifyStructuredOpPredicateOpTrait(), mlir::OpTrait::HasParent< ParentOpTypes >::Impl< ConcreteType >::verifyTrait(), visit(), mlir::dataflow::DeadCodeAnalysis::visit(), mlir::dataflow::LivenessAnalysis::visitBranchOperand(), and walkReferencedSymbolNodes().
|
inline |
Returns the region to which the instruction belongs.
Returns nullptr if the instruction is unlinked.
Definition at line 230 of file Operation.h.
References mlir::Block::getParent().
Referenced by createPrivateMemRef(), mlir::Region::findAncestorOpInRegion(), findAncestorOpInRegion(), mlir::affine::getAffineScope(), mlir::bufferization::AnalysisState::getEnclosingRepetitiveRegion(), mlir::getEnclosingRepetitiveRegion(), mlir::Region::getParentRegion(), handleInlinedAllocas(), mlir::affine::hasNoInterveningEffect(), mlir::affine::isTopLevelValue(), mlir::affine::isValidSymbol(), lastNonTerminatorInRegion(), mlir::moveLoopInvariantCode(), mlir::bufferization::ValueComparator::operator()(), and verifyTerminatorSuccessors().
|
inline |
Returns the closest surrounding parent operation with trait Trait
.
Definition at line 248 of file Operation.h.
References getParentOp(), and hasTrait().
Referenced by mlir::AllocationOpLLVMLowering::allocateBufferAutoAlign(), mlir::AllocationOpLLVMLowering::allocateBufferManuallyAlign(), findCommonAncestor(), getAllocEffectFor(), getDumpRootOp(), verifyNamedSequenceOp(), and mlir::transform::detail::verifyPossibleTopLevelTransformOpTrait().
Attribute Operation::getPropertiesAsAttribute | ( | ) |
Return the properties converted to an attribute.
This is expensive, and mostly useful when dealing with unregistered operation. Returns an empty attribute if no properties are present.
Definition at line 349 of file Operation.cpp.
References mlir::OpaqueProperties::as(), getPropertiesStorage(), and getRegisteredInfo().
|
inline |
Returns the properties storage.
Definition at line 896 of file Operation.h.
References getPropertiesStorageUnsafe().
Referenced by clone(), copyProperties(), getDiscardableAttrDictionary(), mlir::OperationName::UnregisteredOpModel::getPropertiesAsAttr(), getPropertiesAsAttribute(), hashProperties(), mlir::OperationEquivalence::isEquivalentTo(), mlir::OperationName::UnregisteredOpModel::setInherentAttr(), mlir::OperationState::setProperties(), setPropertiesFromAttribute(), and mlir::detail::verifyInferredResultTypes().
|
inline |
Definition at line 901 of file Operation.h.
|
inline |
Returns the properties storage size.
Definition at line 892 of file Operation.h.
Referenced by getAttr(), getAttrDictionary(), hasAttr(), removeAttr(), setAttr(), and setAttrs().
|
inline |
Returns the properties storage without checking whether properties are present.
Definition at line 909 of file Operation.h.
Referenced by mlir::Op< ConcreteType, Traits >::getProperties(), and getPropertiesStorage().
|
inline |
Return all attributes that are not stored as properties.
Definition at line 504 of file Operation.h.
Referenced by mlir::OperationEquivalence::computeHash(), mlir::OperationEquivalence::isEquivalentTo(), mlir::OperationFingerPrint::OperationFingerPrint(), and mlir::detail::verifyInferredResultTypes().
|
inline |
Returns the region held by this operation at position 'index'.
Definition at line 682 of file Operation.h.
References getRegions().
Referenced by mlir::affine::affineParallelize(), mlir::sparse_tensor::Merger::buildTensorExpFromLinalg(), clone(), collectSymbolScopes(), convertOmpAtomicCapture(), convertOmpAtomicUpdate(), convertOmpSections(), create(), mlir::irdl::createVerifier(), getAttrOrTypeVerifier(), getBackwardSliceImpl(), mlir::OpTrait::SingleBlock< ConcreteType >::getBody(), mlir::transform::PossibleTopLevelTransformOpTrait< OpTy >::getBodyBlock(), mlir::OpTrait::SingleBlock< ConcreteType >::getBodyRegion(), mlir::bufferization::getGlobalFor(), getModuleBody(), mlir::spirv::getPushConstantValue(), mlir::OpTrait::OneRegion< ConcreteType >::getRegion(), mlir::OpTrait::detail::MultiRegionTraitBase< ConcreteType, TraitType >::getRegion(), mlir::SymbolTable::insert(), mlir::LLVM::lookupOrCreateFn(), lookupOrCreateSPIRVFn(), mlir::SymbolTable::lookupSymbolIn(), mlir::transform::detail::mergeSymbolsInto(), mlirLinalgFillBuiltinNamedOpRegion(), mlirOperationGetFirstRegion(), mlirRegionGetNextInOperation(), mlir::linalg::pack(), mlir::vector::splitFullAndPartialTransfer(), mlir::SymbolTable::SymbolTable(), mlir::SymbolUserMap::SymbolUserMap(), transposeOneLinalgOperandAndReplace(), vectorizeLinalgOpPrecondition(), mlir::detail::verifyParallelCombiningOpInterface(), mlir::transform::detail::verifyPossibleTopLevelTransformOpTrait(), mlir::OpTrait::SingleBlockImplicitTerminator< TerminatorOpType >::Impl< ConcreteType >::verifyRegionTrait(), mlir::transform::detail::verifyStructuredOpPredicateOpTrait(), mlir::detail::verifySymbolTable(), and mlir::OpTrait::SingleBlock< ConcreteType >::verifyTrait().
|
inline |
Returns the regions held by this operation.
Definition at line 672 of file Operation.h.
Referenced by mlir::applyPatternsAndFoldGreedily(), mlir::OpBuilder::clone(), mlir::Region::cloneInto(), collectCallOps(), collectEffects(), collectSymbolScopes(), collectUnderlyingAddressValues(), computeCallGraph(), mlir::bufferization::detail::defaultHasTensorSemantics(), dropAllDefinedValueUses(), dropAllReferences(), mlir::LLVM::ensureDistinctSuccessors(), getBackwardSliceImpl(), mlir::getEffectsRecursively(), getForwardSliceImpl(), mlir::getInnermostParallelLoops(), getInstAtPosition(), getRegion(), mlir::Region::getRegionNumber(), mlir::OpTrait::detail::MultiRegionTraitBase< ConcreteType, TraitType >::getRegions(), hasBufferSemantics(), mlir::dataflow::DeadCodeAnalysis::initialize(), mlir::dataflow::AbstractDenseForwardDataFlowAnalysis::initialize(), mlir::dataflow::AbstractDenseBackwardDataFlowAnalysis::initialize(), mlir::dataflow::AbstractSparseForwardDataFlowAnalysis::initialize(), irdlRegionVerifier(), mlir::bytecode::detail::IRNumberingState::IRNumberingState(), mlir::OperationEquivalence::isEquivalentTo(), mlir::isMemoryEffectFree(), isOpSibling(), mlir::isSpeculatable(), mlir::ForwardIterator::makeIterable(), mergeIdenticalBlocks(), mlir::OperationFingerPrint::OperationFingerPrint(), propagateLiveness(), mlir::detail::AttrTypeReplacerBase< Concrete >::replaceElementsIn(), mlir::gpu::transformGpuModulesToBinaries(), validateSupportedControlFlow(), mlir::detail::verifyInferredResultTypes(), mlir::OpTrait::impl::verifyIsIsolatedFromAbove(), mlir::OpTrait::impl::verifyNoRegionArguments(), mlir::detail::verifySymbolTable(), mlir::detail::verifyTypesAlongControlFlowEdges(), mlir::dataflow::LivenessAnalysis::visitBranchOperand(), mlir::JamBlockGatherer< OpTy >::walk(), mlir::walkAndApplyPatterns(), walkSymbolTable(), mlir::SymbolTable::walkSymbolTables(), walkSymbolUses(), wouldOpBeTriviallyDeadImpl(), and wrapInExecuteRegion().
|
inline |
If this operation has a registered operation description, return it.
Otherwise return std::nullopt.
Definition at line 123 of file Operation.h.
References getName(), and mlir::OperationName::getRegisteredInfo().
Referenced by mlir::Op< ConcreteType, Traits >::classof(), getDiscardableAttrs(), getPropertiesAsAttribute(), and setPropertiesFromAttribute().
|
inline |
Get the 'idx'th result of this operation.
Definition at line 402 of file Operation.h.
Referenced by mlir::affine::affineParallelize(), mlir::bufferization::allocateTensorForShapedValue(), broadcastDynamicDimension(), mlir::tensor::bubbleUpPadSlice(), buildDivOp(), mlir::sparse_tensor::Merger::buildExp(), mlir::tensor::buildIndependentOp(), buildPackingLoopNestImpl(), buildSubAndExpOp(), clone(), convertElementwiseOp(), convertOmpThreadprivate(), convertOperationImpl(), mlir::emitc::createExpression(), mlir::LLVM::detail::createIntrinsicCall(), createLinalgBodyCalculationForElementwiseOp(), mlir::vector::createReadOrMaskedRead(), mlir::spirv::Deserializer::processOp< spirv::GenericCastToPtrExplicitOp >(), mlir::op_definition_impl::foldTrait(), mlir::sparse_tensor::SparseIterator::genNotEnd(), getConsumerFromLoopUses(), mlir::AllocationOpLLVMLowering::getMemRefResultType(), mlir::bufferization::DeallocationState::getMemrefsAndConditionsToDeallocate(), mlir::arith::getNeutralElement(), getOpResult(), mlir::OperationFolder::getOrCreateConstant(), mlir::OpTrait::OneTypedResult< ResultType >::Impl< ConcreteType >::getResult(), mlir::OpTrait::detail::MultiResultTraitBase< ConcreteType, TraitType >::getResult(), mlir::nvgpu::getWarpMatrixInfo(), mlir::LLVM::detail::handleMultidimensionalVectors(), mlir::linalg::hoistPaddingOnTensors(), inferFragType(), mlir::LLVMTypeConverter::LLVMTypeConverter(), mlir::detail::infer_int_range_op_binder::match(), mlir::detail::constant_float_value_binder::match(), mlir::detail::constant_int_value_binder::match(), matchAndReplaceDepthwiseConv(), mlir::GPUPrintfOpToHIPLowering::matchAndRewrite(), SwapTransposeWithBroadcast::matchAndRewrite(), VectorizeConvolution::matchAndRewrite(), mlir::gpu::index_lowering::OpLowering< Op, XOp, YOp, ZOp >::matchAndRewrite(), materializeConversion(), maybeReplaceWithConstant(), mlir::OperationFolder::notifyRemoval(), mlir::LLVM::detail::oneToOneRewrite(), mlir::outlineSingleBlockRegion(), printConstantOp(), mlir::OpAsmPrinter::printFunctionalType(), printOneResultOp(), printOperation(), reduce(), reduceMatchAndRewriteHelper(), mlir::OpTrait::OneResult< ConcreteType >::replaceAllUsesWith(), replaceAndPropagateMemRefType(), replaceForAllWithNewSignature(), resolveSourceIndicesExpandShape(), mlir::linalg::rewriteInIm2Col(), mlir::impl::scalarizeVectorOp(), mlir::SPIRVTypeConverter::SPIRVTypeConverter(), mlir::linalg::splitReduction(), mlir::linalg::splitReductionByScaling(), mlir::scf::tileAndFuseProducerOfSlice(), vectorizeAsTensorPadOp(), vectorizeAsTensorUnpackOp(), mlir::LLVM::detail::vectorOneToOneRewrite(), mlir::spirv::verifyCastOp(), verifyInitializationAttribute(), mlir::OpTrait::impl::verifySameOperandsAndResultElementType(), mlir::OpTrait::impl::verifySameOperandsAndResultType(), mlir::detail::verifyShapedDimOpInterface(), verifyShiftOp(), mlir::OpTrait::tosa::MulOperandsAndResultElementType< ConcreteType >::verifyTrait(), walkReferenceCountedValues(), and mlir::scf::yieldReplacementForFusedProducer().
|
inline |
Definition at line 410 of file Operation.h.
Referenced by addBodyWithPayloadOp(), mlir::transform::TransformState::applyTransform(), mlir::bufferization::func_ext::CallOpInterface::bufferize(), mlir::vector::castAwayContractionLeadingOneDim(), mlir::transform::detail::checkApplyToOne(), checkFoldResultTypes(), mlir::async::cloneConstantsIntoTheRegion(), mlir::OperationEquivalence::computeHash(), mlir::mesh::detail::defaultAddShardingAnnotations(), mlir::mesh::detail::defaultGetShardingAnnotations(), delinearizeInductionVariable(), mlir::sparse_tensor::LoopEmitter::exitCurrentLoop(), extractBeneficiaryOps(), mlir::impl::foldCastInterfaceOp(), mlir::sparse_tensor::SparseIterator::forward(), forwardToUsers(), mlir::sparse_tensor::FuncCallOrInlineGenerator< SubClass >::genCallOrInline(), mlir::sparse_tensor::SparseIterator::genInit(), genLoopWithIterator(), getForwardSliceImpl(), getLastDependentOpInRange(), getOpResults(), mlir::tensor::getOrCreateDestinations(), mlir::transform::detail::getParamProducerTransformOpTraitEffects(), getReshardingRquirementKind(), mlir::OpTrait::detail::MultiResultTraitBase< ConcreteType, TraitType >::getResults(), mlir::mesh::getResultShardings(), getResultTypes(), getUses(), mlir::sparse_tensor::hasAnyNonIdentityOperandsOrResults(), mlir::sparse_tensor::hasAnySparseResult(), hasBufferSemantics(), mlir::affine::MemRefDependenceGraph::init(), mlir::OperationFolder::insertKnownConstant(), invertCollapseShapeIndexing(), mlir::OperationEquivalence::isEquivalentTo(), isGuaranteedAutomaticAllocation(), isOpItselfPotentialAutomaticAllocation(), mlir::makeRegionIsolatedFromAbove(), VectorizationState::maskOperation(), mlir::gpu::index_lowering::OpLowering< Op, XOp, YOp, ZOp >::matchAndRewrite(), mlir::RewriterBase::Listener::notifyOperationReplaced(), mlir::detail::ConversionPatternRewriterImpl::notifyOpReplaced(), mlir::bufferization::OneShotAnalysisState::OneShotAnalysisState(), operandsAndResultsRanked(), mlir::linalg::peelLoop(), mlir::Liveness::print(), mlir::OpAsmPrinter::printFunctionalType(), printFunctionBody(), propagateLiveness(), reduceMatchAndRewriteHelper(), mlir::reifyResultShapes(), mlir::RewriterBase::replaceAllOpUsesWith(), mlir::ResultRange::replaceAllUsesWith(), replaceAllUsesWith(), replaceAndPropagateMemRefType(), mlir::detail::AttrTypeReplacerBase< Concrete >::replaceElementsIn(), mlir::RewriterBase::replaceOp(), mlir::ConversionPatternRewriter::replaceOp(), mlir::RewriterBase::replaceOpUsesWithIf(), mlir::bufferization::replaceOpWithNewBufferizedOp(), mlir::ResultRange::replaceUsesWithIf(), replaceUsesWithIf(), result_begin(), result_end(), mlir::sparse_tensor::SparsificationAndBufferizationPass::runDenseBufferization(), mlir::sinkOperationsIntoLaunchOp(), mlir::mesh::spmdizeFullyReplicatedOperation(), mlir::mesh::spmdizeOperation(), mlir::mesh::spmdizeTriviallyShardableOperation(), staticallyNonNegative(), mlir::scf::tileAndFuseConsumerOfSlice(), mlir::scf::tileConsumerAndFuseProducersUsingSCF(), tileLinalgOpImpl(), transformToStructuredCFBranches(), mlir::OpBuilder::tryFold(), use_begin(), use_empty(), use_end(), validateSupportedControlFlow(), mlir::linalg::vectorizeCopy(), mlir::transform::detail::verifyParamProducerTransformOpTrait(), mlir::OpTrait::impl::verifySameOperandsAndResultElementType(), mlir::transform::detail::verifyTransformOpInterface(), mlir::dataflow::LivenessAnalysis::visitBranchOperand(), visitOp(), mlir::dataflow::IntegerRangeAnalysis::visitOperation(), and wrapInExecuteRegion().
|
inline |
Definition at line 423 of file Operation.h.
References getResults(), and mlir::ResultRange::getTypes().
Referenced by checkSourceOpTypes(), clone(), mlir::OperationEquivalence::computeHash(), convertElementwiseOp(), mlir::convertOpResultTypes(), elementwiseMatchAndRewriteHelper(), emitElementwiseComputation(), getCompressedMaskOp(), mlir::mesh::IndependentParallelIteratorDomainShardingInterface< Op >::getLoopIteratorTypes(), mlir::spirv::getNativeVectorShape(), getOpToConvert(), getOrCreateOperandsMatchingResultTypes(), mlir::OpTrait::detail::MultiResultTraitBase< ConcreteType, TraitType >::getResultTypes(), getTypeConversionFailure(), hasZeroDimVectors(), insertCasts(), irdlOpVerifier(), mlir::TypeConverter::isLegal(), isLegalOp(), isLessThanTargetBitWidth(), isVectorizableLoopBodyWithOpCond(), mlir::OneToNConversionPattern::matchAndRewrite(), mlir::LLVM::detail::oneToOneRewrite(), mlir::OperationFingerPrint::OperationFingerPrint(), mlir::outlineSingleBlockRegion(), printArithmeticExtendedBinaryOp(), printNVVMIntrinsicOp(), mlir::OneToNPatternRewriter::replaceOp(), result_type_begin(), result_type_end(), mlir::impl::verifyCastInterfaceOp(), mlir::OpTrait::impl::verifyCompatibleOperandBroadcast(), mlir::OpTrait::impl::verifyElementwise(), mlir::detail::verifyInferredResultTypes(), mlir::spirv::verifyIntegerDotProduct(), mlir::OpTrait::impl::verifyResultsAreBoolLike(), mlir::OpTrait::impl::verifyResultsAreFloatLike(), mlir::OpTrait::impl::verifyResultsAreSignlessIntegerLike(), mlir::OpTrait::impl::verifySameOperandsAndResultRank(), mlir::OpTrait::impl::verifySameOperandsAndResultShape(), mlir::OpTrait::impl::verifySameOperandsAndResultType(), verifyShapeOrExtentTensorOp(), verifySizeOrIndexOp(), walkReferenceCountedValues(), and wrapInExecuteRegion().
|
inline |
Definition at line 704 of file Operation.h.
References getBlockOperands(), and getNumSuccessors().
Referenced by eraseTerminatorSuccessorOperands(), getPHISourceValue(), mlir::OpTrait::OneSuccessor< ConcreteType >::getSuccessor(), mlir::Block::getSuccessor(), mlir::OpTrait::detail::MultiSuccessorTraitBase< ConcreteType, TraitType >::getSuccessor(), mlir::OperationFingerPrint::OperationFingerPrint(), propagateTerminatorLiveness(), transformCyclesToSCFLoops(), and mlir::detail::verifyBranchSuccessorOperands().
|
inline |
Definition at line 699 of file Operation.h.
Referenced by mlir::bufferization::bufferizeBlockSignature(), clone(), mlir::OpTrait::detail::MultiSuccessorTraitBase< ConcreteType, TraitType >::getSuccessors(), mlir::OperationEquivalence::isRegionEquivalentTo(), propagateTerminatorLiveness(), successor_begin(), successor_end(), verifyTerminatorSuccessors(), mlir::dataflow::DeadCodeAnalysis::visit(), and mlir::dataflow::LivenessAnalysis::visitBranchOperand().
|
inline |
Returns a range of all users.
Definition at line 869 of file Operation.h.
References user_begin(), and user_end().
Referenced by collapseBranch(), createNewAliasScopesFromNoAliasParameter(), mlir::bufferization::findCommonDominator(), findUnusedStore(), fuseIfLegal(), getFirstUserOfLoop(), getForwardSliceImpl(), mlir::affine::getFusionComputeCost(), getLastDependentOpInRange(), mlir::nvgpu::getUserContract(), handleResultImpl(), hasBindingUse(), hasLifetimeMarkers(), inferFragType(), mlir::affine::MemRefDependenceGraph::init(), insertionPointDominatesUses(), isOpSibling(), mlir::matchReduction(), mlir::moveLoopInvariantCode(), mlir::memref::multiBuffer(), mlir::mesh::shardedBlockArgumentTypes(), and visit().
|
inline |
Returns a range of all uses, which is useful for iterating over all uses.
Definition at line 842 of file Operation.h.
References getResults(), and mlir::ResultRange::getUses().
Referenced by hasOneUse(), replaceUsesAndPropagateType(), and mlir::memref::resultIsNotRead().
|
inline |
Return true if the operation has an attribute with the provided name, false otherwise.
Definition at line 555 of file Operation.h.
References getInherentAttr(), and getPropertiesStorageSize().
Referenced by isParallelRegionBoundary(), mlir::detail::AttrOpMatcher::match(), shouldUseBarePtrCallConv(), and mlir::spirv::verifyIntegerDotProduct().
|
inline |
Definition at line 562 of file Operation.h.
References getInherentAttr(), and getPropertiesStorageSize().
|
inline |
Definition at line 570 of file Operation.h.
llvm::hash_code Operation::hashProperties | ( | ) |
Compute a hash for the op properties (if any).
Definition at line 370 of file Operation.cpp.
References getPropertiesStorage(), and mlir::OperationName::hashOpProperties().
Referenced by mlir::OperationEquivalence::computeHash(), and mlir::OperationFingerPrint::OperationFingerPrint().
|
inline |
Returns true if this operation has exactly one use.
Definition at line 845 of file Operation.h.
References getUses().
Referenced by inferFragType(), and mlir::matchReduction().
|
inline |
Returns true if InterfaceT
has been promised by the dialect or implemented.
Definition at line 738 of file Operation.h.
References mlir::OperationName::hasPromiseOrImplementsInterface().
|
inline |
Definition at line 701 of file Operation.h.
|
inline |
Returns true if the operation was registered with a particular trait, e.g.
hasTrait<OperandsAreSignlessIntegerLike>().
Definition at line 745 of file Operation.h.
References mlir::OperationName::hasTrait().
Referenced by AncestorKey::AncestorKey(), mlir::applyPatternsAndFoldGreedily(), canBeHoisted(), mlir::async::cloneConstantsIntoTheRegion(), collectEffects(), collectSymbolScopes(), collectValidReferencesFor(), mlir::OperationEquivalence::computeHash(), mlir::nvgpu::createAsyncGroups(), mlir::emitc::createExpression(), mlir::impl::ensureRegionTerminator(), executeGetOperandsResults(), findCommonAncestor(), findParent(), mlir::transform::TrackingListener::findReplacementOp(), mlir::op_definition_impl::foldTrait(), getBackwardSliceImpl(), getCommonBlockInAffineScope(), mlir::getEffectsRecursively(), mlir::affine::getEnclosingAffineOps(), mlir::transform::TransformState::getHandlesForPayloadOp(), mlir::transform::TransformState::getHandlesForPayloadValue(), mlir::LocalAliasAnalysis::getModRef(), mlir::SymbolTable::getNearestSymbolTable(), getParentWithTrait(), getSingleTerminatorUse(), mlir::OpTrait::hasElementwiseMappableTraits(), hasNeitherAllocateNorFreeSideEffect(), inferFragType(), mlir::spirv::isDirectInModuleLikeOp(), mlir::OperationEquivalence::isEquivalentTo(), mlir::isLegalForReturnOpTypeConversionPattern(), mlir::isMemoryEffectFree(), isMemRefNormalizable(), mlir::spirv::isNestedInFunctionOpInterface(), isOpItselfPotentialAutomaticAllocation(), isSequentialLoop(), mlir::affine::isTopLevelValue(), isUseSpeciallyKnownDead(), mlir::affine::isValidSymbol(), mlir::LLVM::lookupOrCreateFn(), mlir::SymbolTable::lookupSymbolIn(), lookupSymbolInImpl(), mlir::detail::constant_op_matcher::match(), mlir::detail::constant_op_binder< AttrT >::match(), AllocaScopeHoister::matchAndRewrite(), SortCommutativeOperands::matchAndRewrite(), mlir::transform::detail::mergeSymbolsInto(), mlirBlockGetTerminator(), mlir::vector::populateVectorLinearizeTypeConversionsAndLegality(), propagateLiveness(), mlir::LLVM::satisfiesLLVMModule(), shouldBeInlined(), mlir::sortTopologically(), mlir::SymbolTable::SymbolTable(), mlir::OpTrait::impl::verifyIsIsolatedFromAbove(), visitOp(), mlir::JamBlockGatherer< OpTy >::walk(), walkSymbolTable(), mlir::SymbolTable::walkSymbolTables(), walkSymbolUses(), and wouldOpBeTriviallyDeadImpl().
void Operation::insertOperands | ( | unsigned | index, |
ValueRange | operands | ||
) |
Insert the given operands into the operand list at the given 'index'.
Definition at line 256 of file Operation.cpp.
References setOperands().
Referenced by mlir::gpu::addAsyncDependency(), addExecuteResults(), and mlir::MutableOperandRange::append().
|
inline |
Return true if this operation is an ancestor of the other
operation.
An operation is considered as its own ancestor, use isProperAncestor
to avoid this.
Definition at line 263 of file Operation.h.
References isProperAncestor().
Referenced by canBeHoisted(), collectValidReferencesFor(), dependsOnCarriedVals(), findCommonAncestor(), mlir::affine::hasNoInterveningEffect(), and replaceForAllWithNewSignature().
bool Operation::isBeforeInBlock | ( | Operation * | other | ) |
Given an operation 'other' that is within the same parent block, return whether the current operation is before 'other' in the operation list of the parent block.
Note: This function has an average complexity of O(1), but worst case may take O(N) where N is the number of operations within the parent block.
Definition at line 386 of file Operation.cpp.
References mlir::Block::isOpOrderValid(), and mlir::Block::recomputeOpOrder().
Referenced by canRemoveSrcNodeAfterFusion(), mlir::LivenessBlockInfo::currentlyLiveValues(), dominanceSort(), mlir::LivenessBlockInfo::getEndOperation(), getFirstUserOfLoop(), getFusedLoopNestInsertionPoint(), happensBefore(), mlir::affine::MemRefDependenceGraph::hasDependencePath(), hasNonAffineUsersOnPath(), mlir::Liveness::isDeadAfter(), isOpSibling(), mayExistInterleavedUses(), mlir::bufferization::ValueComparator::operator()(), mlir::detail::DominanceInfoBase< IsPostDom >::properlyDominatesImpl(), srcAppearsBeforeDstInAncestralBlock(), and verifyResultTypesAreInferrable().
bool Operation::isProperAncestor | ( | Operation * | other | ) |
Return true if this operation is a proper ancestor of the other
operation.
Definition at line 219 of file Operation.cpp.
References getParentOp().
Referenced by mlir::LocalAliasAnalysis::aliasImpl(), cloneAndFuseFirstUse(), findCommonAncestor(), happensBefore(), isAncestor(), isLocallyDefined(), mlir::AnalysisManager::nest(), and replaceForAllWithNewSignature().
|
inline |
Returns true if this operation has a registered operation description, otherwise false.
Definition at line 129 of file Operation.h.
References getName(), and mlir::OperationName::isRegistered().
Referenced by mlir::mayBeGraphRegion().
|
inline |
Returns true if the results of this operation are used outside of the given block.
Definition at line 852 of file Operation.h.
References getOpResults(), and mlir::Value::isUsedOutsideOfBlock().
|
inline |
Returns true if the operation might have the provided trait.
This means that either the operation is unregistered, or it was registered with the provide trait.
Definition at line 753 of file Operation.h.
References mlir::OperationName::mightHaveTrait().
Referenced by create(), ensureDistinctSuccessors(), mlir::linalg::detail::isContractionBody(), mlir::isNotBranchOpInterfaceOrReturnLikeOp(), isTerminator(), mlir::matchReduction(), mayBeValidWithoutTerminator(), mlir::Block::mightHaveTerminator(), and mlir::wouldOpBeTriviallyDead().
Unlink this operation from its current block and insert it right after iterator
in the specified block.
Definition at line 575 of file Operation.cpp.
References mlir::Block::end(), and moveBefore().
void Operation::moveAfter | ( | Operation * | existingOp | ) |
Unlink this operation from its current block and insert it right after existingOp
which may be in the same or another block in the same function.
Definition at line 569 of file Operation.cpp.
References getBlock().
Referenced by handleInlinedAllocas().
Unlink this operation from its current block and insert it right before iterator
in the specified block.
Unlink this operation from its current basic block and insert it right before iterator
in the specified basic block.
Definition at line 561 of file Operation.cpp.
References getBlock(), and mlir::Block::getOperations().
void Operation::moveBefore | ( | Operation * | existingOp | ) |
Unlink this operation from its current block and insert it right before existingOp
which may be in the same or another block in the same function.
Definition at line 555 of file Operation.cpp.
References getBlock().
Referenced by mlir::emitc::createExpression(), mlir::OperationFolder::insertKnownConstant(), moveAfter(), mlir::RewriterBase::moveOpBefore(), mlir::sortTopologically(), and mlir::OperationFolder::tryToFold().
|
inline |
Definition at line 369 of file Operation.h.
References getOperands().
Referenced by mlir::OpTrait::detail::MultiOperandTraitBase< ConcreteType, TraitType >::operand_begin(), operand_type_begin(), mlir::affine::replaceAllMemRefUsesWith(), and transformMemRefLoadWithReducedRank().
|
inline |
Definition at line 370 of file Operation.h.
References getOperands().
Referenced by mlir::OpTrait::detail::MultiOperandTraitBase< ConcreteType, TraitType >::operand_end(), and operand_type_end().
|
inline |
Definition at line 390 of file Operation.h.
References operand_begin().
Referenced by getElementalFuncTypeForOp(), and mlir::OpTrait::detail::MultiOperandTraitBase< ConcreteType, TraitType >::operand_type_begin().
|
inline |
Definition at line 391 of file Operation.h.
References operand_end().
Referenced by getElementalFuncTypeForOp(), and mlir::OpTrait::detail::MultiOperandTraitBase< ConcreteType, TraitType >::operand_type_end().
|
inline |
Sets default attributes on unset attributes.
Definition at line 658 of file Operation.h.
References getAttrDictionary(), getContext(), mlir::NamedAttrList::getDictionary(), mlir::OperationName::populateDefaultAttrs(), and setAttrs().
void Operation::print | ( | raw_ostream & | os, |
AsmState & | state | ||
) |
Definition at line 3962 of file AsmPrinter.cpp.
void Operation::print | ( | raw_ostream & | os, |
const OpPrintingFlags & | flags = std::nullopt |
||
) |
Definition at line 3956 of file AsmPrinter.cpp.
References findParent(), and mlir::OpPrintingFlags::shouldUseLocalScope().
Referenced by mlir::Diagnostic::appendOp(), doVerifyRoundTrip(), is2To4Sparsity(), mlir::ProgramPoint::print(), mlir::OpState::print(), printIR(), printOp(), and mlir::walkAndApplyPatterns().
void Operation::remove | ( | ) |
Remove the operation from its parent block, but don't delete it.
Definition at line 547 of file Operation.cpp.
References getBlock().
Referenced by mlir::nvgpu::createAsyncGroups(), and transformCyclesToSCFLoops().
|
inline |
Remove the attribute with the specified name if it exists.
Return the attribute that was erased, or nullptr if there was no attribute with such name.
Definition at line 595 of file Operation.h.
References mlir::NamedAttrList::erase(), getContext(), mlir::NamedAttrList::getDictionary(), getInherentAttr(), getPropertiesStorageSize(), and setInherentAttr().
Referenced by removeAttr(), and mlir::SymbolTable::setSymbolVisibility().
|
inline |
Definition at line 608 of file Operation.h.
References mlir::get(), getContext(), and removeAttr().
|
inline |
Remove the discardable attribute with the specified name if it exists.
Return the attribute that was erased, or nullptr if there was no attribute with such name.
Definition at line 467 of file Operation.h.
References mlir::NamedAttrList::erase(), getContext(), and mlir::NamedAttrList::getDictionary().
Referenced by removeDiscardableAttr().
|
inline |
Definition at line 474 of file Operation.h.
References mlir::get(), getContext(), and removeDiscardableAttr().
|
inline |
Replace all uses of results of this operation with the provided 'values'.
Definition at line 272 of file Operation.h.
References getResults(), and mlir::ResultRange::replaceAllUsesWith().
Referenced by convertToLaunchFuncOp(), mlir::affine::promoteIfSingleIteration(), mlir::OpTrait::OneResult< ConcreteType >::replaceAllUsesWith(), mlir::OpTrait::detail::MultiResultTraitBase< ConcreteType, TraitType >::replaceAllUsesWith(), transformToStructuredCFBranches(), and updateCalls().
Replace any uses of 'from' with 'to' within this operation.
Definition at line 227 of file Operation.cpp.
References getOpOperands().
Referenced by mlir::inlineCall(), and replaceConstantUsesOf().
|
inline |
Replace uses of results of this operation with the provided values
if the given callback returns true.
Definition at line 279 of file Operation.h.
References getResults(), and mlir::ResultRange::replaceUsesWithIf().
Referenced by mlir::mesh::maybeInsertSourceShardingAnnotation().
|
inline |
Definition at line 408 of file Operation.h.
References getResults().
Referenced by mlir::query::extractFunction(), and mlir::OpTrait::detail::MultiResultTraitBase< ConcreteType, TraitType >::result_begin().
|
inline |
Definition at line 409 of file Operation.h.
References getResults().
Referenced by mlir::query::extractFunction(), and mlir::OpTrait::detail::MultiResultTraitBase< ConcreteType, TraitType >::result_end().
|
inline |
Definition at line 421 of file Operation.h.
References getResultTypes().
Referenced by getElementalFuncTypeForOp(), mlir::OperationFolder::insertKnownConstant(), materializeConversion(), and mlir::OpTrait::detail::MultiResultTraitBase< ConcreteType, TraitType >::result_type_begin().
|
inline |
Definition at line 422 of file Operation.h.
References getResultTypes().
Referenced by getElementalFuncTypeForOp(), and mlir::OpTrait::detail::MultiResultTraitBase< ConcreteType, TraitType >::result_type_end().
|
inline |
If the an attribute exists with the specified name, change it to the new value.
Otherwise, add a new attribute with the specified name/value.
Definition at line 577 of file Operation.h.
References getContext(), mlir::NamedAttrList::getDictionary(), getInherentAttr(), getPropertiesStorageSize(), mlir::NamedAttrList::set(), and setInherentAttr().
Referenced by mlir::gpu::addAsyncDependency(), annotateConflict(), mlir::sparse_tensor::getFunc(), getLibraryCallSymbolRef(), lowerAsEntryFunction(), matchAndReplaceDepthwiseConv(), mlir::gpu::index_lowering::OpLowering< Op, XOp, YOp, ZOp >::matchAndRewrite(), outlineKernelFuncImpl(), setAttr(), setInPlaceOpOperand(), mlir::SymbolTable::setSymbolName(), mlir::SymbolTable::setSymbolVisibility(), and mlir::vector::splitFullAndPartialTransfer().
|
inline |
Definition at line 588 of file Operation.h.
References mlir::get(), getContext(), and setAttr().
void Operation::setAttrs | ( | ArrayRef< NamedAttribute > | newAttrs | ) |
Definition at line 323 of file Operation.cpp.
References mlir::get(), getContext(), getInherentAttr(), getPropertiesStorageSize(), and setInherentAttr().
void Operation::setAttrs | ( | DictionaryAttr | newAttrs | ) |
Set the attributes from a dictionary on this operation.
These methods are expensive: if the dictionnary only contains discardable attributes, setDiscardableAttrs
is more efficient.
Definition at line 305 of file Operation.cpp.
References mlir::get(), getContext(), getInherentAttr(), getPropertiesStorageSize(), and setInherentAttr().
Referenced by mlir::bufferization::func_ext::CallOpInterface::bufferize(), create(), ConvertTypesInSCFForOp::matchAndRewrite(), ConvertTypesInSCFIfOp::matchAndRewrite(), ConvertTypesInSCFWhileOp::matchAndRewrite(), populateDefaultAttrs(), mlir::scf::replaceAndCastForOpIterArg(), mlir::detail::AttrTypeReplacerBase< Concrete >::replaceElementsIn(), setDialectAttrs(), and mlir::dataflow::SparseConstantPropagation::visitOperation().
|
inline |
Set the dialect attributes for this operation, and preserve all inherent.
Definition at line 648 of file Operation.h.
References mlir::NamedAttrList::append(), getAttrs(), getContext(), mlir::NamedAttrList::getDictionary(), mlir::NamedAttrList::push_back(), and setAttrs().
|
inline |
Set a discardable attribute by name.
Definition at line 455 of file Operation.h.
References getContext(), mlir::NamedAttrList::getDictionary(), and mlir::NamedAttrList::set().
Referenced by setDiscardableAttr().
|
inline |
Definition at line 460 of file Operation.h.
References mlir::get(), getContext(), and setDiscardableAttr().
|
inline |
Definition at line 522 of file Operation.h.
References mlir::get(), getContext(), and setDiscardableAttrs().
|
inline |
Set the discardable attribute dictionary on this operation.
Definition at line 518 of file Operation.h.
Referenced by FoldTensorCastPackOp::matchAndRewrite(), and setDiscardableAttrs().
void Operation::setInherentAttr | ( | StringAttr | name, |
Attribute | value | ||
) |
Set an inherent attribute by name.
This method is available as a transient facility in the migration process to use Properties instead.
Definition at line 345 of file Operation.cpp.
References getName(), and mlir::OperationName::setInherentAttr().
Referenced by removeAttr(), setAttr(), and setAttrs().
|
inline |
Set the source location the operation was defined or derived from.
Definition at line 226 of file Operation.h.
Referenced by mlir::OperationFolder::insertKnownConstant(), mlir::detail::AttrTypeReplacerBase< Concrete >::replaceElementsIn(), and mlir::OperationFolder::tryToFold().
|
inline |
Definition at line 346 of file Operation.h.
References getOpOperand(), and mlir::IROperand< DerivedT, IRValueT >::set().
Referenced by mlir::MutableOperandRange::assign(), mlir::affine::createAffineComputationSlice(), mlir::affine::replaceAllMemRefUsesWith(), mlir::OpTrait::detail::MultiOperandTraitBase< ConcreteType, TraitType >::setOperand(), mlir::OpTrait::OneOperand< ConcreteType >::setOperand(), mlir::linalg::splitReduction(), mlir::linalg::splitReductionByScaling(), and tileAndFuseFirstExtractUseThroughContainingOpBlockArgument().
void Operation::setOperands | ( | unsigned | start, |
unsigned | length, | ||
ValueRange | operands | ||
) |
Replace the operands beginning at 'start' and ending at 'start' + 'length' with the ones provided in 'operands'.
'operands' may be smaller or larger than the range pointed to by 'start'+'length'.
Definition at line 246 of file Operation.cpp.
References getNumOperands(), and mlir::detail::OperandStorage::setOperands().
void Operation::setOperands | ( | ValueRange | operands | ) |
Replace the current operands of this operation with the ones provided in 'operands'.
Definition at line 237 of file Operation.cpp.
References mlir::detail::OperandStorage::setOperands().
Referenced by mlir::affine::affineParallelize(), mlir::MutableOperandRange::assign(), mlir::Region::cloneInto(), generateUnrolledLoop(), insertOperands(), SortCommutativeOperands::matchAndRewrite(), and mlir::dataflow::SparseConstantPropagation::visitOperation().
LogicalResult Operation::setPropertiesFromAttribute | ( | Attribute | attr, |
function_ref< InFlightDiagnostic()> | emitError | ||
) |
Set the properties from the provided attribute.
This is an expensive operation that can fail if the attribute is not matching the expectations of the properties for this operation. This is mostly useful for unregistered operations or used when parsing the generic format. An optional diagnostic emitter can be passed in for richer errors, if none is passed then behavior is undefined in error case.
Definition at line 355 of file Operation.cpp.
References mlir::OpaqueProperties::as(), emitError(), getName(), getPropertiesStorage(), and getRegisteredInfo().
Referenced by mlir::OperationState::setProperties().
void Operation::setSuccessor | ( | Block * | block, |
unsigned | index | ||
) |
Definition at line 605 of file Operation.cpp.
References getBlockOperands(), and getNumSuccessors().
Referenced by mlir::OpTrait::detail::MultiSuccessorTraitBase< ConcreteType, TraitType >::setSuccessor(), and mlir::OpTrait::OneSuccessor< ConcreteType >::setSuccessor().
|
inline |
Definition at line 697 of file Operation.h.
References getSuccessors().
|
inline |
Definition at line 698 of file Operation.h.
References getSuccessors().
|
inline |
Definition at line 838 of file Operation.h.
References getResults(), and mlir::ResultRange::use_begin().
Referenced by user_begin().
|
inline |
Returns true if this operation has no uses.
Definition at line 848 of file Operation.h.
References getResults(), and mlir::ResultRange::use_empty().
Referenced by mlir::RewriterBase::eraseBlock(), mlir::RewriterBase::eraseOp(), getConsumerFromLoopUses(), mlir::isOpTriviallyDead(), isResultValueDead(), and mlir::OpState::use_empty().
|
inline |
Definition at line 839 of file Operation.h.
References getResults(), and mlir::ResultRange::use_end().
Referenced by user_end().
|
inline |
Definition at line 865 of file Operation.h.
References use_begin().
Referenced by getUsers(), and inferFragType().
|
inline |
|
inline |
Walk the operation by calling the callback for each nested operation (including this one), block or region, depending on the callback provided.
The order in which regions, blocks and operations at the same nesting level are visited (e.g., lexicographical or reverse lexicographical order) is determined by 'Iterator'. The walk order for enclosing regions, blocks and operations with respect to their nested ones is specified by 'Order' (post-order by default). A callback on a block or operation is allowed to erase that block or operation if either:
The callback method can take any of the following forms: void(Operation*) : Walk all operations opaquely.
Definition at line 793 of file Operation.h.
Referenced by mlir::bufferization::OneShotAnalysisState::analyzeOp(), mlir::applyPartialOneToNConversion(), buildBlockMapping(), canBeHoisted(), mlir::affine::LoopNestStateCollector::collect(), mlir::OperationConverter::convertOperations(), convertTargetOpsInNest(), mlir::nvgpu::createAsyncGroups(), createNewAliasScopesFromNoAliasParameter(), mlir::DataLayoutAnalysis::DataLayoutAnalysis(), mlir::bufferization::deallocateBuffers(), mlir::LLVM::detail::DebugTranslation::DebugTranslation(), mlir::LLVM::ensureDistinctSuccessors(), mlir::memref::eraseDeadAllocAndStores(), mlir::finalizeParallelLoopToGPUConversion(), findPayloadRoot(), mlir::transform::gpu::findTopLevelForallOp(), mlir::transform::detail::findTransformEntryPoint(), mlir::bufferization::OneShotAnalysisState::gatherUndefinedTensorUses(), getEffectsAfter(), getEffectsBefore(), getFirstDependentOpInRange(), getLastDependentOpInRange(), getLoadAndStoreMemRefAccesses(), mlir::query::matcher::MatchFinder::getMatches(), getOpToConvert(), getShmReadAndWriteOps(), hasNonAffineUsersOnPath(), mlir::linalg::hoistRedundantVectorBroadcasts(), mlir::linalg::hoistRedundantVectorTransfers(), isOpReady(), mlir::transform::gpu::mapNestedForallToThreadsImpl(), mlir::affine::NestedPattern::match(), mlir::detail::ConversionPatternRewriterImpl::notifyOpReplaced(), mlir::bufferization::OneShotAnalysisState::OneShotAnalysisState(), mlir::OperationFingerPrint::OperationFingerPrint(), mlir::nvgpu::optimizeSharedMemoryReadsAndWrites(), mlir::populateConversionTargetFromOperation(), mlir::Liveness::print(), printFunctionBody(), mlir::detail::AttrTypeReplacerBase< Concrete >::recursivelyReplaceElementsIn(), mlir::vector::transferOpflowOpt(), validateSupportedControlFlow(), mlir::OpState::walk(), and walkReferenceCountedValues().
|
inline |
Generic walker with a stage aware callback.
Walk the operation by calling the callback for each nested operation (including this one) N+1 times, where N is the number of regions attached to that operation.
The callback method can take any of the following forms: void(Operation *, const WalkStage &) : Walk all operation opaquely
Definition at line 821 of file Operation.h.
References mlir::detail::walk().
Definition at line 1072 of file Operation.h.
Definition at line 1075 of file Operation.h.
Definition at line 1066 of file Operation.h.
Definition at line 1075 of file Operation.h.