My Project
Classes | Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
mlir::Operation Class Referencefinal

#include <Operation.h>

Inheritance diagram for mlir::Operation:
Inheritance graph
[legend]
Collaboration diagram for mlir::Operation:
Collaboration graph
[legend]

Classes

class  dialect_attr_iterator
 A utility iterator that filters out non-dialect attributes. More...
 

Public Types

enum  TerminatorStatus { TerminatorStatus::Terminator, TerminatorStatus::NonTerminator, TerminatorStatus::Unknown }
 
using operand_range = OperandRange
 
using operand_iterator = operand_range::iterator
 
using operand_type_iterator = operand_range::type_iterator
 
using operand_type_range = iterator_range< operand_type_iterator >
 
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 = iterator_range< result_type_iterator >
 
using dialect_attr_range = iterator_range< dialect_attr_iterator >
 
using succ_iterator = SuccessorRange::iterator
 
- Public Types inherited from mlir::IRMultiObjectWithUseList< OpOperand >
using BaseType = IRObjectWithUseList< OpOperand >
 
using ValueType = typename OpOperand ::ValueType
 
using filtered_use_iterator = FilteredValueUseIterator< OpOperand >
 
using filtered_use_range = iterator_range< filtered_use_iterator >
 
using filtered_user_iterator = ValueUserIterator< filtered_use_iterator, OpOperand >
 
using filtered_user_range = iterator_range< filtered_user_iterator >
 
- Public Types inherited from mlir::IRObjectWithUseList< OpOperand >
using use_iterator = ValueUseIterator< OpOperand >
 
using use_range = iterator_range< use_iterator >
 
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...
 
const AbstractOperationgetAbstractOperation ()
 
bool isRegistered ()
 
void erase ()
 Remove this operation from its parent block and delete it. More...
 
Operationclone (BlockAndValueMapping &mapper)
 
Operationclone ()
 
OperationcloneWithoutRegions (BlockAndValueMapping &mapper)
 
OperationcloneWithoutRegions ()
 
BlockgetBlock ()
 Returns the operation block that contains this operation. More...
 
MLIRContextgetContext ()
 Return the context this operation is associated with. More...
 
DialectgetDialect ()
 
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 ()
 
OperationgetParentOp ()
 
template<typename OpTy >
OpTy getParentOfType ()
 Return the closest surrounding parent operation that is of type 'OpTy'. More...
 
bool isProperAncestor (Operation *other)
 
bool isAncestor (Operation *other)
 
void replaceUsesOfWith (Value from, Value to)
 Replace any uses of 'from' with 'to' within this operation. More...
 
template<typename ValuesT , typename = decltype(std::declval<ValuesT>().begin())>
void replaceAllUsesWith (ValuesT &&values)
 Replace all uses of results of this operation with the provided 'values'. More...
 
void replaceAllUsesWith (Operation *op)
 Replace all uses of results of this operation with results of 'op'. More...
 
void destroy ()
 Destroys this operation and its subclass data. More...
 
void dropAllReferences ()
 
void dropAllDefinedValueUses ()
 Drop uses of all values defined by this operation or its nested regions. More...
 
void moveBefore (Operation *existingOp)
 
void moveBefore (Block *block, llvm::iplist< Operation >::iterator iterator)
 
bool isBeforeInBlock (Operation *other)
 
void print (raw_ostream &os, OpPrintingFlags flags=llvm::None)
 
void dump ()
 
bool hasResizableOperandsList ()
 
void setOperands (ValueRange operands)
 
unsigned getNumOperands ()
 
Value getOperand (unsigned idx)
 
void setOperand (unsigned idx, Value value)
 
operand_iterator operand_begin ()
 
operand_iterator operand_end ()
 
operand_range getOperands ()
 Returns an iterator on the underlying Value's (Value ). More...
 
void eraseOperand (unsigned idx)
 Erase the operand at position idx. 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 ()
 
ArrayRef< NamedAttributegetAttrs ()
 Return all of the attributes on this operation. More...
 
NamedAttributeListgetAttrList ()
 Return the internal attribute list on this operation. More...
 
void setAttrs (NamedAttributeList newAttrs)
 
Attribute getAttr (Identifier name)
 Return the specified attribute if present, null otherwise. More...
 
Attribute getAttr (StringRef name)
 
template<typename AttrClass >
AttrClass getAttrOfType (Identifier name)
 
template<typename AttrClass >
AttrClass getAttrOfType (StringRef name)
 
void setAttr (Identifier name, Attribute value)
 
void setAttr (StringRef name, Attribute value)
 
