9#ifndef MLIR_IR_BUILTINATTRIBUTES_H
10#define MLIR_IR_BUILTINATTRIBUTES_H
13#include "llvm/ADT/APFloat.h"
14#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; }
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) {
214 template <
typename IteratorT>
218 template <
typename T,
typename AttrT = DenseElementsAttr>
221 template <
typename T,
typename AttrT = DenseElementsAttr>
223 decltype(std::declval<AttrT>().template
getValues<T>());
227 class AttributeElementIterator
228 :
public llvm::indexed_accessor_iterator<AttributeElementIterator,
236 friend DenseElementsAttr;
239 AttributeElementIterator(DenseElementsAttr attr,
size_t index);
245 template <
typename T>
246 class ElementIterator
265 class BoolElementIterator
273 friend DenseElementsAttr;
276 BoolElementIterator(DenseElementsAttr attr,
size_t dataIndex);
280 class IntElementIterator
282 APInt, APInt, APInt> {
288 friend DenseElementsAttr;
291 IntElementIterator(DenseElementsAttr attr,
size_t dataIndex);
299 class ComplexIntElementIterator
301 ComplexIntElementIterator, std::complex<APInt>, std::complex<APInt>,
302 std::complex<APInt>> {
308 friend DenseElementsAttr;
311 ComplexIntElementIterator(DenseElementsAttr attr,
size_t dataIndex);
318 class FloatElementIterator final
319 :
public llvm::mapped_iterator_base<FloatElementIterator,
320 IntElementIterator, APFloat> {
324 return APFloat(*smt, value);
335 const llvm::fltSemantics *
smt;
339 class ComplexFloatElementIterator final
340 :
public llvm::mapped_iterator_base<ComplexFloatElementIterator,
341 ComplexIntElementIterator,
342 std::complex<APFloat>> {
345 std::complex<APFloat>
mapElement(
const std::complex<APInt> &value)
const {
346 return {APFloat(*smt, value.real()), APFloat(*smt, value.imag())};
358 const llvm::fltSemantics *
smt;
371 template <
typename T>
372 std::enable_if_t<!std::is_base_of<Attribute, T>::value ||
373 std::is_same<Attribute, T>::value,
376 assert(
isSplat() &&
"expected the attribute to be a splat");
380 template <
typename T>
381 std::enable_if_t<std::is_base_of<Attribute, T>::value &&
382 !std::is_same<Attribute, T>::value,
390 template <
typename T>
393 using iterator =
decltype(range->begin());
394 return failed(range) ? FailureOr<iterator>(failure()) : range->begin();
399 template <
typename T>
402 using iterator =
decltype(range->begin());
403 return failed(range) ? FailureOr<iterator>(failure()) : range->end();
407 template <
typename T>
410 assert(succeeded(range) &&
"element type cannot be iterated");
411 return std::move(*range);
415 template <
typename T>
421 template <
typename T>
428 template <
typename T>
430 std::enable_if_t<(!std::is_same<T, bool>::value &&
431 std::numeric_limits<T>::is_integer) ||
433 template <
typename T,
typename = IntFloatValueTemplateCheckT<T>>
434 FailureOr<iterator_range_impl<ElementIterator<T>>>
tryGetValues()
const {
436 std::numeric_limits<T>::is_signed))
446 template <
typename T,
typename ElementT>
448 std::enable_if_t<detail::is_complex_t<T>::value &&
449 (std::numeric_limits<ElementT>::is_integer ||
451 template <
typename T,
typename ElementT =
typename T::value_type,
453 FailureOr<iterator_range_impl<ElementIterator<T>>>
tryGetValues()
const {
454 if (!
isValidComplex(
sizeof(T), std::numeric_limits<ElementT>::is_integer,
455 std::numeric_limits<ElementT>::is_signed))
465 template <
typename T>
467 std::enable_if_t<std::is_same<T, StringRef>::value>;
468 template <
typename T,
typename = StringRefValueTemplateCheckT<T>>
469 FailureOr<iterator_range_impl<ElementIterator<StringRef>>>
472 const char *
ptr =
reinterpret_cast<const char *
>(stringRefs.data());
480 template <
typename T>
482 std::enable_if_t<std::is_same<T, Attribute>::value>;
483 template <
typename T,
typename = AttributeValueTemplateCheckT<T>>
484 FailureOr<iterator_range_impl<AttributeElementIterator>>
493 template <
typename T>
495 std::enable_if_t<std::is_base_of<Attribute, T>::value &&
496 !std::is_same<Attribute, T>::value>;
497 template <
typename T>
499 :
public llvm::mapped_iterator_base<DerivedAttributeElementIterator<T>,
500 AttributeElementIterator, T> {
503 T>::mapped_iterator_base;
508 template <
typename T,
typename = DerivedAttrValueTemplateCheckT<T>>
509 FailureOr<iterator_range_impl<DerivedAttributeElementIterator<T>>>
519 template <
typename T>
521 std::enable_if_t<std::is_same<T, bool>::value>;
522 template <
typename T,
typename = BoolValueTemplateCheckT<T>>
523 FailureOr<iterator_range_impl<BoolElementIterator>>
tryGetValues()
const {
533 template <
typename T>
535 std::enable_if_t<std::is_same<T, APInt>::value>;
536 template <
typename T,
typename = APIntValueTemplateCheckT<T>>
537 FailureOr<iterator_range_impl<IntElementIterator>>
tryGetValues()
const {
546 template <
typename T>
548 std::enable_if_t<std::is_same<T, std::complex<APInt>>::value>;
549 template <
typename T,
typename = ComplexAPIntValueTemplateCheckT<T>>
550 FailureOr<iterator_range_impl<ComplexIntElementIterator>>
557 template <
typename T>
559 std::enable_if_t<std::is_same<T, APFloat>::value>;
560 template <
typename T,
typename = APFloatValueTemplateCheckT<T>>
561 FailureOr<iterator_range_impl<FloatElementIterator>>
tryGetValues()
const {
567 template <
typename T>
569 std::enable_if_t<std::is_same<T, std::complex<APFloat>>::value>;
570 template <
typename T,
typename = ComplexAPFloatValueTemplateCheckT<T>>
571 FailureOr<iterator_range_impl<ComplexFloatElementIterator>>
642 FailureOr<iterator_range_impl<ComplexIntElementIterator>>
644 FailureOr<iterator_range_impl<FloatElementIterator>>
646 FailureOr<iterator_range_impl<ComplexFloatElementIterator>>
653 int64_t dataEltSize,
bool isInt,
661 int64_t dataEltSize,
bool isInt,
676 using DenseElementsAttr::DenseElementsAttr;
680 auto denseAttr = llvm::dyn_cast<DenseElementsAttr>(attr);
681 return denseAttr && denseAttr.isSplat();
697#define GET_ATTRDEF_CLASSES
698#include "mlir/IR/BuiltinAttributes.h.inc"
715 using DenseArrayAttr::DenseArrayAttr;
771 using DenseResourceElementsAttr::DenseResourceElementsAttr;
842 operator IntegerAttr()
const {
return IntegerAttr(
impl); }
843 operator TypedAttr()
const {
return IntegerAttr(
impl); }
846 bool getValue()
const;
860 using SymbolRefAttr::SymbolRefAttr;
865 return SymbolRefAttr::get(value);
868 return SymbolRefAttr::get(ctx, value);
874 return SymbolRefAttr::get(symbol);
878 StringAttr
getAttr()
const {
return getRootReference(); }
885 SymbolRefAttr refAttr = llvm::dyn_cast<SymbolRefAttr>(attr);
886 return refAttr && refAttr.getNestedReferences().empty();
890 using SymbolRefAttr::get;
891 using SymbolRefAttr::getNestedReferences;
904 using DenseIntOrFPElementsAttr::DenseIntOrFPElementsAttr;
908 template <
typename Arg>
910 return llvm::cast<DenseFPElementsAttr>(
913 template <
typename T>
915 const std::initializer_list<T> &list) {
922 mapValues(
Type newElementType,
945 using DenseIntOrFPElementsAttr::DenseIntOrFPElementsAttr;
949 template <
typename Arg>
951 return llvm::cast<DenseIntElementsAttr>(
954 template <
typename T>
956 const std::initializer_list<T> &list) {
978auto SparseElementsAttr::try_value_begin_impl(OverloadToken<T>)
const
979 -> FailureOr<iterator<T>> {
980 auto zeroValue = getZeroValue<T>();
981 auto valueIt = getValues().try_value_begin<T>();
984 const SmallVector<ptrdiff_t> flatSparseIndices(getFlattenedSparseIndices());
985 std::function<T(ptrdiff_t)> mapFn =
986 [flatSparseIndices{flatSparseIndices}, valueIt{std::move(*valueIt)},
987 zeroValue{std::move(zeroValue)}](ptrdiff_t
index) {
989 for (
unsigned i = 0, e = flatSparseIndices.size(); i != e; ++i)
990 if (flatSparseIndices[i] ==
index)
991 return *std::next(valueIt, i);
995 return iterator<T>(llvm::seq<ptrdiff_t>(0,
getNumElements()).begin(), mapFn);
1025 detail::DistinctAttrStorage,
1026 detail::DistinctAttributeUniquer> {
1037 static constexpr StringLiteral
name =
"builtin.distinct";
1048 return static_cast<bool>(
lhs);
1057 return lhs.getValue() ==
rhs;
1061 return rhs.getValue() ==
lhs;
1101 return mlir::StringAttr::getFromOpaquePointer(pointer);
1105 return mlir::StringAttr::getFromOpaquePointer(pointer);
1109struct PointerLikeTypeTraits<
mlir::StringAttr>
1110 :
public PointerLikeTypeTraits<mlir::Attribute> {
1112 return mlir::StringAttr::getFromOpaquePointer(p);
1117struct PointerLikeTypeTraits<
mlir::IntegerAttr>
1118 :
public PointerLikeTypeTraits<mlir::Attribute> {
1120 return mlir::IntegerAttr::getFromOpaquePointer(p);
1125struct PointerLikeTypeTraits<
mlir::SymbolRefAttr>
1126 :
public PointerLikeTypeTraits<mlir::Attribute> {
1128 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.
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.
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...
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, std::complex< APInt > >::value > ComplexAPIntValueTemplateCheckT
Try to get the held element values as a range of complex APInts.
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.
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.
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 std::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.
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
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.
An attribute representing a reference to a dense vector or tensor object containing strings.
An attribute to store a distinct reference to another attribute.
Type trait detector that checks if a given type T is a complex type.