My Project
Public Types | Public Member Functions | Static Public Member Functions | List of all members
mlir::DenseIntElementsAttr Class Reference

#include <Attributes.h>

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

Public Types

using iterator = DenseElementsAttr::IntElementIterator
 
- Public Types inherited from mlir::DenseElementsAttr
template<typename T >
using DerivedAttributeElementIterator = llvm::mapped_iterator< AttributeElementIterator, T(*)(Attribute)>
 
- Public Types inherited from mlir::detail::StorageUserBase< ConcreteT, BaseT, StorageT, UniquerT >
using Base = StorageUserBase< ConcreteT, BaseT, StorageT, UniquerT >
 Utility declarations for the concrete attribute class. More...
 
using ImplType = StorageT
 

Public Member Functions

DenseElementsAttr mapValues (Type newElementType, function_ref< APInt(const APInt &)> mapping) const
 
iterator begin () const
 Iterator access to the integer element values. More...
 
iterator end () const
 
- Public Member Functions inherited from mlir::DenseElementsAttr
bool isSplat () const
 
Attribute getSplatValue () const
 
template<typename T >
std::enable_if<!std::is_base_of< Attribute, T >::value||std::is_same< Attribute, T >::value, T >::type getSplatValue () const
 
template<typename T >
std::enable_if< std::is_base_of< Attribute, T >::value &&!std::is_same< Attribute, T >::value, T >::type getSplatValue () const
 Return the splat value for derived attribute element types. More...
 
Attribute getValue (ArrayRef< uint64_t > index) const
 
template<typename T >
getValue (ArrayRef< uint64_t > index) const
 
template<typename T , typename = typename std::enable_if< (!std::is_same<T, bool>::value && std::numeric_limits<T>::is_integer) || llvm::is_one_of<T, float, double>::value>::type>
llvm::iterator_range< ElementIterator< T > > getValues () const
 
llvm::iterator_range< AttributeElementIteratorgetAttributeValues () const
 Return the held element values as a range of Attributes. More...
 
template<typename T , typename = typename std::enable_if< std::is_same<T, Attribute>::value>::type>
llvm::iterator_range< AttributeElementIteratorgetValues () const
 
AttributeElementIterator attr_value_begin () const
 
AttributeElementIterator attr_value_end () const
 
template<typename T , typename = typename std::enable_if< std::is_base_of<Attribute, T>::value && !std::is_same<Attribute, T>::value>::type>
llvm::iterator_range< DerivedAttributeElementIterator< T > > getValues () const
 
llvm::iterator_range< BoolElementIteratorgetBoolValues () const
 
template<typename T , typename = typename std::enable_if< std::is_same<T, bool>::value>::type>
llvm::iterator_range< BoolElementIteratorgetValues () const
 
llvm::iterator_range< IntElementIteratorgetIntValues () const
 
template<typename T , typename = typename std::enable_if< std::is_same<T, APInt>::value>::type>
llvm::iterator_range< IntElementIteratorgetValues () const
 
IntElementIterator int_value_begin () const
 
IntElementIterator int_value_end () const
 
llvm::iterator_range< FloatElementIteratorgetFloatValues () const
 
template<typename T , typename = typename std::enable_if< std::is_same<T, APFloat>::value>::type>
llvm::iterator_range< FloatElementIteratorgetValues () const
 
FloatElementIterator float_value_begin () const
 
FloatElementIterator float_value_end () const
 
DenseElementsAttr reshape (ShapedType newType)
 
DenseElementsAttr mapValues (Type newElementType, function_ref< APInt(const APInt &)> mapping) const
 
DenseElementsAttr mapValues (Type newElementType, function_ref< APInt(const APFloat &)> mapping) const
 

Static Public Member Functions

template<typename Arg >
static DenseIntElementsAttr get (const ShapedType &type, Arg &&arg)
 
template<typename T >
static DenseIntElementsAttr get (const ShapedType &type, const std::initializer_list< T > &list)
 
static bool classof (Attribute attr)
 Method for supporting type inquiry through isa, cast and dyn_cast. More...
 
- Static Public Member Functions inherited from mlir::DenseElementsAttr
static bool classof (Attribute attr)
 Method for support type inquiry through isa, cast and dyn_cast. More...
 