NamedAttributeList::RemoveResult removeAttr (Identifier 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 dependent. 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 ()
 
operand_range getNonSuccessorOperands ()
 Return the operands of this operation that are not successor arguments. More...
 
operand_range getSuccessorOperands (unsigned index)
 
Value getSuccessorOperand (unsigned succIndex, unsigned opIndex)
 
bool hasSuccessors ()
 
unsigned getNumSuccessors ()
 
unsigned getNumSuccessorOperands (unsigned index)
 
BlockgetSuccessor (unsigned index)
 
void setSuccessor (Block *block, unsigned index)
 
void eraseSuccessorOperand (unsigned succIndex, unsigned opIndex)
 
unsigned getSuccessorOperandIndex (unsigned index)
 
Optional< std::pair< unsigned, unsigned > > decomposeSuccessorOperandIndex (unsigned operandIndex)
 
Optional< BlockArgumentgetSuccessorBlockArgument (unsigned operandIndex)
 
bool isCommutative ()
 Returns whether the operation is commutative. More...
 
bool hasNoSideEffect ()
 Returns whether the operation has side-effects. More...
 
TerminatorStatus getTerminatorStatus ()
 Returns the status of whether this operation is a terminator or not. More...
 
bool isKnownTerminator ()
 Returns if the operation is known to be a terminator. More...
 
bool isKnownNonTerminator ()
 Returns if the operation is known to not be a terminator. More...
 
bool isKnownIsolatedFromAbove ()
 
LogicalResult fold (ArrayRef< Attribute > operands, SmallVectorImpl< OpFoldResult > &results)
 Attempt to fold this operation using the Op's registered foldHook. More...
 
template<template< typename T > class Trait>
bool hasTrait ()
 
template<typename FnT , typename RetT = detail::walkResultType<FnT>>
RetT walk (FnT &&callback)
 
InFlightDiagnostic emitOpError (const Twine &message={})
 
InFlightDiagnostic emitError (const Twine &message={})
 
InFlightDiagnostic emitWarning (const Twine &message={})
 
InFlightDiagnostic emitRemark (const Twine &message={})
 
- Public Member Functions inherited from mlir::IRMultiObjectWithUseList< OpOperand >
void dropAllUses (ValueType value)
 Drop all uses of value from their respective owners. More...
 
void replaceAllUsesWith (ValueType oldValue, ValueType newValue)
 
filtered_use_iterator use_begin (ValueType value) const
 
filtered_use_iterator use_end (ValueType) const
 
filtered_use_range getUses (ValueType value) const
 
bool hasOneUse (ValueType value) const
 
bool use_empty (ValueType value) const
 
filtered_user_iterator user_begin (ValueType value) const
 
filtered_user_iterator user_end (ValueType value) const
 
filtered_user_range getUsers (ValueType value) const
 
- Public Member Functions inherited from mlir::IRObjectWithUseList< OpOperand >
 ~IRObjectWithUseList ()
 
void dropAllUses ()
 Drop all uses of this object from their respective owners. More...
 
void replaceAllUsesWith (typename OpOperand ::ValueType newValue)
 
use_iterator use_begin () const
 
use_iterator use_end () const
 
use_range getUses () const
 Returns a range of all uses, which is useful for iterating over all uses. More...
 
bool hasOneUse () const
 Returns true if this value has exactly one use. More...
 
bool use_empty () const
 Returns true if this value has no uses. More...
 
user_iterator user_begin () const
 
user_iterator user_end () const
 
user_range getUsers () const
 Returns a range of all users. More...
 

Static Public Member Functions

static Operationcreate (Location location, OperationName name, ArrayRef< Type > resultTypes, ArrayRef< Value > operands, ArrayRef< NamedAttribute > attributes, ArrayRef< Block *> successors, unsigned numRegions, bool resizableOperandList)
 Create a new Operation with the specific fields. More...
 
static Operationcreate (Location location, OperationName name, ArrayRef< Type > resultTypes, ArrayRef< Value > operands, NamedAttributeList attributes, ArrayRef< Block *> successors, unsigned numRegions, bool resizableOperandList)
 
static Operationcreate (const OperationState &state)
 Create a new Operation from the fields stored in state. More...
 
static Operationcreate (Location location, OperationName name, ArrayRef< Type > resultTypes, ArrayRef< Value > operands, NamedAttributeList attributes, ArrayRef< Block *> successors={}, RegionRange regions={}, bool resizableOperandList=false)
 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 >
 

Additional Inherited Members

- Protected Member Functions inherited from mlir::IRObjectWithUseList< OpOperand >
 IRObjectWithUseList ()
 
OpOperandgetFirstUse () const
 

Detailed Description

Operation is a basic unit of execution within a function. Operations can be nested within other operations effectively forming a tree. Child operations are organized into operation blocks represented by a 'Block' class.

Member Typedef Documentation

◆ dialect_attr_range

◆ operand_iterator

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

◆ operand_range

◆ operand_type_iterator

◆ operand_type_range

◆ result_iterator

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

◆ result_range

Support result iteration.

◆ result_type_iterator

Support result type iteration.

◆ result_type_range

◆ succ_iterator

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

Member Enumeration Documentation

◆ TerminatorStatus

Represents the status of whether an operation is a terminator. We represent an 'unknown' status because we want to support unregistered terminators.

Enumerator
Terminator 
NonTerminator 
Unknown 

Member Function Documentation

◆ clone() [1/2]

Operation * Operation::clone ( BlockAndValueMapping mapper)

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.

◆ clone() [2/2]

Operation * Operation::clone ( )

◆ cloneWithoutRegions() [1/2]

Operation * Operation::cloneWithoutRegions ( BlockAndValueMapping mapper)

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. Operands are remapped using mapper (if present), and mapper is updated to contain the results.

Create a deep copy of this operation but keep the operation regions empty. Operands are remapped using mapper (if present), and mapper is updated to contain the results.

◆ cloneWithoutRegions() [2/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.

◆ create() [1/4]

Operation * Operation::create ( Location  location,
OperationName  name,
ArrayRef< Type resultTypes,
ArrayRef< Value operands,
ArrayRef< NamedAttribute attributes,
ArrayRef< Block *>  successors,
unsigned  numRegions,
bool  resizableOperandList 
)
static

Create a new Operation with the specific fields.

◆ create() [2/4]

Operation * Operation::create ( Location  location,
OperationName  name,
ArrayRef< Type resultTypes,
ArrayRef< Value operands,
NamedAttributeList  attributes,
ArrayRef< Block *>  successors,
unsigned  numRegions,
bool  resizableOperandList 
)
static

Overload of create that takes an existing NamedAttributeList to avoid unnecessarily uniquing a list of attributes.

◆ create() [3/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.

◆ create() [4/4]

Operation * Operation::create ( Location  location,
OperationName  name,
ArrayRef< Type resultTypes,
ArrayRef< Value operands,
NamedAttributeList  attributes,
ArrayRef< Block *>  successors = {},
RegionRange  regions = {},
bool  resizableOperandList = false 
)
static

Create a new Operation with the specific fields.

◆ decomposeSuccessorOperandIndex()

Optional< std::pair< unsigned, unsigned > > Operation::decomposeSuccessorOperandIndex ( unsigned  operandIndex)

Return a pair (successorIndex, successorArgIndex) containing the index of the successor that operandIndex belongs to and the index of the argument to that successor that operandIndex refers to.

If operandIndex is not a successor operand, None is returned.

◆ destroy()

void Operation::destroy ( )

Destroys this operation and its subclass data.

Destroy this operation or one of its subclasses.

◆ dialect_attr_begin()

dialect_attr_iterator mlir::Operation::dialect_attr_begin ( )
inline

◆ dialect_attr_end()

dialect_attr_iterator mlir::Operation::dialect_attr_end ( )
inline

◆ 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.

◆ 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.

◆ 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.

◆ emitOpError()

InFlightDiagnostic Operation::emitOpError ( const Twine &  message = {})

Emit an error with the op name prefixed, like "'dim' op " which is convenient for verifiers.

◆ emitRemark()

InFlightDiagnostic Operation::emitRemark ( const Twine &  message = {})

Emit a remark about this operation, reporting up to any diagnostic handlers that may be listening.

◆ emitWarning()

InFlightDiagnostic Operation::emitWarning ( const Twine &  message = {})

Emit a warning about this operation, reporting up to any diagnostic handlers that may be listening.

◆ erase()

void Operation::erase ( )

Remove this operation from its parent block and delete it.

Remove this operation (and its descendants) from its Block and delete all of them.

◆ eraseOperand()

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

Erase the operand at position idx.

◆ eraseSuccessorOperand()

void mlir::Operation::eraseSuccessorOperand ( unsigned  succIndex,
unsigned  opIndex 
)
inline

Erase a specific operand from the operand list of the successor at 'index'.

◆ fold()

LogicalResult Operation::fold ( ArrayRef< Attribute operands,
SmallVectorImpl< OpFoldResult > &  results 
)

Attempt to fold this operation using the Op's registered foldHook.

Attempt to fold this operation with the specified constant operand values

  • the elements in "operands" will correspond directly to the operands of the operation, but may be null if non-constant. If folding is successful, this fills in the results vector. If not, results is unspecified.

◆ getAbstractOperation()

const AbstractOperation* mlir::Operation::getAbstractOperation ( )
inline

If this operation has a registered operation description, return it. Otherwise return null.

◆ getAttr() [1/2]

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

Return the specified attribute if present, null otherwise.

◆ getAttr() [2/2]

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

◆ getAttrList()

NamedAttributeList& mlir::Operation::getAttrList ( )
inline

Return the internal attribute list on this operation.

◆ getAttrOfType() [1/2]

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

◆ getAttrOfType() [2/2]

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

◆ getAttrs()

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

Return all of the attributes on this operation.

◆ getBlock()

Block* mlir::Operation::getBlock ( )
inline

Returns the operation block that contains this operation.

◆ getBlockOperands()

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

◆ getContext()

MLIRContext * Operation::getContext ( )

Return the context this operation is associated with.

◆ getDialect()

Dialect * Operation::getDialect ( )

Return the dialect this operation is associated with, or nullptr if the associated dialect is not registered.

◆ getDialectAttrs()

dialect_attr_range mlir::Operation::getDialectAttrs ( )
inline

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

◆ getLoc()

Location mlir::Operation::getLoc ( )
inline

The source location the operation was defined or derived from.

◆ getName()

OperationName mlir::Operation::getName ( )
inline

The name of an operation is the key identifier for it.

◆ getNonSuccessorOperands()

auto Operation::getNonSuccessorOperands ( )

Return the operands of this operation that are not successor arguments.

◆ getNumOperands()

unsigned mlir::Operation::getNumOperands ( )
inline

◆ getNumRegions()

unsigned mlir::Operation::getNumRegions ( )
inline

Returns the number of regions held by this operation.

◆ getNumResults()

unsigned Operation::getNumResults ( )

Return the number of results held by this operation.

◆ getNumSuccessorOperands()

unsigned mlir::Operation::getNumSuccessorOperands ( unsigned  index)
inline

◆ getNumSuccessors()

unsigned mlir::Operation::getNumSuccessors ( )
inline

◆ getOperand()

Value mlir::Operation::getOperand ( unsigned  idx)
inline

◆ getOperands()

operand_range mlir::Operation::getOperands ( )
inline

Returns an iterator on the underlying Value's (Value ).

◆ 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

◆ getOpResults()

result_range mlir::Operation::getOpResults ( )
inline

◆ getParentOfType()

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

Return the closest surrounding parent operation that is of type 'OpTy'.

◆ getParentOp()

Operation * Operation::getParentOp ( )

Returns the closest surrounding operation that contains this operation or nullptr if this is a top-level operation.

◆ getParentRegion()

Region * Operation::getParentRegion ( )

Returns the region to which the instruction belongs. Returns nullptr if the instruction is unlinked.

◆ getRegion()

Region& mlir::Operation::getRegion ( unsigned  index)
inline

Returns the region held by this operation at position 'index'.

◆ getRegions()

MutableArrayRef<Region> mlir::Operation::getRegions ( )
inline

Returns the regions held by this operation.

◆ getResult()

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

Get the 'idx'th result of this operation.

◆ getResults()

result_range mlir::Operation::getResults ( )
inline

◆ getResultTypes()

result_type_range mlir::Operation::getResultTypes ( )
inline

◆ getSuccessor()

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

◆ getSuccessorBlockArgument()

Optional<BlockArgument> mlir::Operation::getSuccessorBlockArgument ( unsigned  operandIndex)
inline

Returns the BlockArgument corresponding to operand operandIndex in some successor, or None if operandIndex isn't a successor operand index.

◆ getSuccessorOperand()

Value mlir::Operation::getSuccessorOperand ( unsigned  succIndex,
unsigned  opIndex 
)
inline

◆ getSuccessorOperandIndex()

unsigned Operation::getSuccessorOperandIndex ( unsigned  index)

Get the index of the first operand of the successor at the provided index.

◆ getSuccessorOperands()

auto Operation::getSuccessorOperands ( unsigned  index)

◆ getSuccessors()

SuccessorRange mlir::Operation::getSuccessors ( )
inline

◆ getTerminatorStatus()

TerminatorStatus mlir::Operation::getTerminatorStatus ( )
inline

Returns the status of whether this operation is a terminator or not.

◆ hasNoSideEffect()

bool mlir::Operation::hasNoSideEffect ( )
inline

Returns whether the operation has side-effects.

◆ hasResizableOperandsList()

bool mlir::Operation::hasResizableOperandsList ( )
inline

Returns if the operation has a resizable operation list, i.e. operands can be added.

◆ hasSuccessors()

bool mlir::Operation::hasSuccessors ( )
inline

◆ hasTrait()

template<template< typename T > class Trait>
bool mlir::Operation::hasTrait ( )
inline

Returns if the operation was registered with a particular trait, e.g. hasTrait<OperandsAreIntegerLike>().

◆ 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.

◆ 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.

◆ isCommutative()

bool mlir::Operation::isCommutative ( )
inline

Returns whether the operation is commutative.

◆ isKnownIsolatedFromAbove()

bool mlir::Operation::isKnownIsolatedFromAbove ( )
inline

Returns if the operation is known to be completely isolated from enclosing regions, i.e. no internal regions reference values defined above this operation.

◆ isKnownNonTerminator()

bool mlir::Operation::isKnownNonTerminator ( )
inline

Returns if the operation is known to not be a terminator.

◆ isKnownTerminator()

bool mlir::Operation::isKnownTerminator ( )
inline

Returns if the operation is known to be a terminator.

◆ isProperAncestor()

bool Operation::isProperAncestor ( Operation other)

Return true if this operation is a proper ancestor of the other operation.

◆ isRegistered()

bool mlir::Operation::isRegistered ( )
inline

Returns true if this operation has a registered operation description, otherwise false.

◆ moveBefore() [1/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.

◆ moveBefore() [2/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.

◆ 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

◆ print()

void Operation::print ( raw_ostream &  os,
OpPrintingFlags  flags = llvm::None 
)

◆ removeAttr()

NamedAttributeList::RemoveResult mlir::Operation::removeAttr ( Identifier  name)
inline

Remove the attribute with the specified name if it exists. The return value indicates whether the attribute was present or not.

◆ replaceAllUsesWith() [1/2]

template<typename ValuesT , typename = decltype(std::declval<ValuesT>().begin())>
void mlir::Operation::replaceAllUsesWith ( ValuesT &&  values)
inline

Replace all uses of results of this operation with the provided 'values'.

◆ replaceAllUsesWith() [2/2]

void mlir::Operation::replaceAllUsesWith ( Operation op)
inline

Replace all uses of results of this operation with results of 'op'.

◆ replaceUsesOfWith()

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

Replace any uses of 'from' with 'to' within this operation.

◆ 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 ( Identifier  name,
Attribute  value 
)
inline

If the an attribute exists with the specified name, change it to the new value. Otherwise, add a new attribute with the specified name/value.

◆ setAttr() [2/2]

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

◆ setAttrs()

void mlir::Operation::setAttrs ( NamedAttributeList  newAttrs)
inline

Set the attribute list on this operation. Using a NamedAttributeList is more efficient as it does not require new uniquing in the MLIRContext.

◆ setDialectAttrs()

template<typename DialectAttrT >
void mlir::Operation::setDialectAttrs ( DialectAttrT &&  dialectAttrs)
inline

Set the dialect attributes for this operation, and preserve all dependent.

◆ setLoc()

void mlir::Operation::setLoc ( Location  loc)
inline

Set the source location the operation was defined or derived from.

◆ setOperand()

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

◆ setOperands()

void Operation::setOperands ( ValueRange  operands)

Replace the current operands of this operation with the ones provided in 'operands'. If the operands list is not resizable, the size of 'operands' must be less than or equal to the current number of operands.

◆ setSuccessor()

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

◆ successor_begin()

succ_iterator mlir::Operation::successor_begin ( )
inline

◆ successor_end()

succ_iterator mlir::Operation::successor_end ( )
inline

◆ walk()

template<typename FnT , typename RetT = detail::walkResultType<FnT>>
RetT mlir::Operation::walk ( FnT &&  callback)
inline

Walk the operation in postorder, calling the callback for each nested operation(including this one). 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/cancellation.
  • op->walk([](... op) { // Interrupt, i.e cancel, the walk based on some invariant. if (some_invariant) return WalkResult::interrupt(); return WalkResult::advance(); });

Friends And Related Function Documentation

◆ Block

friend class Block
friend

◆ llvm::ilist_node_with_parent< Operation, Block >

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

◆ llvm::ilist_traits< Operation >

friend struct llvm::ilist_traits< Operation >
friend

◆ Value

friend class Value
friend

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