My Project
|
#include <Attributes.h>
Classes | |
class | AttributeElementIterator |
class | BoolElementIterator |
A utility iterator that allows walking over the internal bool values. More... | |
class | ElementIterator |
class | FloatElementIterator |
Iterator for walking over APFloat values. More... | |
class | IntElementIterator |
A utility iterator that allows walking over the internal raw APInt values. More... | |
Public Types | |
template<typename T > | |
using | DerivedAttributeElementIterator = llvm::mapped_iterator< AttributeElementIterator, T(*)(Attribute)> |
![]() | |
using | Base = StorageUserBase< ConcreteT, BaseT, StorageT, UniquerT > |
Utility declarations for the concrete attribute class. More... | |
using | ImplType = StorageT |
Public Member Functions | |
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 > | |
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< AttributeElementIterator > | getAttributeValues () 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< AttributeElementIterator > | getValues () 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< BoolElementIterator > | getBoolValues () const |
template<typename T , typename = typename std::enable_if< std::is_same<T, bool>::value>::type> | |
llvm::iterator_range< BoolElementIterator > | getValues () const |
llvm::iterator_range< IntElementIterator > | getIntValues () const |
template<typename T , typename = typename std::enable_if< std::is_same<T, APInt>::value>::type> | |
llvm::iterator_range< IntElementIterator > | getValues () const |
IntElementIterator | int_value_begin () const |
IntElementIterator | int_value_end () const |
llvm::iterator_range< FloatElementIterator > | getFloatValues () const |
template<typename T , typename = typename std::enable_if< std::is_same<T, APFloat>::value>::type> | |
llvm::iterator_range< FloatElementIterator > | getValues () 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 | |
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 ClassID * | getClassID () |
Return a unique identifier for the concrete type. More... | |
template<typename T > | |
static bool | classof (T val) |
Protected Member Functions | |
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 |
![]() | |
ImplType * | getImpl () const |
Utility for easy access to the storage instance. More... | |
Static Protected Member Functions | |
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) |
![]() | |
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... | |
An attribute that represents a reference to a dense vector or tensor object.
using mlir::DenseElementsAttr::DerivedAttributeElementIterator = llvm::mapped_iterator<AttributeElementIterator, T (*)(Attribute)> |
Return the held element values a range of T, where T is a derived attribute type.
auto DenseElementsAttr::attr_value_begin | ( | ) | const |
auto DenseElementsAttr::attr_value_end | ( | ) | const |
|
inlinestatic |
Method for support type inquiry through isa, cast and dyn_cast.
auto DenseElementsAttr::float_value_begin | ( | ) | const |
auto DenseElementsAttr::float_value_end | ( | ) | const |
|
static |
Constructs a dense elements attribute from an array of element values. Each element attribute value is expected to be an element of 'type'. 'type' must be a vector or tensor with static shape.
|
inlinestatic |
Constructs a dense integer elements attribute from an array of integer or floating-point values. Each value is expected to be the same bitwidth of the element type of 'type'. 'type' must be a vector or tensor with static shape.
|
inlinestatic |
Constructs a dense integer elements attribute from a single element.
|
static |
Overload of the above 'get' method that is specialized for boolean values.
|
static |
Constructs a dense integer elements attribute from an array of APInt values. Each APInt value is expected to have the same bitwidth as the element type of 'type'. 'type' must be a vector or tensor with static shape.
Constructs a dense integer elements attribute from an array of APInt values. Each APInt value is expected to have the same bitwidth as the element type of 'type'.
|
static |
Constructs a dense float elements attribute from an array of APFloat values. Each APFloat value is expected to have the same bitwidth as the element type of 'type'. 'type' must be a vector or tensor with static shape.
|
inlinestatic |
Construct a dense elements attribute for an initializer_list of values. Each value is expected to be the same bitwidth of the element type of 'type'. 'type' must be a vector or tensor with static shape.
auto DenseElementsAttr::getAttributeValues | ( | ) | const |
Return the held element values as a range of Attributes.
auto DenseElementsAttr::getBoolValues | ( | ) | const |
Return the held element values as a range of bool. The element type of this attribute must be of integer type of bitwidth 1.
auto DenseElementsAttr::getFloatValues | ( | ) | const |
Return the held element values as a range of APFloat. The element type of this attribute must be of float type.
auto DenseElementsAttr::getIntValues | ( | ) | const |
Return the held element values as a range of APInts. The element type of this attribute must be of integer type.
|
staticprotected |
Constructs a dense elements attribute from an array of raw APInt values. Each APInt value is expected to have the same bitwidth as the element type of 'type'. 'type' must be a vector or tensor with static shape.
|
staticprotected |
Get or create a new dense elements attribute instance with the given raw data buffer. 'type' must be a vector or tensor with static shape.
|
protected |
Return the raw storage data held by this attribute.
|
staticprotected |
Overload of the raw 'get' method that asserts that the given type is of integer or floating-point type. This method is used to verify type invariants that the templatized 'get' method cannot.
Overload of the 'getRaw' method that asserts that the given type is of integer type. This method is used to verify type invariants that the templatized 'get' method cannot.
|
inline |
Return the splat value for this attribute. This asserts that the attribute corresponds to a splat.
|
inline |
|
inline |
Return the splat value for derived attribute element types.
Return the value at the given index. The 'index' is expected to refer to a valid element.
|
inline |
|
inline |
Return the held element values as a range of integer or floating-point values.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
auto DenseElementsAttr::int_value_begin | ( | ) | const |
auto DenseElementsAttr::int_value_end | ( | ) | const |
bool DenseElementsAttr::isSplat | ( | ) | const |
Returns if this attribute corresponds to a splat, i.e. if all element values are the same.
|
protected |
Check the information for a c++ data type, check if this type is valid for the current attribute. This method is used to verify specific type invariants that the templatized 'getValues' method cannot.
A method used to verify specific type invariants that the templatized 'get' method cannot.
DenseElementsAttr DenseElementsAttr::mapValues | ( | Type | newElementType, |
function_ref< APInt(const APInt &)> | mapping | ||
) | const |
Generates a new DenseElementsAttr by mapping each int value to a new underlying APInt. The new values can represent either a integer or float. This underlying type must be an DenseIntElementsAttr.
DenseElementsAttr DenseElementsAttr::mapValues | ( | Type | newElementType, |
function_ref< APInt(const APFloat &)> | mapping | ||
) | const |
Generates a new DenseElementsAttr by mapping each float value to a new underlying APInt. the new values can represent either a integer or float. This underlying type must be an DenseFPElementsAttr.
|
inlineprotected |
Get iterators to the raw APInt values for each element in this attribute.
|
inlineprotected |
DenseElementsAttr DenseElementsAttr::reshape | ( | ShapedType | newType | ) |
Return a new DenseElementsAttr that has the same data as the current attribute, but has been reshaped to 'newType'. The new type must have the same total number of elements as well as element type.