static DenseElementsAttr get (ShapedType type, ArrayRef< Attribute > values)
 
template<typename T , typename = typename std::enable_if< std::numeric_limits<T>::is_integer || llvm::is_one_of<T, float, double>::value>::type>
static DenseElementsAttr get (const ShapedType &type, ArrayRef< T > values)
 
template<typename T , typename = typename std::enable_if< std::numeric_limits<T>::is_integer || llvm::is_one_of<T, float, double>::value>::type>
static DenseElementsAttr get (const ShapedType &type, T value)
 Constructs a dense integer elements attribute from a single element. More...
 
static DenseElementsAttr get (ShapedType type, ArrayRef< bool > values)
 Overload of the above 'get' method that is specialized for boolean values. More...
 
static DenseElementsAttr get (ShapedType type, ArrayRef< APInt > values)
 
static DenseElementsAttr get (ShapedType type, ArrayRef< APFloat > values)
 
template<typename T >
static DenseElementsAttr get (const ShapedType &type, const std::initializer_list< T > &list)
 
- Static Public Member Functions inherited from mlir::detail::StorageUserBase< ConcreteT, BaseT, StorageT, UniquerT >
static ClassIDgetClassID ()
 Return a unique identifier for the concrete type. More...
 
template<typename T >
static bool classof (T val)
 

Additional Inherited Members

- Protected Member Functions inherited from mlir::DenseElementsAttr
ArrayRef< char > getRawData () const
 Return the raw storage data held by this attribute. More...
 
IntElementIterator raw_int_begin () const
 Get iterators to the raw APInt values for each element in this attribute. More...
 
IntElementIterator raw_int_end () const
 
bool isValidIntOrFloat (int64_t dataEltSize, bool isInt) const
 
- Protected Member Functions inherited from mlir::detail::StorageUserBase< ConcreteT, BaseT, StorageT, UniquerT >
ImplTypegetImpl () const
 Utility for easy access to the storage instance. More...
 
- Static Protected Member Functions inherited from mlir::DenseElementsAttr
static DenseElementsAttr getRaw (ShapedType type, ArrayRef< APInt > values)
 
static DenseElementsAttr getRaw (ShapedType type, ArrayRef< char > data, bool isSplat)
 
static DenseElementsAttr getRawIntOrFloat (ShapedType type, ArrayRef< char > data, int64_t dataEltSize, bool isInt)
 
- Static Protected Member Functions inherited from mlir::detail::StorageUserBase< ConcreteT, BaseT, StorageT, UniquerT >
template<typename... Args>
static ConcreteT get (MLIRContext *ctx, unsigned kind, Args... args)
 
template<typename... Args>
static ConcreteT getChecked (const Location &loc, MLIRContext *ctx, unsigned kind, Args... args)
 
template<typename... Args>
static LogicalResult verifyConstructionInvariants (Args... args)
 Default implementation that just returns success. More...
 

Detailed Description

An attribute that represents a reference to a dense integer vector or tensor object.

Member Typedef Documentation

◆ iterator

DenseIntElementsAttr iterates on APInt, so we can use the raw element iterator directly.

Member Function Documentation

◆ begin()

iterator mlir::DenseIntElementsAttr::begin ( ) const
inline

Iterator access to the integer element values.

◆ classof()

bool DenseIntElementsAttr::classof ( Attribute  attr)
static

Method for supporting type inquiry through isa, cast and dyn_cast.

◆ end()

iterator mlir::DenseIntElementsAttr::end ( ) const
inline

◆ get() [1/2]

template<typename Arg >
static DenseIntElementsAttr mlir::DenseIntElementsAttr::get ( const ShapedType type,
Arg &&  arg 
)
inlinestatic

Get an instance of a DenseIntElementsAttr with the given arguments. This simply wraps the DenseElementsAttr::get calls.

◆ get() [2/2]

template<typename T >
static DenseIntElementsAttr mlir::DenseIntElementsAttr::get ( const ShapedType type,
const std::initializer_list< T > &  list 
)
inlinestatic

◆ mapValues()

DenseElementsAttr DenseIntElementsAttr::mapValues ( Type  newElementType,
function_ref< APInt(const APInt &)>  mapping 
) const

Generates a new DenseElementsAttr by mapping each value attribute, and constructing the DenseElementsAttr given the new element type.


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