MLIR 22.0.0git
mlir::IRObjectWithUseList< OperandType > Class Template Reference

This class represents a single IR object that contains a use list. More...

#include "mlir/IR/UseDefLists.h"

Inheritance diagram for mlir::IRObjectWithUseList< OperandType >:

Public Types

using use_iterator = ValueUseIterator<OperandType>
using use_range = iterator_range<use_iterator>
using user_iterator = ValueUserIterator<use_iterator, OperandType>
using user_range = iterator_range<user_iterator>

Public Member Functions

 ~IRObjectWithUseList ()
void dropAllUses ()
 Drop all uses of this object from their respective owners.
template<typename ValueT>
void replaceAllUsesWith (ValueT &&newValue)
 Replace all uses of 'this' value with the new value, updating anything in the IR that uses 'this' to use the other value instead.
void shuffleUseList (ArrayRef< unsigned > indices)
 Shuffle the use-list chain according to the provided indices vector, which need to represent a valid shuffle.
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.
bool hasOneUse () const
 Returns true if this value has exactly one use.
bool use_empty () const
 Returns true if this value has no uses.
user_iterator user_begin () const
user_iterator user_end () const
user_range getUsers () const
 Returns a range of all users.

Protected Member Functions

 IRObjectWithUseList ()=default
OperandType * getFirstUse () const
 Return the first operand that is using this value, for use by custom use/def iterators.

Detailed Description

template<typename OperandType>
class mlir::IRObjectWithUseList< OperandType >

This class represents a single IR object that contains a use list.

Definition at line 195 of file UseDefLists.h.

Member Typedef Documentation

◆ use_iterator

template<typename OperandType>
using mlir::IRObjectWithUseList< OperandType >::use_iterator = ValueUseIterator<OperandType>

Definition at line 246 of file UseDefLists.h.

◆ use_range

template<typename OperandType>
using mlir::IRObjectWithUseList< OperandType >::use_range = iterator_range<use_iterator>

Definition at line 247 of file UseDefLists.h.

◆ user_iterator

template<typename OperandType>
using mlir::IRObjectWithUseList< OperandType >::user_iterator = ValueUserIterator<use_iterator, OperandType>

Definition at line 267 of file UseDefLists.h.

◆ user_range

template<typename OperandType>
using mlir::IRObjectWithUseList< OperandType >::user_range = iterator_range<user_iterator>

Definition at line 268 of file UseDefLists.h.

Constructor & Destructor Documentation

◆ ~IRObjectWithUseList()

template<typename OperandType>
mlir::IRObjectWithUseList< OperandType >::~IRObjectWithUseList ( )
inline

Definition at line 197 of file UseDefLists.h.

References use_empty().

◆ IRObjectWithUseList()

template<typename OperandType>
mlir::IRObjectWithUseList< OperandType >::IRObjectWithUseList ( )
protecteddefault

Member Function Documentation

◆ dropAllUses()

template<typename OperandType>
void mlir::IRObjectWithUseList< OperandType >::dropAllUses ( )
inline

Drop all uses of this object from their respective owners.

Definition at line 202 of file UseDefLists.h.

References use_begin(), and use_empty().

◆ getFirstUse()

template<typename OperandType>
OperandType * mlir::IRObjectWithUseList< OperandType >::getFirstUse ( ) const
inlineprotected

Return the first operand that is using this value, for use by custom use/def iterators.

Definition at line 281 of file UseDefLists.h.

◆ getUsers()

template<typename OperandType>
user_range mlir::IRObjectWithUseList< OperandType >::getUsers ( ) const
inline

◆ getUses()

template<typename OperandType>
use_range mlir::IRObjectWithUseList< OperandType >::getUses ( ) const
inline

Returns a range of all uses, which is useful for iterating over all uses.

Definition at line 253 of file UseDefLists.h.

References use_begin(), and use_end().

Referenced by mlir::RewriterBase::replaceAllUsesWith(), and shuffleUseList().

◆ hasOneUse()

template<typename OperandType>
bool mlir::IRObjectWithUseList< OperandType >::hasOneUse ( ) const
inline

Returns true if this value has exactly one use.

Definition at line 256 of file UseDefLists.h.

◆ replaceAllUsesWith()

template<typename OperandType>
template<typename ValueT>
void mlir::IRObjectWithUseList< OperandType >::replaceAllUsesWith ( ValueT && newValue)
inline

Replace all uses of 'this' value with the new value, updating anything in the IR that uses 'this' to use the other value instead.

When this returns there are zero uses of 'this'.

Definition at line 211 of file UseDefLists.h.

References use_begin(), and use_empty().

Referenced by mlir::detail::ConversionPatternRewriterImpl::applySignatureConversion(), inlineIfCase(), transformCyclesToSCFLoops(), and transformToStructuredCFBranches().

◆ shuffleUseList()

template<typename OperandType>
void mlir::IRObjectWithUseList< OperandType >::shuffleUseList ( ArrayRef< unsigned > indices)
inline

Shuffle the use-list chain according to the provided indices vector, which need to represent a valid shuffle.

That is, a vector of unique integers in range [0, numUses - 1]. Users of this function need to guarantee the validity of the indices vector.

Definition at line 222 of file UseDefLists.h.

References getUses(), and indices.

Referenced by mlir::Value::shuffleUseList().

◆ use_begin()

template<typename OperandType>
use_iterator mlir::IRObjectWithUseList< OperandType >::use_begin ( ) const
inline

Definition at line 249 of file UseDefLists.h.

Referenced by dropAllUses(), getUses(), replaceAllUsesWith(), and user_begin().

◆ use_empty()

template<typename OperandType>
bool mlir::IRObjectWithUseList< OperandType >::use_empty ( ) const
inline

Returns true if this value has no uses.

Definition at line 261 of file UseDefLists.h.

Referenced by dropAllUses(), replaceAllUsesWith(), and ~IRObjectWithUseList().

◆ use_end()

template<typename OperandType>
use_iterator mlir::IRObjectWithUseList< OperandType >::use_end ( ) const
inline

Definition at line 250 of file UseDefLists.h.

Referenced by getUses(), and user_end().

◆ user_begin()

template<typename OperandType>
user_iterator mlir::IRObjectWithUseList< OperandType >::user_begin ( ) const
inline

Definition at line 270 of file UseDefLists.h.

References use_begin().

Referenced by getUsers().

◆ user_end()

template<typename OperandType>
user_iterator mlir::IRObjectWithUseList< OperandType >::user_end ( ) const
inline

Definition at line 271 of file UseDefLists.h.

References use_end().

Referenced by getUsers().


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