MLIR  20.0.0git
Classes | Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
mlir::Operation Class Referencefinal

Operation is the basic unit of execution within MLIR. More...

#include "mlir/IR/Operation.h"

+ Inheritance diagram for mlir::Operation:

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< RegisteredOperationNamegetRegisteredInfo ()
 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...
 
Operationclone (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...
 
Operationclone (CloneOptions options=CloneOptions::all())
 
OperationcloneWithoutRegions (IRMapping &mapper)
 Create a partial copy of this operation without traversing into attached regions. More...
 
OperationcloneWithoutRegions ()
 Create a partial copy of this operation without traversing into attached regions. More...
 
BlockgetBlock ()
 Returns the operation block that contains this operation. More...
 
MLIRContextgetContext ()
 Return the context this operation is associated with. More...
 
DialectgetDialect ()
 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...
 
RegiongetParentRegion ()
 Returns the region to which the instruction belongs. More...
 
OperationgetParentOp ()
 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>
OperationgetParentWithTrait ()
 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< OpOperandgetOpOperands ()
 
OpOperandgetOpOperand (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< AttributegetInherentAttr (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< NamedAttributegetAttrs ()
 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< RegiongetRegions ()
 Returns the regions held by this operation. More...
 
RegiongetRegion (unsigned index)
 Returns the region held by this operation at position 'index'. More...
 
MutableArrayRef< BlockOperandgetBlockOperands ()
 
succ_iterator successor_begin ()
 
succ_iterator successor_end ()
 
SuccessorRange getSuccessors ()
 
bool hasSuccessors ()
 
unsigned getNumSuccessors ()
 
BlockgetSuccessor (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 Operationcreate (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 Operationcreate (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 Operationcreate (const OperationState &state)
 Create a new Operation from the fields stored in state. More...
 
static Operationcreate (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 >
 

Detailed Description

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:

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.

Member Typedef Documentation

◆ dialect_attr_range

Definition at line 629 of file Operation.h.

◆ operand_iterator

using mlir::Operation::operand_iterator = operand_range::iterator

Definition at line 367 of file Operation.h.

◆ operand_range

Definition at line 366 of file Operation.h.

◆ operand_type_iterator

Definition at line 388 of file Operation.h.

◆ operand_type_range

Definition at line 389 of file Operation.h.

◆ result_iterator

using mlir::Operation::result_iterator = result_range::iterator

Definition at line 406 of file Operation.h.

◆ result_range

Support result iteration.

Definition at line 405 of file Operation.h.

◆ result_type_iterator

Support result type iteration.

Definition at line 419 of file Operation.h.

◆ result_type_range

Definition at line 420 of file Operation.h.

◆ succ_iterator

using mlir::Operation::succ_iterator = SuccessorRange::iterator

Definition at line 696 of file Operation.h.

◆ use_iterator

Definition at line 835 of file Operation.h.

◆ use_range

Definition at line 836 of file Operation.h.

◆ user_iterator

Definition at line 862 of file Operation.h.

◆ user_range

Definition at line 863 of file Operation.h.

Member Function Documentation

◆ clone() [1/2]

Operation * Operation::clone ( CloneOptions  options = CloneOptions::all())

Definition at line 751 of file Operation.cpp.

References clone(), and options.

◆ clone() [2/2]

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().

◆ cloneWithoutRegions() [1/2]

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.

◆ cloneWithoutRegions() [2/2]

Operation * Operation::cloneWithoutRegions ( IRMapping mapper)

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().

◆ copyProperties()

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().

◆ create() [1/4]

Operation * Operation::create ( const OperationState state)
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.

◆ create() [2/4]

Operation * Operation::create ( Location  location,
OperationName  name,
TypeRange  resultTypes,
ValueRange  operands,
DictionaryAttr  attributes,
OpaqueProperties  properties,
BlockRange  successors,
unsigned  numRegions 
)
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().

◆ create() [3/4]

Operation * Operation::create ( Location  location,
OperationName  name,
TypeRange  resultTypes,
ValueRange  operands,
NamedAttrList &&  attributes,
OpaqueProperties  properties,
BlockRange  successors,
unsigned  numRegions 
)
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().

◆ create() [4/4]

Operation * Operation::create ( Location  location,
OperationName  name,
TypeRange  resultTypes,
ValueRange  operands,
NamedAttrList &&  attributes,
OpaqueProperties  properties,
BlockRange  successors = {},
RegionRange  regions = {} 
)
static

Create a new Operation with the specific fields.

Definition at line 51 of file Operation.cpp.

References create(), getRegion(), and mlir::Region::takeBody().

◆ destroy()

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().

◆ dialect_attr_begin()

dialect_attr_iterator mlir::Operation::dialect_attr_begin ( )
inline

Definition at line 637 of file Operation.h.

References getAttrs().

◆ dialect_attr_end()

dialect_attr_iterator mlir::Operation::dialect_attr_end ( )
inline

Definition at line 641 of file Operation.h.

References getAttrs().

◆ dropAllDefinedValueUses()

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().

◆ dropAllReferences()

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().

◆ dropAllUses()

void mlir::Operation::dropAllUses ( )
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().

◆ dump()

void Operation::dump ( )

◆ emitError()

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().

◆ emitOpError()

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().

◆ emitRemark()

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().

◆ emitWarning()

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().

◆ erase()

void Operation::erase ( )

◆ eraseOperand()

void mlir::Operation::eraseOperand ( unsigned  idx)
inline

Erase the operand at position idx.

Definition at line 351 of file Operation.h.

References eraseOperands().

◆ eraseOperands() [1/2]

void mlir::Operation::eraseOperands ( const BitVector &  eraseIndices)
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().

◆ eraseOperands() [2/2]

void mlir::Operation::eraseOperands ( unsigned  idx,
unsigned  length = 1 
)
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().

◆ fold() [1/2]

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.

  • the elements in "operands" will correspond directly to the operands of the operation, but may be null if non-constant.

If folding was successful, this function returns "success".

  • If this operation was modified in-place (but not folded away), results is empty.
  • Otherwise, 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().

◆ fold() [2/2]

LogicalResult Operation::fold ( SmallVectorImpl< OpFoldResult > &  results)

Attempt to fold this operation.

If folding was successful, this function returns "success".

  • If this operation was modified in-place (but not folded away), results is empty.
  • Otherwise, 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().

◆ getAttr() [1/2]

Attribute mlir::Operation::getAttr ( StringAttr  name)
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().

◆ getAttr() [2/2]

Attribute mlir::Operation::getAttr ( StringRef  name)
inline

Definition at line 536 of file Operation.h.

References getInherentAttr(), and getPropertiesStorageSize().

◆ getAttrDictionary()

DictionaryAttr Operation::getAttrDictionary ( )

◆ getAttrOfType() [1/2]

template<typename AttrClass >
AttrClass mlir::Operation::getAttrOfType ( StringAttr  name)
inline

◆ getAttrOfType() [2/2]

template<typename AttrClass >
AttrClass mlir::Operation::getAttrOfType ( StringRef  name)
inline

Definition at line 549 of file Operation.h.

References getAttr().

◆ getAttrs()

ArrayRef<NamedAttribute> mlir::Operation::getAttrs ( )
inline

◆ getBlock()

Block* mlir::Operation::getBlock ( )
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().

◆ getBlockOperands()

MutableArrayRef<BlockOperand> mlir::Operation::getBlockOperands ( )
inline

◆ getContext()

MLIRContext* mlir::Operation::getContext ( )
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().

◆ getDialect()

Dialect* mlir::Operation::getDialect ( )
inline

◆ getDialectAttrs()

dialect_attr_range mlir::Operation::getDialectAttrs ( )
inline

Return a range corresponding to the dialect attributes for this operation.

Definition at line 632 of file Operation.h.

References getAttrs().

◆ getDiscardableAttr() [1/2]

Attribute mlir::Operation::getDiscardableAttr ( StringAttr  name)
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.

◆ getDiscardableAttr() [2/2]

Attribute mlir::Operation::getDiscardableAttr ( StringRef  name)
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().

◆ getDiscardableAttrDictionary()

DictionaryAttr mlir::Operation::getDiscardableAttrDictionary ( )
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().

◆ getDiscardableAttrs()

auto mlir::Operation::getDiscardableAttrs ( )
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().

◆ getInherentAttr()

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().

◆ getLoc()

Location mlir::Operation::getLoc ( )
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().

◆ getName()

OperationName mlir::Operation::getName ( )
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().

◆ getNumOperands()

unsigned mlir::Operation::getNumOperands ( )
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().

◆ getNumRegions()

unsigned mlir::Operation::getNumRegions ( )
inline

◆ getNumResults()

unsigned mlir::Operation::getNumResults ( )
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().

◆ getNumSuccessors()

unsigned mlir::Operation::getNumSuccessors ( )
inline

◆ getOperand()

Value mlir::Operation::getOperand ( unsigned  idx)
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().

◆ getOperands()

operand_range mlir::Operation::getOperands ( )
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().

◆ getOperandTypes()

operand_type_range mlir::Operation::getOperandTypes ( )
inline

◆ getOpOperand()

OpOperand& mlir::Operation::getOpOperand ( unsigned  idx)
inline

◆ getOpOperands()

MutableArrayRef<OpOperand> mlir::Operation::getOpOperands ( )
inline

◆ getOpResult()

OpResult mlir::Operation::getOpResult ( unsigned  idx)
inline

Definition at line 416 of file Operation.h.

References getResult().

Referenced by applyTilingToAll().

◆ getOpResults()

result_range mlir::Operation::getOpResults ( )
inline

◆ getParentOfType()

template<typename OpTy >
OpTy mlir::Operation::getParentOfType ( )
inline

◆ getParentOp()

Operation* mlir::Operation::getParentOp ( )
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().

◆ getParentRegion()

Region* mlir::Operation::getParentRegion ( )
inline

◆ getParentWithTrait()

template<template< typename T > class Trait>
Operation* mlir::Operation::getParentWithTrait ( )
inline

◆ getPropertiesAsAttribute()

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().

◆ getPropertiesStorage() [1/2]

OpaqueProperties mlir::Operation::getPropertiesStorage ( )
inline

◆ getPropertiesStorage() [2/2]

OpaqueProperties mlir::Operation::getPropertiesStorage ( ) const
inline

Definition at line 901 of file Operation.h.

◆ getPropertiesStorageSize()

int mlir::Operation::getPropertiesStorageSize ( ) const
inline

Returns the properties storage size.

Definition at line 892 of file Operation.h.

Referenced by getAttr(), getAttrDictionary(), hasAttr(), removeAttr(), setAttr(), and setAttrs().

◆ getPropertiesStorageUnsafe()

OpaqueProperties mlir::Operation::getPropertiesStorageUnsafe ( )
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().

◆ getRawDictionaryAttrs()

DictionaryAttr mlir::Operation::getRawDictionaryAttrs ( )
inline

◆ getRegion()

Region& mlir::Operation::getRegion ( unsigned  index)
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().

◆ getRegions()

MutableArrayRef<Region> mlir::Operation::getRegions ( )
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().

◆ getRegisteredInfo()

std::optional<RegisteredOperationName> mlir::Operation::getRegisteredInfo ( )
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().

◆ getResult()

OpResult mlir::Operation::getResult ( unsigned  idx)
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().

◆ getResults()

result_range mlir::Operation::getResults ( )
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().

◆ getResultTypes()

result_type_range mlir::Operation::getResultTypes ( )
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().

◆ getSuccessor()

Block* mlir::Operation::getSuccessor ( unsigned  index)
inline

◆ getSuccessors()

SuccessorRange mlir::Operation::getSuccessors ( )
inline

◆ getUsers()

user_range mlir::Operation::getUsers ( )
inline

◆ getUses()

use_range mlir::Operation::getUses ( )
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().

◆ hasAttr() [1/2]

bool mlir::Operation::hasAttr ( StringAttr  name)
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().

◆ hasAttr() [2/2]

bool mlir::Operation::hasAttr ( StringRef  name)
inline

Definition at line 562 of file Operation.h.

References getInherentAttr(), and getPropertiesStorageSize().

◆ hasAttrOfType()

template<typename AttrClass , typename NameT >
bool mlir::Operation::hasAttrOfType ( NameT &&  name)
inline

Definition at line 570 of file Operation.h.

◆ hashProperties()

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().

◆ hasOneUse()

bool mlir::Operation::hasOneUse ( )
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().

◆ hasPromiseOrImplementsInterface()

template<typename InterfaceT >
bool mlir::Operation::hasPromiseOrImplementsInterface ( ) const
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().

◆ hasSuccessors()

bool mlir::Operation::hasSuccessors ( )
inline

Definition at line 701 of file Operation.h.

◆ hasTrait()

template<template< typename T > class Trait>
bool mlir::Operation::hasTrait ( )
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().

◆ insertOperands()

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().

◆ isAncestor()

bool mlir::Operation::isAncestor ( Operation other)
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().

◆ isBeforeInBlock()

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().

◆ isProperAncestor()

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().

◆ isRegistered()

bool mlir::Operation::isRegistered ( )
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().

◆ isUsedOutsideOfBlock()

bool mlir::Operation::isUsedOutsideOfBlock ( Block block)
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().

◆ mightHaveTrait()

template<template< typename T > class Trait>
bool mlir::Operation::mightHaveTrait ( )
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().

◆ moveAfter() [1/2]

void Operation::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.

Definition at line 575 of file Operation.cpp.

References mlir::Block::end(), and moveBefore().

◆ moveAfter() [2/2]

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().

◆ moveBefore() [1/2]

void Operation::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.

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().

◆ moveBefore() [2/2]

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().

◆ operand_begin()

operand_iterator mlir::Operation::operand_begin ( )
inline

◆ operand_end()

operand_iterator mlir::Operation::operand_end ( )
inline

◆ operand_type_begin()

operand_type_iterator mlir::Operation::operand_type_begin ( )
inline

◆ operand_type_end()

operand_type_iterator mlir::Operation::operand_type_end ( )
inline

◆ populateDefaultAttrs()

void mlir::Operation::populateDefaultAttrs ( )
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().

◆ print() [1/2]

void Operation::print ( raw_ostream &  os,
AsmState state 
)

Definition at line 3962 of file AsmPrinter.cpp.

◆ print() [2/2]

void Operation::print ( raw_ostream &  os,
const OpPrintingFlags flags = std::nullopt 
)

◆ remove()

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().

◆ removeAttr() [1/2]

Attribute mlir::Operation::removeAttr ( StringAttr  name)
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().

◆ removeAttr() [2/2]

Attribute mlir::Operation::removeAttr ( StringRef  name)
inline

Definition at line 608 of file Operation.h.

References mlir::get(), getContext(), and removeAttr().

◆ removeDiscardableAttr() [1/2]

Attribute mlir::Operation::removeDiscardableAttr ( StringAttr  name)
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().

◆ removeDiscardableAttr() [2/2]

Attribute mlir::Operation::removeDiscardableAttr ( StringRef  name)
inline

Definition at line 474 of file Operation.h.

References mlir::get(), getContext(), and removeDiscardableAttr().

◆ replaceAllUsesWith()

template<typename ValuesT >
void mlir::Operation::replaceAllUsesWith ( ValuesT &&  values)
inline

◆ replaceUsesOfWith()

void Operation::replaceUsesOfWith ( Value  from,
Value  to 
)

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().

◆ replaceUsesWithIf()

template<typename ValuesT >
void mlir::Operation::replaceUsesWithIf ( ValuesT &&  values,
function_ref< bool(OpOperand &)>  shouldReplace 
)
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().

◆ result_begin()

result_iterator mlir::Operation::result_begin ( )
inline

◆ result_end()

result_iterator mlir::Operation::result_end ( )
inline

◆ result_type_begin()

result_type_iterator mlir::Operation::result_type_begin ( )
inline

◆ result_type_end()

result_type_iterator mlir::Operation::result_type_end ( )
inline

◆ setAttr() [1/2]

void mlir::Operation::setAttr ( StringAttr  name,
Attribute  value 
)
inline

◆ setAttr() [2/2]

void mlir::Operation::setAttr ( StringRef  name,
Attribute  value 
)
inline

Definition at line 588 of file Operation.h.

References mlir::get(), getContext(), and setAttr().

◆ setAttrs() [1/2]

void Operation::setAttrs ( ArrayRef< NamedAttribute newAttrs)

◆ setAttrs() [2/2]

void Operation::setAttrs ( DictionaryAttr  newAttrs)

◆ setDialectAttrs()

template<typename DialectAttrT >
void mlir::Operation::setDialectAttrs ( DialectAttrT &&  dialectAttrs)
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().

◆ setDiscardableAttr() [1/2]

void mlir::Operation::setDiscardableAttr ( StringAttr  name,
Attribute  value 
)
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().

◆ setDiscardableAttr() [2/2]

void mlir::Operation::setDiscardableAttr ( StringRef  name,
Attribute  value 
)
inline

Definition at line 460 of file Operation.h.

References mlir::get(), getContext(), and setDiscardableAttr().

◆ setDiscardableAttrs() [1/2]

void mlir::Operation::setDiscardableAttrs ( ArrayRef< NamedAttribute newAttrs)
inline

Definition at line 522 of file Operation.h.

References mlir::get(), getContext(), and setDiscardableAttrs().

◆ setDiscardableAttrs() [2/2]

void mlir::Operation::setDiscardableAttrs ( DictionaryAttr  newAttrs)
inline

Set the discardable attribute dictionary on this operation.

Definition at line 518 of file Operation.h.

Referenced by FoldTensorCastPackOp::matchAndRewrite(), and setDiscardableAttrs().

◆ setInherentAttr()

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().

◆ setLoc()

void mlir::Operation::setLoc ( Location  loc)
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().

◆ setOperand()

void mlir::Operation::setOperand ( unsigned  idx,
Value  value 
)
inline

◆ setOperands() [1/2]

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().

◆ setOperands() [2/2]

void Operation::setOperands ( ValueRange  operands)

◆ setPropertiesFromAttribute()

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().

◆ setSuccessor()

void Operation::setSuccessor ( Block block,
unsigned  index 
)

◆ successor_begin()

succ_iterator mlir::Operation::successor_begin ( )
inline

Definition at line 697 of file Operation.h.

References getSuccessors().

◆ successor_end()

succ_iterator mlir::Operation::successor_end ( )
inline

Definition at line 698 of file Operation.h.

References getSuccessors().

◆ use_begin()

use_iterator mlir::Operation::use_begin ( )
inline

Definition at line 838 of file Operation.h.

References getResults(), and mlir::ResultRange::use_begin().

Referenced by user_begin().

◆ use_empty()

bool mlir::Operation::use_empty ( )
inline

◆ use_end()

use_iterator mlir::Operation::use_end ( )
inline

Definition at line 839 of file Operation.h.

References getResults(), and mlir::ResultRange::use_end().

Referenced by user_end().

◆ user_begin()

user_iterator mlir::Operation::user_begin ( )
inline

Definition at line 865 of file Operation.h.

References use_begin().

Referenced by getUsers(), and inferFragType().

◆ user_end()

user_iterator mlir::Operation::user_end ( )
inline

Definition at line 866 of file Operation.h.

References use_end().

Referenced by getUsers().

◆ walk() [1/2]

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> mlir::Operation::walk ( FnT &&  callback)
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 walk is in post-order, or
  • the walk is in pre-order and the walk is skipped after the erasure.

The callback method can take any of the following forms: void(Operation*) : Walk all operations opaquely.

  • op->walk([](Operation nestedOp) { ...}); void(OpT) : Walk all operations of the given derived type.
  • op->walk([](ReturnOp returnOp) { ...}); WalkResult(Operation|OpT) : Walk operations, but allow for interruption/skipping.
  • op->walk([](... op) { // Skip the walk of this op based on some invariant. if (some_invariant) return WalkResult::skip(); // Interrupt, i.e cancel, the walk based on some invariant. if (another_invariant) return WalkResult::interrupt(); return WalkResult::advance(); });

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().

◆ walk() [2/2]

template<typename FnT , typename RetT = detail::walkResultType<FnT>>
std::enable_if_t<llvm::function_traits<std::decay_t<FnT> >::num_args == 2, RetT> mlir::Operation::walk ( FnT &&  callback)
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().

Friends And Related Function Documentation

◆ Block

friend class Block
friend

Definition at line 1072 of file Operation.h.

◆ llvm::ilist_node_with_parent< Operation, Block >

friend class llvm::ilist_node_with_parent< Operation, Block >
friend

Definition at line 1075 of file Operation.h.

◆ llvm::ilist_traits< Operation >

friend struct llvm::ilist_traits< Operation >
friend

Definition at line 1066 of file Operation.h.

◆ Value

friend class Value
friend

Definition at line 1075 of file Operation.h.


The documentation for this class was generated from the following files: