MLIR  22.0.0git
Public Types | Public Member Functions | Static Public Member Functions | List of all members
mlir::detail::TypedValue< Ty > Struct Template Reference

TypedValue is a Value with a statically know type. More...

#include "mlir/IR/Value.h"

+ Inheritance diagram for mlir::detail::TypedValue< Ty >:

Public Types

using ValueType = Ty
 
- Public Types inherited from mlir::Value
using use_iterator = ValueUseIterator< OpOperand >
 This class implements an iterator over the uses of a value. More...
 
using use_range = iterator_range< use_iterator >
 
using user_iterator = ValueUserIterator< use_iterator, OpOperand >
 
using user_range = iterator_range< user_iterator >
 

Public Member Functions

template<typename ToTy , typename = typename std::enable_if<std::is_assignable< typename ToTy::ValueType &, Ty>::value>::type>
 operator ToTy () const
 TypedValue can implicitly convert to TypedValue if B is assignable to A. More...
 
Ty getType () const
 Return the known Type. More...
 
void setType (Ty ty)
 
constexpr Value (detail::ValueImpl *impl=nullptr)
 
- Public Member Functions inherited from mlir::Value
constexpr Value (detail::ValueImpl *impl=nullptr)
 
 operator bool () const
 
bool operator== (const Value &other) const
 
bool operator!= (const Value &other) const
 
Type getType () const
 Return the type of this value. More...
 
MLIRContextgetContext () const
 Utility to get the associated MLIRContext that this value is defined in. More...
 
void setType (Type newType)
 Mutate the type of this Value to be of the specified type. More...
 
OperationgetDefiningOp () const
 If this value is the result of an operation, return the operation that defines it. More...
 
template<typename OpTy >
OpTy getDefiningOp () const
 If this value is the result of an operation of type OpTy, return the operation that defines it. More...
 
Location getLoc () const
 Return the location of this value. More...
 
void setLoc (Location loc)
 
RegiongetParentRegion ()
 Return the Region in which this Value is defined. More...
 
BlockgetParentBlock ()
 Return the Block in which this Value is defined. More...
 
void dropAllUses ()
 Drop all uses of this object from their respective owners. More...
 
void replaceAllUsesWith (Value 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. More...
 
void replaceAllUsesExcept (Value newValue, const SmallPtrSetImpl< Operation * > &exceptions)
 Replace all uses of 'this' value with 'newValue', updating anything in the IR that uses 'this' to use the other value instead except if the user is listed in 'exceptions' . More...
 
void replaceAllUsesExcept (Value newValue, Operation *exceptedUser)
 Replace all uses of 'this' value with 'newValue', updating anything in the IR that uses 'this' to use the other value instead except if the user is 'exceptedUser'. More...
 
void replaceUsesWithIf (Value newValue, function_ref< bool(OpOperand &)> shouldReplace)
 Replace all uses of 'this' value with 'newValue' if the given callback returns true. More...
 
bool isUsedOutsideOfBlock (Block *block) const
 Returns true if the value is used outside of the given block. More...
 
void shuffleUseList (ArrayRef< unsigned > indices)
 Shuffle the use list order according to the provided indices. More...
 
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...
 
unsigned getNumUses () const
 This method computes the number of uses of this Value. More...
 
bool hasOneUse () const
 Returns true if this value has exactly one use. More...
 
bool hasNUses (unsigned n) const
 Return true if this Value has exactly n uses. More...
 
bool hasNUsesOrMore (unsigned n) const
 Return true if this value has n uses or more. 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
 
void print (raw_ostream &os) const
 
void print (raw_ostream &os, const OpPrintingFlags &flags) const
 
void print (raw_ostream &os, AsmState &state) const
 
void dump () const
 
void printAsOperand (raw_ostream &os, AsmState &state) const
 Print this value as if it were an operand. More...
 
void printAsOperand (raw_ostream &os, const OpPrintingFlags &flags) const
 
void * getAsOpaquePointer () const
 Methods for supporting PointerLikeTypeTraits. More...
 
detail::ValueImplgetImpl () const
 

Static Public Member Functions

static bool classof (Value value)
 
- Static Public Member Functions inherited from mlir::Value
static Value getFromOpaquePointer (const void *pointer)
 

Additional Inherited Members

- Protected Attributes inherited from mlir::Value
detail::ValueImplimpl
 A pointer to the internal implementation of the value. More...
 

Detailed Description

template<typename Ty>
struct mlir::detail::TypedValue< Ty >

TypedValue is a Value with a statically know type.

TypedValue can be null/empty

Definition at line 434 of file Value.h.

Member Typedef Documentation

◆ ValueType

template<typename Ty >
using mlir::detail::TypedValue< Ty >::ValueType = Ty

Definition at line 436 of file Value.h.

Member Function Documentation

◆ classof()

template<typename Ty >
static bool mlir::detail::TypedValue< Ty >::classof ( Value  value)
inlinestatic

Definition at line 438 of file Value.h.

References mlir::Value::getType().

◆ getType()

template<typename Ty >
Ty mlir::detail::TypedValue< Ty >::getType ( ) const
inline

Return the known Type.

Definition at line 450 of file Value.h.

References mlir::Value::getType().

◆ operator ToTy()

template<typename Ty >
template<typename ToTy , typename = typename std::enable_if<std::is_assignable< typename ToTy::ValueType &, Ty>::value>::type>
mlir::detail::TypedValue< Ty >::operator ToTy ( ) const
inline

TypedValue can implicitly convert to TypedValue if B is assignable to A.

Definition at line 445 of file Value.h.

◆ setType()

template<typename Ty >
void mlir::detail::TypedValue< Ty >::setType ( Ty  ty)
inline

Definition at line 451 of file Value.h.

References mlir::Value::setType().

◆ Value()

template<typename Ty >
constexpr mlir::Value::Value
inlineconstexpr

Definition at line 98 of file Value.h.


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