9 #ifndef MLIR_IR_BUILTINATTRIBUTES_H
10 #define MLIR_IR_BUILTINATTRIBUTES_H
13 #include "llvm/ADT/APFloat.h"
14 #include "llvm/ADT/Sequence.h"
20 class AsmResourceBlob;
23 class DenseIntElementsAttr;
25 struct DialectResourceBlobHandle;
26 class FlatSymbolRefAttr;
32 class RankedTensorType;
35 struct DenseIntOrFPElementsAttrStorage;
36 struct DenseStringElementsAttrStorage;
37 struct StringAttrStorage;
50 template <
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; }
87 operator ElementsAttr()
const {
return cast_if_present<ElementsAttr>(*
this); }
89 operator TypedAttr()
const {
return ElementsAttr(*
this); }
100 static constexpr
bool value = llvm::is_one_of<T, float, double>::value ||
101 (std::numeric_limits<T>::is_specialized &&
102 !std::numeric_limits<T>::is_integer);
118 template <
typename T,
119 typename = std::enable_if_t<std::numeric_limits<T>::is_integer ||
122 const char *data =
reinterpret_cast<const char *
>(values.data());
125 std::numeric_limits<T>::is_integer, std::numeric_limits<T>::is_signed);
129 template <
typename T,
130 typename = std::enable_if_t<std::numeric_limits<T>::is_integer ||
141 typename T,
typename ElementT =
typename T::value_type,
142 typename = std::enable_if_t<detail::is_complex_t<T>::value &&
143 (std::numeric_limits<ElementT>::is_integer ||
146 const char *data =
reinterpret_cast<const char *
>(values.data());
148 sizeof(T), std::numeric_limits<ElementT>::is_integer,
149 std::numeric_limits<ElementT>::is_signed);
170 ArrayRef<std::complex<APInt>> values);
183 ArrayRef<std::complex<APFloat>> values);
188 template <
typename T>
190 const std::initializer_list<T> &list) {
220 bool &detectedSplat);
227 template <
typename IteratorT>
231 template <
typename T,
typename AttrT = DenseElementsAttr>
232 using iterator = decltype(std::declval<AttrT>().
template value_begin<T>());
234 template <
typename T,
typename AttrT = DenseElementsAttr>
236 decltype(std::declval<AttrT>().
template getValues<T>());
258 template <
typename T>
295 APInt, APInt, APInt> {
314 ComplexIntElementIterator, std::complex<APInt>, std::complex<APInt>,
315 std::complex<APInt>> {
332 :
public llvm::mapped_iterator_base<FloatElementIterator,
333 IntElementIterator, APFloat> {
337 return APFloat(*smt, value);
345 :
BaseT(it), smt(&smt) {}
348 const llvm::fltSemantics *smt;
353 :
public llvm::mapped_iterator_base<ComplexFloatElementIterator,
354 ComplexIntElementIterator,
355 std::complex<APFloat>> {
358 std::complex<APFloat>
mapElement(
const std::complex<APInt> &value)
const {
359 return {APFloat(*smt, value.real()), APFloat(*smt, value.imag())};
368 :
BaseT(it), smt(&smt) {}
371 const llvm::fltSemantics *smt;
384 template <
typename T>
385 std::enable_if_t<!std::is_base_of<Attribute, T>::value ||
386 std::is_same<Attribute, T>::value,
389 assert(
isSplat() &&
"expected the attribute to be a splat");
390 return *value_begin<T>();
393 template <
typename T>
394 std::enable_if_t<std::is_base_of<Attribute, T>::value &&
395 !std::is_same<Attribute, T>::value,
398 return llvm::cast<T>(getSplatValue<Attribute>());
403 template <
typename T>
405 auto range = tryGetValues<T>();
406 using iterator = decltype(range->begin());
407 return failed(range) ? FailureOr<iterator>(failure()) : range->begin();
412 template <
typename T>
414 auto range = tryGetValues<T>();
415 using iterator = decltype(range->begin());
416 return failed(range) ? FailureOr<iterator>(failure()) : range->end();
420 template <
typename T>
422 auto range = tryGetValues<T>();
423 assert(succeeded(range) &&
"element type cannot be iterated");
424 return std::move(*range);
428 template <
typename T>
430 return getValues<T>().begin();
434 template <
typename T>
436 return getValues<T>().end();
441 template <
typename T>
443 std::enable_if_t<(!std::is_same<T, bool>::value &&
444 std::numeric_limits<T>::is_integer) ||
446 template <
typename T,
typename = IntFloatValueTemplateCheckT<T>>
447 FailureOr<iterator_range_impl<ElementIterator<T>>>
tryGetValues()
const {
449 std::numeric_limits<T>::is_signed))
459 template <
typename T,
typename ElementT>
461 std::enable_if_t<detail::is_complex_t<T>::value &&
462 (std::numeric_limits<ElementT>::is_integer ||
464 template <
typename T,
typename ElementT =
typename T::value_type,
466 FailureOr<iterator_range_impl<ElementIterator<T>>>
tryGetValues()
const {
467 if (!
isValidComplex(
sizeof(T), std::numeric_limits<ElementT>::is_integer,
468 std::numeric_limits<ElementT>::is_signed))
478 template <
typename T>
480 std::enable_if_t<std::is_same<T, StringRef>::value>;
481 template <
typename T,
typename = StringRefValueTemplateCheckT<T>>
482 FailureOr<iterator_range_impl<ElementIterator<StringRef>>>
485 const char *ptr =
reinterpret_cast<const char *
>(stringRefs.data());
493 template <
typename T>
495 std::enable_if_t<std::is_same<T, Attribute>::value>;
496 template <
typename T,
typename = AttributeValueTemplateCheckT<T>>
497 FailureOr<iterator_range_impl<AttributeElementIterator>>
506 template <
typename T>
508 std::enable_if_t<std::is_base_of<Attribute, T>::value &&
509 !std::is_same<Attribute, T>::value>;
510 template <
typename T>
512 :
public llvm::mapped_iterator_base<DerivedAttributeElementIterator<T>,
513 AttributeElementIterator, T> {
514 using llvm::mapped_iterator_base<DerivedAttributeElementIterator<T>,
516 T>::mapped_iterator_base;
521 template <
typename T,
typename = DerivedAttrValueTemplateCheckT<T>>
522 FailureOr<iterator_range_impl<DerivedAttributeElementIterator<T>>>
526 getType(), DerivedIterT(value_begin<Attribute>()),
527 DerivedIterT(value_end<Attribute>()));
532 template <
typename T>
534 std::enable_if_t<std::is_same<T, bool>::value>;
535 template <
typename T,
typename = BoolValueTemplateCheckT<T>>
536 FailureOr<iterator_range_impl<BoolElementIterator>>
tryGetValues()
const {
546 template <
typename T>
548 std::enable_if_t<std::is_same<T, APInt>::value>;
549 template <
typename T,
typename = APIntValueTemplateCheckT<T>>
550 FailureOr<iterator_range_impl<IntElementIterator>>
tryGetValues()
const {
559 template <
typename T>
561 std::enable_if_t<std::is_same<T, std::complex<APInt>>::value>;
562 template <
typename T,
typename = ComplexAPIntValueTemplateCheckT<T>>
563 FailureOr<iterator_range_impl<ComplexIntElementIterator>>
570 template <
typename T>
572 std::enable_if_t<std::is_same<T, APFloat>::value>;
573 template <
typename T,
typename = APFloatValueTemplateCheckT<T>>
574 FailureOr<iterator_range_impl<FloatElementIterator>>
tryGetValues()
const {
580 template <
typename T>
582 std::enable_if_t<std::is_same<T, std::complex<APFloat>>::value>;
583 template <
typename T,
typename = ComplexAPFloatValueTemplateCheckT<T>>
584 FailureOr<iterator_range_impl<ComplexFloatElementIterator>>
655 FailureOr<iterator_range_impl<ComplexIntElementIterator>>
657 FailureOr<iterator_range_impl<FloatElementIterator>>
659 FailureOr<iterator_range_impl<ComplexFloatElementIterator>>
666 int64_t dataEltSize,
bool isInt,
674 int64_t dataEltSize,
bool isInt,
682 bool isValidComplex(int64_t dataEltSize,
bool isInt,
bool isSigned)
const;
689 using DenseElementsAttr::DenseElementsAttr;
693 auto denseAttr = llvm::dyn_cast<DenseElementsAttr>(attr);
694 return denseAttr && denseAttr.isSplat();
710 #define GET_ATTRDEF_CLASSES
711 #include "mlir/IR/BuiltinAttributes.h.inc"
724 template <
typename T>
727 using DenseArrayAttr::DenseArrayAttr;
741 void print(raw_ostream &os)
const;
755 extern template class DenseArrayAttrImpl<bool>;
756 extern template class DenseArrayAttrImpl<int8_t>;
757 extern template class DenseArrayAttrImpl<int16_t>;
758 extern template class DenseArrayAttrImpl<int32_t>;
759 extern template class DenseArrayAttrImpl<int64_t>;
760 extern template class DenseArrayAttrImpl<float>;
761 extern template class DenseArrayAttrImpl<double>;
779 template <
typename T>
782 using DenseResourceElementsAttr::DenseResourceElementsAttr;
794 std::optional<ArrayRef<T>> tryGetAsArrayRef()
const;
853 operator IntegerAttr()
const {
return IntegerAttr(
impl); }
854 operator TypedAttr()
const {
return IntegerAttr(
impl); }
857 bool getValue()
const;
871 using SymbolRefAttr::SymbolRefAttr;
889 StringAttr
getAttr()
const {
return getRootReference(); }
892 StringRef
getValue()
const {
return getAttr().getValue(); }
896 SymbolRefAttr refAttr = llvm::dyn_cast<SymbolRefAttr>(attr);
897 return refAttr && refAttr.getNestedReferences().empty();
902 using SymbolRefAttr::getNestedReferences;
915 using DenseIntOrFPElementsAttr::DenseIntOrFPElementsAttr;
919 template <
typename Arg>
921 return llvm::cast<DenseFPElementsAttr>(
924 template <
typename T>
926 const std::initializer_list<T> &list) {
933 mapValues(
Type newElementType,
956 using DenseIntOrFPElementsAttr::DenseIntOrFPElementsAttr;
960 template <
typename Arg>
962 return llvm::cast<DenseIntElementsAttr>(
965 template <
typename T>
967 const std::initializer_list<T> &list) {
988 template <
typename T>
989 auto SparseElementsAttr::try_value_begin_impl(OverloadToken<T>)
const
990 -> FailureOr<iterator<T>> {
991 auto zeroValue = getZeroValue<T>();
992 auto valueIt = getValues().try_value_begin<T>();
995 const std::vector<ptrdiff_t> flatSparseIndices(getFlattenedSparseIndices());
996 std::function<T(ptrdiff_t)> mapFn =
997 [flatSparseIndices{flatSparseIndices}, valueIt{std::move(*valueIt)},
998 zeroValue{std::move(zeroValue)}](ptrdiff_t index) {
1000 for (
unsigned i = 0, e = flatSparseIndices.size(); i != e; ++i)
1001 if (flatSparseIndices[i] == index)
1002 return *std::next(valueIt, i);
1006 return iterator<T>(llvm::seq<ptrdiff_t>(0,
getNumElements()).begin(), mapFn);
1014 struct DistinctAttrStorage;
1015 class DistinctAttributeUniquer;
1036 detail::DistinctAttrStorage,
1037 detail::DistinctAttributeUniquer> {
1048 static constexpr StringLiteral
name =
"builtin.distinct";
1057 inline bool operator==(StringAttr lhs, std::nullptr_t) {
return !lhs; }
1059 return static_cast<bool>(lhs);
1064 inline bool operator!=(StringAttr lhs, StringAttr rhs) {
return !(lhs == rhs); }
1068 return lhs.getValue() == rhs;
1070 inline bool operator!=(StringAttr lhs, StringRef rhs) {
return !(lhs == rhs); }
1072 return rhs.getValue() == lhs;
1074 inline bool operator!=(StringRef lhs, StringAttr rhs) {
return !(lhs == rhs); }
1102 MLIRContext *context);
1112 return mlir::StringAttr::getFromOpaquePointer(pointer);
1116 return mlir::StringAttr::getFromOpaquePointer(pointer);
1120 struct PointerLikeTypeTraits<
mlir::StringAttr>
1121 :
public PointerLikeTypeTraits<mlir::Attribute> {
1123 return mlir::StringAttr::getFromOpaquePointer(p);
1128 struct PointerLikeTypeTraits<
mlir::IntegerAttr>
1129 :
public PointerLikeTypeTraits<mlir::Attribute> {
1131 return mlir::IntegerAttr::getFromOpaquePointer(p);
1136 struct PointerLikeTypeTraits<
mlir::SymbolRefAttr>
1137 :
public PointerLikeTypeTraits<mlir::Attribute> {
1139 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.
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.
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.
std::complex< APFloat > mapElement(const std::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.
std::complex< APInt > operator*() const
Accesses the raw std::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.
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.
ArrayRef< StringRef > getRawStringData() const
Return the raw StringRef data held by this attribute.
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...
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.
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.
std::enable_if_t< std::is_same< T, std::complex< APFloat > >::value > ComplexAPFloatValueTemplateCheckT
Try to get the held element values as a range of complex APFloat.
std::enable_if_t< std::is_same< T, APFloat >::value > APFloatValueTemplateCheckT
Try to get the held element values as a range of APFloat.
std::enable_if_t< std::is_same< T, StringRef >::value > StringRefValueTemplateCheckT
Try to get the held element values as a range of StringRef.
FailureOr< iterator_range_impl< BoolElementIterator > > tryGetValues() const
std::enable_if_t< std::is_same< T, Attribute >::value > AttributeValueTemplateCheckT
Try to get the held element values as a range of Attributes.
bool isValidComplex(int64_t dataEltSize, bool isInt, bool isSigned) const
FailureOr< iterator_range_impl< ComplexFloatElementIterator > > 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 ...
int64_t getNumElements() const
Returns the number of elements held by 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.
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.
int64_t size() const
Returns the number of elements held by this attribute.
FailureOr< iterator_range_impl< ComplexIntElementIterator > > tryGetValues() const
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.
FailureOr< iterator_range_impl< DerivedAttributeElementIterator< T > > > tryGetValues() 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.
FailureOr< iterator_range_impl< ElementIterator< T > > > tryGetValues() const
constexpr Attribute()=default
static DenseElementsAttr get(const ShapedType &type, ArrayRef< T > values)
Constructs a dense integer elements attribute from an array of integer or floating-point values.
FailureOr< iterator_range_impl< FloatElementIterator > > tryGetValues() const
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.
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 std::complex.
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.
decltype(std::declval< AttrT >().template getValues< T >()) iterator_range
The iterator range over the given element T.
Type getElementType() const
Return the element type of this DenseElementsAttr.
FailureOr< iterator_range_impl< ComplexFloatElementIterator > > tryGetComplexFloatValues() const
IntElementIterator raw_int_end() const
static DenseElementsAttr get(ShapedType type, ArrayRef< Attribute > values)
Constructs a dense elements attribute from an array of element values.
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
static bool isValidRawBuffer(ShapedType type, ArrayRef< char > rawBuffer, bool &detectedSplat)
Returns true if the given buffer is a valid raw buffer for the given type.
FailureOr< iterator_range_impl< AttributeElementIterator > > tryGetValues() const
bool empty() const
Returns if the number of elements held by this attribute is 0.
FailureOr< iterator_range_impl< IntElementIterator > > tryGetValues() const
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_same< T, bool >::value > BoolValueTemplateCheckT
Try to get the held element values as a range of bool.
bool isValidIntOrFloat(int64_t dataEltSize, bool isInt, bool isSigned) const
DenseElementsAttr reshape(ShapedType newType)
Return a new DenseElementsAttr that has the same data as the current attribute, but has been reshaped...
std::enable_if_t< std::is_same< T, APInt >::value > APIntValueTemplateCheckT
Try to get the held element values as a range of APInts.
std::enable_if_t< std::is_same< T, std::complex< APInt > >::value > ComplexAPIntValueTemplateCheckT
Try to get the held element values as a range of complex APInts.
FailureOr< iterator_range_impl< ElementIterator< StringRef > > > tryGetValues() const
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.
FailureOr< iterator_range_impl< ElementIterator< T > > > tryGetValues() const
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.
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)
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)
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.
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(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...
const char * getData() const
Return the data base pointer.
ptrdiff_t getDataIndex() const
Return the current index for this iterator, adjusted for the case of a splat.
DenseElementIndexedIteratorImpl(const char *data, bool isSplat, size_t dataIndex)
Base class for DenseResourceElementsAttr that is instantiated and specialized for each supported elem...
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.
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.
bool operator==(StringAttr lhs, std::nullptr_t)
Define comparisons for StringAttr against nullptr and itself to avoid the StringRef overloads from be...
bool operator!=(RegionBranchPoint lhs, RegionBranchPoint rhs)
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...
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.
Type trait detector that checks if a given type T is a complex type.