9#ifndef MLIR_IR_BUILTINATTRIBUTES_H
10#define MLIR_IR_BUILTINATTRIBUTES_H
14#include "llvm/ADT/APFloat.h"
15#include "llvm/ADT/Sequence.h"
32class RankedTensorType;
50template <
typename ConcreteT,
typename T,
typename PointerT = T *,
51 typename ReferenceT = T &>
53 :
public llvm::indexed_accessor_iterator<ConcreteT, DenseIterPtrAndSplat, T,
54 PointerT, ReferenceT> {
59 PointerT, ReferenceT>({data, isSplat},
65 bool isSplat = this->base.second;
66 return isSplat ? 0 : this->
index;
70 const char *
getData()
const {
return this->base.first; }
89 operator ElementsAttr()
const {
return cast_if_present<ElementsAttr>(*
this); }
91 operator TypedAttr()
const {
return ElementsAttr(*
this); }
102 static constexpr bool value = llvm::is_one_of<T, float, double>::value ||
103 (std::numeric_limits<T>::is_specialized &&
104 !std::numeric_limits<T>::is_integer);
120 template <
typename T,
121 typename = std::enable_if_t<std::numeric_limits<T>::is_integer ||
124 const char *data =
reinterpret_cast<const char *
>(values.data());
127 std::numeric_limits<T>::is_integer, std::numeric_limits<T>::is_signed);
131 template <
typename T,
132 typename = std::enable_if_t<std::numeric_limits<T>::is_integer ||
143 typename T,
typename ElementT =
typename T::value_type,
144 typename = std::enable_if_t<detail::is_complex_t<T>::value &&
145 (std::numeric_limits<ElementT>::is_integer ||
148 const char *data =
reinterpret_cast<const char *
>(values.data());
150 sizeof(T), std::numeric_limits<ElementT>::is_integer,
151 std::numeric_limits<ElementT>::is_signed);
190 template <
typename T>
192 const std::initializer_list<T> &list) {
216 template <
typename IteratorT>
220 template <
typename T,
typename AttrT = DenseElementsAttr>
223 template <
typename T,
typename AttrT = DenseElementsAttr>
225 decltype(std::declval<AttrT>().template
getValues<T>());
229 class AttributeElementIterator
230 :
public llvm::indexed_accessor_iterator<AttributeElementIterator,
238 friend DenseElementsAttr;
241 AttributeElementIterator(DenseElementsAttr attr,
size_t index);
247 template <
typename T>
248 class ElementIterator
267 class BoolElementIterator
275 friend DenseElementsAttr;
278 BoolElementIterator(DenseElementsAttr attr,
size_t dataIndex);
282 class IntElementIterator
284 APInt, APInt, APInt> {
290 friend DenseElementsAttr;
293 IntElementIterator(DenseElementsAttr attr,
size_t dataIndex);
301 class ComplexIntElementIterator
303 ComplexIntElementIterator, mlir::Complex<APInt>,
304 mlir::Complex<APInt>, mlir::Complex<APInt>> {
310 friend DenseElementsAttr;
313 ComplexIntElementIterator(DenseElementsAttr attr,
size_t dataIndex);
320 class FloatElementIterator final
321 :
public llvm::mapped_iterator_base<FloatElementIterator,
322 IntElementIterator, APFloat> {
326 return APFloat(*smt, value);
337 const llvm::fltSemantics *
smt;
341 class ComplexFloatElementIterator final
342 :
public llvm::mapped_iterator_base<ComplexFloatElementIterator,
343 ComplexIntElementIterator,
344 mlir::Complex<APFloat>> {
348 return {APFloat(*smt, value.real()), APFloat(*smt, value.imag())};
360 const llvm::fltSemantics *
smt;
373 template <
typename T>
374 std::enable_if_t<!std::is_base_of<Attribute, T>::value ||
375 std::is_same<Attribute, T>::value,
378 assert(
isSplat() &&
"expected the attribute to be a splat");
382 template <
typename T>
383 std::enable_if_t<std::is_base_of<Attribute, T>::value &&
384 !std::is_same<Attribute, T>::value,
392 template <
typename T>
395 using iterator =
decltype(range->begin());
396 return failed(range) ? FailureOr<iterator>(failure()) : range->begin();
401 template <
typename T>
404 using iterator =
decltype(range->begin());
405 return failed(range) ? FailureOr<iterator>(failure()) : range->end();
409 template <
typename T>
412 assert(succeeded(range) &&
"element type cannot be iterated");
413 return std::move(*range);
417 template <
typename T>
423 template <
typename T>
430 template <
typename T>
432 std::enable_if_t<(!std::is_same<T, bool>::value &&
433 std::numeric_limits<T>::is_integer) ||
435 template <
typename T,
typename = IntFloatValueTemplateCheckT<T>>
436 FailureOr<iterator_range_impl<ElementIterator<T>>>
tryGetValues()
const {
438 std::numeric_limits<T>::is_signed))
448 template <
typename T,
typename ElementT>
450 std::enable_if_t<detail::is_complex_t<T>::value &&
451 (std::numeric_limits<ElementT>::is_integer ||
453 template <
typename T,
typename ElementT =
typename T::value_type,
455 FailureOr<iterator_range_impl<ElementIterator<T>>>
tryGetValues()
const {
456 if (!
isValidComplex(
sizeof(T), std::numeric_limits<ElementT>::is_integer,
457 std::numeric_limits<ElementT>::is_signed))
467 template <
typename T>
469 std::enable_if_t<std::is_same<T, StringRef>::value>;
470 template <
typename T,
typename = StringRefValueTemplateCheckT<T>>
471 FailureOr<iterator_range_impl<ElementIterator<StringRef>>>
474 const char *
ptr =
reinterpret_cast<const char *
>(stringRefs.data());
482 template <
typename T>
484 std::enable_if_t<std::is_same<T, Attribute>::value>;
485 template <
typename T,
typename = AttributeValueTemplateCheckT<T>>
486 FailureOr<iterator_range_impl<AttributeElementIterator>>
495 template <
typename T>
497 std::enable_if_t<std::is_base_of<Attribute, T>::value &&
498 !std::is_same<Attribute, T>::value>;
499 template <
typename T>
501 :
public llvm::mapped_iterator_base<DerivedAttributeElementIterator<T>,
502 AttributeElementIterator, T> {
505 T>::mapped_iterator_base;
510 template <
typename T,
typename = DerivedAttrValueTemplateCheckT<T>>
511 FailureOr<iterator_range_impl<DerivedAttributeElementIterator<T>>>
521 template <
typename T>
523 std::enable_if_t<std::is_same<T, bool>::value>;
524 template <
typename T,
typename = BoolValueTemplateCheckT<T>>
525 FailureOr<iterator_range_impl<BoolElementIterator>>
tryGetValues()
const {
535 template <
typename T>
537 std::enable_if_t<std::is_same<T, APInt>::value>;
538 template <
typename T,
typename = APIntValueTemplateCheckT<T>>
539 FailureOr<iterator_range_impl<IntElementIterator>>
tryGetValues()
const {
548 template <
typename T>
550 std::enable_if_t<std::is_same<T, mlir::Complex<APInt>>::value>;
551 template <
typename T,
typename = ComplexAPIntValueTemplateCheckT<T>>
552 FailureOr<iterator_range_impl<ComplexIntElementIterator>>
559 template <
typename T>
561 std::enable_if_t<std::is_same<T, APFloat>::value>;
562 template <
typename T,
typename = APFloatValueTemplateCheckT<T>>
563 FailureOr<iterator_range_impl<FloatElementIterator>>
tryGetValues()
const {
569 template <
typename T>
571 std::enable_if_t<std::is_same<T, mlir::Complex<APFloat>>::value>;
572 template <
typename T,
typename = ComplexAPFloatValueTemplateCheckT<T>>
573 FailureOr<iterator_range_impl<ComplexFloatElementIterator>>
644 FailureOr<iterator_range_impl<ComplexIntElementIterator>>
646 FailureOr<iterator_range_impl<FloatElementIterator>>
648 FailureOr<iterator_range_impl<ComplexFloatElementIterator>>
655 int64_t dataEltSize,
bool isInt,
663 int64_t dataEltSize,
bool isInt,
678 using DenseElementsAttr::DenseElementsAttr;
682 auto denseAttr = llvm::dyn_cast<DenseElementsAttr>(attr);
683 return denseAttr && denseAttr.isSplat();
699#define GET_ATTRDEF_CLASSES
700#include "mlir/IR/BuiltinAttributes.h.inc"
709using DenseIntOrFPElementsAttr [[deprecated(
710 "DenseIntOrFPElementsAttr has been renamed to DenseTypedElementsAttr")]] =
723 using DenseArrayAttr::DenseArrayAttr;
779 using DenseResourceElementsAttr::DenseResourceElementsAttr;
850 operator IntegerAttr()
const {
return IntegerAttr(
impl); }
851 operator TypedAttr()
const {
return IntegerAttr(
impl); }
854 bool getValue()
const;
868 using SymbolRefAttr::SymbolRefAttr;
873 return SymbolRefAttr::get(value);
876 return SymbolRefAttr::get(ctx, value);
882 return SymbolRefAttr::get(symbol);
886 StringAttr
getAttr()
const {
return getRootReference(); }
893 SymbolRefAttr refAttr = llvm::dyn_cast<SymbolRefAttr>(attr);
894 return refAttr && refAttr.getNestedReferences().empty();
898 using SymbolRefAttr::get;
899 using SymbolRefAttr::getNestedReferences;
912 using DenseTypedElementsAttr::DenseTypedElementsAttr;
916 template <
typename Arg>
918 return llvm::cast<DenseFPElementsAttr>(
921 template <
typename T>
923 const std::initializer_list<T> &list) {
930 mapValues(
Type newElementType,
953 using DenseTypedElementsAttr::DenseTypedElementsAttr;
957 template <
typename Arg>
959 return llvm::cast<DenseIntElementsAttr>(
962 template <
typename T>
964 const std::initializer_list<T> &list) {
986auto SparseElementsAttr::try_value_begin_impl(OverloadToken<T>)
const
987 -> FailureOr<iterator<T>> {
988 auto zeroValue = getZeroValue<T>();
989 auto valueIt = getValues().try_value_begin<T>();
992 const SmallVector<ptrdiff_t> flatSparseIndices(getFlattenedSparseIndices());
993 std::function<T(ptrdiff_t)> mapFn =
994 [flatSparseIndices{flatSparseIndices}, valueIt{std::move(*valueIt)},
995 zeroValue{std::move(zeroValue)}](ptrdiff_t
index) {
997 for (
unsigned i = 0, e = flatSparseIndices.size(); i != e; ++i)
998 if (flatSparseIndices[i] ==
index)
999 return *std::next(valueIt, i);
1003 return iterator<T>(llvm::seq<ptrdiff_t>(0,
getNumElements()).begin(), mapFn);
1033 detail::DistinctAttrStorage,
1034 detail::DistinctAttributeUniquer> {
1045 static constexpr StringLiteral
name =
"builtin.distinct";
1056 return static_cast<bool>(
lhs);
1065 return lhs.getValue() ==
rhs;
1069 return rhs.getValue() ==
lhs;
1109 return mlir::StringAttr::getFromOpaquePointer(pointer);
1113 return mlir::StringAttr::getFromOpaquePointer(pointer);
1117struct PointerLikeTypeTraits<
mlir::StringAttr>
1118 :
public PointerLikeTypeTraits<mlir::Attribute> {
1120 return mlir::StringAttr::getFromOpaquePointer(p);
1125struct PointerLikeTypeTraits<
mlir::IntegerAttr>
1126 :
public PointerLikeTypeTraits<mlir::Attribute> {
1128 return mlir::IntegerAttr::getFromOpaquePointer(p);
1133struct PointerLikeTypeTraits<
mlir::SymbolRefAttr>
1134 :
public PointerLikeTypeTraits<mlir::Attribute> {
1136 return mlir::SymbolRefAttr::getFromOpaquePointer(ptr);
static int64_t getNumElements(Type t)
Compute the total number of elements in the given type, also taking into account nested types.
A multi-dimensional affine map Affine map's are immutable like Type's, and they are uniqued.
This base class exposes generic asm parser hooks, usable across the various derived parsers.
This base class exposes generic asm printer hooks, usable across the various derived printers.
This class represents a processed binary blob of data.
Attributes are known-constant values of operations.
constexpr Attribute()=default
Special case of IntegerAttr to represent boolean integers, i.e., signless i1 integers.
constexpr Attribute()=default
A utility iterator that allows walking over the internal Attribute values of a DenseElementsAttr.
A utility iterator that allows walking over the internal bool values.
bool operator*() const
Accesses the bool value at this iterator position.
Iterator for walking over complex APFloat values.
mlir::Complex< APFloat > mapElement(const mlir::Complex< APInt > &value) const
Map the element to the iterator result type.
A utility iterator that allows walking over the internal raw complex APInt values.
mlir::Complex< APInt > operator*() const
Accesses the raw mlir::Complex<APInt> value at this iterator position.
Iterator for walking raw element values of the specified type 'T', which may be any c++ data type mat...
const T & operator*() const
Accesses the raw value at this iterator position.
Iterator for walking over APFloat values.
APFloat mapElement(const APInt &value) const
Map the element to the iterator result type.
A utility iterator that allows walking over the internal raw APInt values.
APInt operator*() const
Accesses the raw APInt value at this iterator position.
An attribute that represents a reference to a dense vector or tensor object.
ArrayRef< StringRef > getRawStringData() const
Return the raw StringRef data held by this attribute.
std::enable_if_t< std::is_same< T, mlir::Complex< APInt > >::value > ComplexAPIntValueTemplateCheckT
Try to get the held element values as a range of complex APInts.
IntElementIterator raw_int_begin() const
Iterators to various elements that require out-of-line definition.
static DenseElementsAttr getRawIntOrFloat(ShapedType type, ArrayRef< char > data, int64_t dataEltSize, bool isInt, bool isSigned)
Overload of the raw 'get' method that asserts that the given type is of integer or floating-point typ...
FailureOr< iterator_range_impl< AttributeElementIterator > > tryGetValues() const
auto value_begin() const
Get an iterator of the given type to the start of the held element values.
static DenseElementsAttr getRawComplex(ShapedType type, ArrayRef< char > data, int64_t dataEltSize, bool isInt, bool isSigned)
Overload of the raw 'get' method that asserts that the given type is of complex type.
std::enable_if_t< std::is_same< T, mlir::Complex< APFloat > >::value > ComplexAPFloatValueTemplateCheckT
Try to get the held element values as a range of complex APFloat.
auto try_value_begin() const
Try to get an iterator of the given type to the start of the held element values.
static bool classof(Attribute attr)
Method for support type inquiry through isa, cast and dyn_cast.
bool isValidComplex(int64_t dataEltSize, bool isInt, bool isSigned) const
FailureOr< iterator_range_impl< ElementIterator< T > > > tryGetValues() const
auto getValues() const
Return the held element values as a range of the given type.
DenseElementsAttr resizeSplat(ShapedType newType)
Return a new DenseElementsAttr that has the same data as the current attribute, but with a different ...
decltype(std::declval< AttrT >().template getValues< T >()) iterator_range
The iterator range over the given element T.
detail::ElementsAttrRange< IteratorT > iterator_range_impl
The iterator range over the given iterator type T.
int64_t getNumElements() const
Returns the number of elements held by this attribute.
std::enable_if_t<!std::is_base_of< Attribute, T >::value||std::is_same< Attribute, T >::value, T > getSplatValue() const
Return the splat value for this attribute.
static DenseElementsAttr getFromRawBuffer(ShapedType type, ArrayRef< char > rawBuffer)
Construct a dense elements attribute from a raw buffer representing the data for this attribute.
static bool isValidRawBuffer(ShapedType type, ArrayRef< char > rawBuffer)
Returns true if the given buffer is a valid raw buffer for the given type.
int64_t size() const
Returns the number of elements held by this attribute.
std::enable_if_t< std::is_same< T, Attribute >::value > AttributeValueTemplateCheckT
Try to get the held element values as a range of Attributes.
bool isValidBool() const
Check the information for a C++ data type, check if this type is valid for the current attribute.
bool isSplat() const
Returns true if this attribute corresponds to a splat, i.e.
auto try_value_end() const
Try to get an iterator of the given type to the end of the held element values.
ArrayRef< char > getRawData() const
Return the raw storage data held by this attribute.
constexpr Attribute()=default
FailureOr< iterator_range_impl< ElementIterator< T > > > tryGetValues() const
static DenseElementsAttr get(const ShapedType &type, ArrayRef< T > values)
Constructs a dense integer elements attribute from an array of integer or floating-point values.
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.
static DenseElementsAttr get(const ShapedType &type, const std::initializer_list< T > &list)
Construct a dense elements attribute for an initializer_list of values.
decltype(std::declval< AttrT >().template value_begin< T >()) iterator
The iterator for the given element type T.
std::enable_if_t< std::is_base_of< Attribute, T >::value && !std::is_same< Attribute, T >::value > DerivedAttrValueTemplateCheckT
Try to get the held element values a range of T, where T is a derived attribute type.
Type getElementType() const
Return the element type of this DenseElementsAttr.
FailureOr< iterator_range_impl< ComplexFloatElementIterator > > tryGetComplexFloatValues() const
std::enable_if_t< std::is_same< T, StringRef >::value > StringRefValueTemplateCheckT
Try to get the held element values as a range of StringRef.
IntElementIterator raw_int_end() const
std::enable_if_t<(!std::is_same< T, bool >::value && std::numeric_limits< T >::is_integer)|| is_valid_cpp_fp_type< T >::value > IntFloatValueTemplateCheckT
Try to get the held element values as a range of integer or floating-point values.
static DenseElementsAttr get(ShapedType type, ArrayRef< Attribute > values)
Constructs a dense elements attribute from an array of element values.
std::enable_if_t< std::is_same< T, APFloat >::value > APFloatValueTemplateCheckT
Try to get the held element values as a range of APFloat.
ShapedType getType() const
Return the type of this ElementsAttr, guaranteed to be a vector or tensor with static shape.
FailureOr< iterator_range_impl< FloatElementIterator > > tryGetFloatValues() const
std::enable_if_t< detail::is_complex_t< T >::value &&(std::numeric_limits< ElementT >::is_integer|| is_valid_cpp_fp_type< ElementT >::value)> ComplexValueTemplateCheckT
Try to get the held element values as a range of mlir::Complex.
std::enable_if_t< std::is_same< T, bool >::value > BoolValueTemplateCheckT
Try to get the held element values as a range of bool.
bool empty() const
Returns if the number of elements held by this attribute is 0.
DenseElementsAttr bitcast(Type newElType)
Return a new DenseElementsAttr that has the same data as the current attribute, but has bitcast eleme...
static DenseElementsAttr get(const ShapedType &type, T value)
Constructs a dense integer elements attribute from a single element.
std::enable_if_t< std::is_base_of< Attribute, T >::value &&!std::is_same< Attribute, T >::value, T > getSplatValue() const
Return the splat value for derived attribute element types.
bool isValidIntOrFloat(int64_t dataEltSize, bool isInt, bool isSigned) const
FailureOr< iterator_range_impl< ElementIterator< StringRef > > > tryGetValues() const
FailureOr< iterator_range_impl< IntElementIterator > > tryGetValues() const
DenseElementsAttr reshape(ShapedType newType)
Return a new DenseElementsAttr that has the same data as the current attribute, but has been reshaped...
FailureOr< iterator_range_impl< ComplexIntElementIterator > > tryGetComplexIntValues() const
auto value_end() const
Get an iterator of the given type to the end of the held element values.
static DenseElementsAttr get(const ShapedType &type, ArrayRef< T > values)
Constructs a dense complex elements attribute from an array of complex values.
std::enable_if_t< std::is_same< T, APInt >::value > APIntValueTemplateCheckT
Try to get the held element values as a range of APInts.
FailureOr< iterator_range_impl< BoolElementIterator > > tryGetValues() const
FailureOr< iterator_range_impl< DerivedAttributeElementIterator< T > > > tryGetValues() const
FailureOr< iterator_range_impl< ComplexFloatElementIterator > > tryGetValues() const
FailureOr< iterator_range_impl< ComplexIntElementIterator > > tryGetValues() const
FailureOr< iterator_range_impl< FloatElementIterator > > tryGetValues() const
An attribute that represents a reference to a dense float vector or tensor object.
static DenseFPElementsAttr get(const ShapedType &type, const std::initializer_list< T > &list)
DenseElementsAttr::FloatElementIterator iterator
static DenseFPElementsAttr get(const ShapedType &type, Arg &&arg)
Get an instance of a DenseFPElementsAttr with the given arguments.
iterator begin() const
Iterator access to the float element values.
An attribute that represents a reference to a dense integer vector or tensor object.
static DenseIntElementsAttr get(const ShapedType &type, const std::initializer_list< T > &list)
DenseElementsAttr::IntElementIterator iterator
DenseIntElementsAttr iterates on APInt, so we can use the raw element iterator directly.
iterator begin() const
Iterator access to the integer element values.
static DenseIntElementsAttr get(const ShapedType &type, Arg &&arg)
Get an instance of a DenseIntElementsAttr with the given arguments.
An attribute that associates a referenced attribute with a unique identifier.
static constexpr StringLiteral name
static DistinctAttr create(Attribute referencedAttr)
Creates a distinct attribute that associates a referenced attribute with a unique identifier.
Attribute getReferencedAttr() const
Returns the referenced attribute.
A symbol reference with a reference path containing a single element.
static FlatSymbolRefAttr get(StringAttr value)
Construct a symbol reference for the given value name.
static FlatSymbolRefAttr get(MLIRContext *ctx, StringRef value)
static bool classof(Attribute attr)
Methods for support type inquiry through isa, cast, and dyn_cast.
static FlatSymbolRefAttr get(Operation *symbol)
Convenience getter for building a SymbolRefAttr based on an operation that implements the SymbolTrait...
StringRef getValue() const
Returns the name of the held symbol reference.
StringAttr getAttr() const
Returns the name of the held symbol reference as a StringAttr.
An integer set representing a conjunction of one or more affine equalities and inequalities.
This class defines the main interface for locations in MLIR and acts as a non-nullable wrapper around...
MLIRContext is the top-level object for a collection of MLIR operations.
Operation is the basic unit of execution within MLIR.
An attribute that represents a reference to a splat vector or tensor constant, meaning all of the ele...
static bool classof(Attribute attr)
Method for support type inquiry through isa, cast and dyn_cast.
Instances of the Type class are uniqued, have an immutable identifier and an optional mutable compone...
bool isInteger() const
Return true if this is an integer type (with the specified width).
Base class for DenseArrayAttr that is instantiated and specialized for each supported element type be...
static DenseArrayAttrImpl get(MLIRContext *context, ArrayRef< T > content)
Builder from ArrayRef<T>.
static bool classof(Attribute attr)
Support for isa<>/cast<>.
ArrayRef< T > asArrayRef() const
void print(raw_ostream &os) const
void print(AsmPrinter &printer) const
Print the short form [42, 100, -1] without any type prefix.
static Attribute parse(AsmParser &parser, Type type)
Parse the short form [42, 100, -1] without any type prefix.
static Attribute parseWithoutBraces(AsmParser &parser, Type type)
Parse the short form 42, 100, -1 without any type prefix or braces.
void printWithoutBraces(raw_ostream &os) const
Print the short form 42, 100, -1 without any braces or type prefix.
T operator[](std::size_t index) const
Random access to elements.
Impl iterator for indexed DenseElementsAttr iterators that records a data pointer and data index that...
ptrdiff_t getDataIndex() const
Return the current index for this iterator, adjusted for the case of a splat.
const char * getData() const
Return the data base pointer.
DenseElementIndexedIteratorImpl(const char *data, bool isSplat, size_t dataIndex)
Base class for DenseResourceElementsAttr that is instantiated and specialized for each supported elem...
static bool classof(Attribute attr)
Support for isa<>/cast<>.
static DenseResourceElementsAttrBase< T > get(ShapedType type, StringRef blobName, AsmResourceBlob blob)
A builder that inserts a new resource using the provided blob.
std::optional< ArrayRef< T > > tryGetAsArrayRef() const
Return the data of this attribute as an ArrayRef<T> if it is present, returns std::nullopt otherwise.
A specialized attribute uniquer for distinct attributes that always allocates since the distinct attr...
This class provides iterator utilities for an ElementsAttr range.
Utility class for implementing users of storage classes uniqued by a StorageUniquer.
StorageUserBase< ConcreteT, BaseT, StorageT, UniquerT, Traits... > Base
Utility declarations for the concrete attribute class.
This file contains the declaration of the mlir::NonFloatComplex type and mlir::Complex type alias.
The OpAsmOpInterface, see OpAsmInterface.td for more details.
std::pair< const char *, bool > DenseIterPtrAndSplat
Pair of raw pointer and a boolean flag of whether the pointer holds a splat,.
Include the generated interface declarations.
detail::DenseArrayAttrImpl< int64_t > DenseI64ArrayAttr
detail::DenseResourceElementsAttrBase< uint64_t > DenseUI64ResourceElementsAttr
detail::DenseResourceElementsAttrBase< int32_t > DenseI32ResourceElementsAttr
detail::DenseResourceElementsAttrBase< uint32_t > DenseUI32ResourceElementsAttr
detail::DenseArrayAttrImpl< int8_t > DenseI8ArrayAttr
DialectResourceBlobHandle< BuiltinDialect > DenseResourceElementsHandle
detail::DenseResourceElementsAttrBase< float > DenseF32ResourceElementsAttr
bool operator==(StringAttr lhs, std::nullptr_t)
Define comparisons for StringAttr against nullptr and itself to avoid the StringRef overloads from be...
detail::DenseResourceElementsAttrBase< bool > DenseBoolResourceElementsAttr
bool operator!=(RegionBranchPoint lhs, RegionBranchPoint rhs)
detail::DenseResourceElementsAttrBase< int16_t > DenseI16ResourceElementsAttr
std::conditional_t< std::is_floating_point_v< T >, std::complex< T >, NonFloatComplex< T > > Complex
detail::DenseResourceElementsAttrBase< int64_t > DenseI64ResourceElementsAttr
detail::DenseArrayAttrImpl< int32_t > DenseI32ArrayAttr
detail::DenseResourceElementsAttrBase< uint16_t > DenseUI16ResourceElementsAttr
AffineExpr operator*(int64_t val, AffineExpr expr)
AffineMap makeStridedLinearLayoutMap(ArrayRef< int64_t > strides, int64_t offset, MLIRContext *context)
Given a list of strides (in which ShapedType::kDynamic represents a dynamic value),...
auto get(MLIRContext *context, Ts &&...params)
Helper method that injects context only if needed, this helps unify some of the attribute constructio...
detail::DenseArrayAttrImpl< double > DenseF64ArrayAttr
detail::DenseArrayAttrImpl< bool > DenseBoolArrayAttr
detail::DenseResourceElementsAttrBase< int8_t > DenseI8ResourceElementsAttr
detail::DenseArrayAttrImpl< float > DenseF32ArrayAttr
detail::DenseResourceElementsAttrBase< uint8_t > DenseUI8ResourceElementsAttr
detail::DenseArrayAttrImpl< int16_t > DenseI16ArrayAttr
llvm::function_ref< Fn > function_ref
detail::DenseResourceElementsAttrBase< double > DenseF64ResourceElementsAttr
static mlir::StringAttr getTombstoneKey()
static mlir::StringAttr getEmptyKey()
static mlir::IntegerAttr getFromVoidPointer(void *p)
static mlir::StringAttr getFromVoidPointer(void *p)
static mlir::SymbolRefAttr getFromVoidPointer(void *ptr)
T mapElement(Attribute attr) const
Map the element to the iterator result type.
Type trait used to check if the given type T is a potentially valid C++ floating point type that can ...
static constexpr bool value
The type is a valid floating point type if it is a builtin floating point type, or is a potentially u...
This class defines a dialect specific handle to a resource blob.
An attribute representing a reference to a dense vector or tensor object containing strings.
An attribute representing a reference to a dense vector or tensor object.
An attribute to store a distinct reference to another attribute.
Type trait detector that checks if a given type T is a complex type.