9 #ifndef MLIR_IR_ATTRIBUTES_H 10 #define MLIR_IR_ATTRIBUTES_H 13 #include "llvm/ADT/APFloat.h" 14 #include "llvm/ADT/Sequence.h" 29 struct AffineMapAttributeStorage;
30 struct ArrayAttributeStorage;
31 struct BoolAttributeStorage;
32 struct DictionaryAttributeStorage;
33 struct IntegerAttributeStorage;
34 struct IntegerSetAttributeStorage;
35 struct FloatAttributeStorage;
36 struct OpaqueAttributeStorage;
37 struct StringAttributeStorage;
38 struct SymbolRefAttributeStorage;
39 struct TypeAttributeStorage;
42 struct DenseElementsAttributeStorage;
43 struct OpaqueElementsAttributeStorage;
44 struct SparseElementsAttributeStorage;
58 #define DEFINE_SYM_KIND_RANGE(Dialect) \ 59 FIRST_##Dialect##_ATTR, LAST_##Dialect##_ATTR = FIRST_##Dialect##_ATTR + 0xff, 60 #include "DialectSymbolRegistry.def" 64 template <
typename ConcreteType,
typename BaseType = Attribute,
65 typename StorageType = AttributeStorage>
66 using AttrBase = detail::StorageUserBase<ConcreteType, BaseType, StorageType,
74 : impl(const_cast<
ImplType *>(impl)) {}
81 explicit operator bool()
const {
return impl; }
85 template <
typename U>
bool isa()
const;
86 template <
typename U> U dyn_cast()
const;
87 template <
typename U> U dyn_cast_or_null()
const;
88 template <
typename U> U cast()
const;
94 unsigned getKind()
const {
return impl->getKind(); }
106 void print(raw_ostream &os)
const;
113 return Attribute(reinterpret_cast<const ImplType *>(ptr));
127 namespace StandardAttributes {
177 detail::AffineMapAttributeStorage> {
199 detail::ArrayAttributeStorage> {
212 size_t size()
const {
return getValue().size(); }
221 template <
typename AttrTy>
222 class attr_value_iterator final
223 :
public llvm::mapped_iterator<iterator, AttrTy (*)(Attribute)> {
225 explicit attr_value_iterator(
iterator it)
226 : llvm::mapped_iterator<iterator, AttrTy (*)(Attribute)>(
227 it, [](
Attribute attr) {
return attr.cast<AttrTy>(); }) {}
228 AttrTy
operator*() {
return (*this->I).template cast<AttrTy>(); }
232 template <
typename AttrTy>
234 return llvm::make_range(attr_value_iterator<AttrTy>(begin()),
235 attr_value_iterator<AttrTy>(end()));
244 detail::BoolAttributeStorage> {
251 bool getValue()
const;
271 detail::DictionaryAttributeStorage> {
289 bool empty()
const {
return size() == 0; }
303 detail::FloatAttributeStorage> {
318 APFloat getValue()
const;
322 double getValueAsDouble()
const;
323 static double getValueAsDouble(APFloat val);
336 const APFloat &value);
345 detail::IntegerAttributeStorage> {
353 APInt getValue()
const;
355 int64_t getInt()
const;
369 detail::IntegerSetAttributeStorage> {
392 detail::OpaqueAttributeStorage> {
410 StringRef getAttrData()
const;
429 detail::StringAttributeStorage> {
440 StringRef getValue()
const;
458 detail::SymbolRefAttributeStorage> {
473 StringRef getRootReference()
const;
477 StringRef getLeafReference()
const;
493 using SymbolRefAttr::SymbolRefAttr;
502 StringRef
getValue()
const {
return getRootReference(); }
520 detail::TypeAttributeStorage> {
527 Type getValue()
const;
576 return getValue(index).template cast<T>();
588 int64_t getNumElements()
const;
621 return static_cast<const char *
>(ptr);
625 enum { NumLowBitsAvailable = 1 };
630 llvm::PointerIntPair<
const char *, 1, bool,
635 template <
typename ConcreteT,
typename T,
typename PointerT = T *,
636 typename ReferenceT = T &>
639 PointerT, ReferenceT> {
644 ReferenceT>({data, isSplat}, dataIndex) {}
649 bool isSplat = this->base.getInt();
650 return isSplat ? 0 : this->index;
654 const char *
getData()
const {
return this->base.getPointer(); }
662 detail::DenseElementsAttributeStorage> {
680 template <
typename T,
typename =
typename std::enable_if<
681 std::numeric_limits<T>::is_integer ||
682 llvm::is_one_of<T, float, double>::value>::type>
684 const char *data =
reinterpret_cast<const char *
>(values.data());
685 return getRawIntOrFloat(
687 std::numeric_limits<T>::is_integer);
691 template <
typename T,
typename =
typename std::enable_if<
692 std::numeric_limits<T>::is_integer ||
693 llvm::is_one_of<T, float, double>::value>::type>
695 return get(type, llvm::makeArrayRef(value));
716 template <
typename T>
718 const std::initializer_list<T> &list) {
730 Attribute, Attribute, Attribute> {
745 template <
typename T>
752 return reinterpret_cast<const T *
>(this->getData())[this->getDataIndex()];
761 data, isSplat, dataIndex) {}
782 APInt, APInt, APInt> {
799 :
public llvm::mapped_iterator<IntElementIterator,
800 std::function<APFloat(const APInt &)>> {
816 bool isSplat()
const;
821 template <
typename T>
822 typename std::enable_if<!std::is_base_of<Attribute, T>::value ||
823 std::is_same<Attribute, T>::value,
826 assert(isSplat() &&
"expected the attribute to be a splat");
827 return *getValues<T>().begin();
830 template <
typename T>
831 typename std::enable_if<std::is_base_of<Attribute, T>::value &&
832 !std::is_same<Attribute, T>::value,
835 return getSplatValue().template cast<T>();
841 return getValue<Attribute>(index);
845 return *std::next(getValues<T>().begin(), getFlattenedIndex(index));
850 template <
typename T,
typename =
typename std::enable_if<
851 (!std::is_same<T, bool>::value &&
852 std::numeric_limits<T>::is_integer) ||
853 llvm::is_one_of<T, float, double>::value>::type>
855 assert(isValidIntOrFloat(
sizeof(T), std::numeric_limits<T>::is_integer));
856 auto rawData = getRawData().data();
857 bool splat = isSplat();
864 template <
typename T,
typename =
typename std::enable_if<
865 std::is_same<T, Attribute>::value>::type>
867 return getAttributeValues();
874 template <
typename T>
876 llvm::mapped_iterator<AttributeElementIterator, T (*)(Attribute)>;
877 template <
typename T,
typename =
typename std::enable_if<
878 std::is_base_of<Attribute, T>::value &&
879 !std::is_same<Attribute, T>::value>::type>
881 auto castFn = [](
Attribute attr) {
return attr.template cast<T>(); };
882 return llvm::map_range(getAttributeValues(),
889 template <
typename T,
typename =
typename std::enable_if<
890 std::is_same<T, bool>::value>::type>
892 return getBoolValues();
898 template <
typename T,
typename =
typename std::enable_if<
899 std::is_same<T, APInt>::value>::type>
901 return getIntValues();
909 template <
typename T,
typename =
typename std::enable_if<
910 std::is_same<T, APFloat>::value>::type>
912 return getFloatValues();
936 mapValues(
Type newElementType,
966 int64_t dataEltSize,
bool isInt);
971 bool isValidIntOrFloat(int64_t dataEltSize,
bool isInt)
const;
980 using DenseElementsAttr::DenseElementsAttr;
984 template <
typename Arg>
987 .template cast<DenseFPElementsAttr>();
989 template <
typename T>
991 const std::initializer_list<T> &list) {
993 .template cast<DenseFPElementsAttr>();
999 mapValues(
Type newElementType,
1018 using DenseElementsAttr::DenseElementsAttr;
1022 template <
typename Arg>
1025 .template cast<DenseIntElementsAttr>();
1027 template <
typename T>
1029 const std::initializer_list<T> &list) {
1031 .template cast<DenseIntElementsAttr>();
1054 detail::OpaqueElementsAttributeStorage> {
1062 StringRef getValue()
const;
1102 detail::SparseElementsAttributeStorage> {
1106 template <
typename T>
1108 llvm::mapped_iterator<llvm::detail::value_sequence_iterator<ptrdiff_t>,
1109 std::function<T(ptrdiff_t)>>;
1122 auto zeroValue = getZeroValue<T>();
1123 auto valueIt = getValues().getValues<T>().begin();
1124 const std::vector<ptrdiff_t> flatSparseIndices(getFlattenedSparseIndices());
1127 std::function<T(ptrdiff_t)> mapFn = [=](ptrdiff_t index) {
1129 for (
unsigned i = 0, e = flatSparseIndices.size(); i != e; ++i)
1130 if (flatSparseIndices[i] == index)
1131 return *std::next(valueIt, i);
1135 return llvm::map_range(llvm::seq<ptrdiff_t>(0, getNumElements()), mapFn);
1149 APFloat getZeroAPFloat()
const;
1152 APInt getZeroAPInt()
const;
1160 template <
typename T>
1161 typename std::enable_if<std::is_base_of<Attribute, T>::value, T>::type
1162 getZeroValue()
const {
1163 return getZeroAttr().template cast<T>();
1166 template <
typename T>
1167 typename std::enable_if<std::is_same<APInt, T>::value, T>::type
1168 getZeroValue()
const {
1169 return getZeroAPInt();
1172 template <
typename T>
1173 typename std::enable_if<std::is_same<APFloat, T>::value, T>::type
1174 getZeroValue()
const {
1175 return getZeroAPFloat();
1178 template <
typename T>
1179 typename std::enable_if<std::numeric_limits<T>::is_integer ||
1180 llvm::is_one_of<T, float, double>::value,
1182 getZeroValue()
const {
1188 std::vector<ptrdiff_t> getFlattenedSparseIndices()
const;
1195 using DenseElementsAttr::DenseElementsAttr;
1200 return denseAttr && denseAttr.
isSplat();
1207 template <
typename T>
1208 class ElementsAttrIterator
1209 :
public llvm::iterator_facade_base<ElementsAttrIterator<T>,
1210 std::random_access_iterator_tag, T,
1211 std::ptrdiff_t, T, T> {
1214 using DenseIteratorT =
typename std::enable_if<
1216 decltype(std::declval<DenseElementsAttr>().getValues<T>().begin())>::type;
1221 Iterator(DenseIteratorT &&it) : denseIt(std::move(it)) {}
1222 Iterator(SparseIteratorT &&it) : sparseIt(std::move(it)) {}
1226 operator const DenseIteratorT &()
const {
return denseIt; }
1227 operator const SparseIteratorT &()
const {
return sparseIt; }
1228 operator DenseIteratorT &() {
return denseIt; }
1229 operator SparseIteratorT &() {
return sparseIt; }
1232 DenseIteratorT denseIt;
1234 SparseIteratorT sparseIt;
1239 template <
typename RetT,
template <
typename>
class ProcessFn,
1241 RetT process(Args &... args)
const {
1244 return ProcessFn<DenseIteratorT>()(args...);
1246 return ProcessFn<SparseIteratorT>()(args...);
1248 llvm_unreachable(
"unexpected attribute kind");
1252 template <
typename ItT>
struct PlusAssign {
1253 void operator()(ItT &it, ptrdiff_t offset) { it += offset; }
1255 template <
typename ItT>
struct Minus {
1256 ptrdiff_t operator()(
const ItT &lhs,
const ItT &rhs) {
return lhs - rhs; }
1258 template <
typename ItT>
struct MinusAssign {
1259 void operator()(ItT &it, ptrdiff_t offset) { it -= offset; }
1261 template <
typename ItT>
struct Dereference {
1262 T operator()(ItT &it) {
return *it; }
1264 template <
typename ItT>
struct ConstructIter {
1265 void operator()(ItT &dest,
const ItT &it) { ::new (&dest) ItT(it); }
1267 template <
typename ItT>
struct DestructIter {
1268 void operator()(ItT &it) { it.~ItT(); }
1273 : attrKind(rhs.attrKind) {
1274 process<void, ConstructIter>(it, rhs.it);
1280 assert(attrKind == rhs.attrKind &&
"incompatible iterators");
1281 return process<ptrdiff_t, Minus>(it, rhs.it);
1284 return rhs.attrKind == attrKind && process<bool, std::equal_to>(it, rhs.it);
1286 bool operator<(const ElementsAttrIterator<T> &rhs)
const {
1287 assert(attrKind == rhs.attrKind &&
"incompatible iterators");
1288 return process<bool, std::less>(it, rhs.it);
1291 process<void, PlusAssign>(it, offset);
1295 process<void, MinusAssign>(it, offset);
1303 template <
typename IteratorT>
1305 : attrKind(attrKind), it(std::forward<IteratorT>(it)) {}
1317 template <
typename T>
1324 template <
typename T>
1332 auto values = sparseAttr.getValues<T>();
1336 llvm_unreachable(
"unexpected attribute kind");
1344 assert(impl &&
"isa<> used on a null attribute.");
1345 return U::classof(*
this);
1348 return isa<U>() ? U(impl) : U(
nullptr);
1351 return (impl && isa<U>()) ? U(impl) : U(
nullptr);
1377 : attrs((attrs && !attrs.empty()) ? attrs : nullptr) {}
1381 return !(*
this == other);
1384 return attrs == other.attrs;
1423 return mlir::Attribute(static_cast<mlir::Attribute::ImplType *>(pointer));
1427 return mlir::Attribute(static_cast<mlir::Attribute::ImplType *>(pointer));
1438 template <>
struct PointerLikeTypeTraits<
mlir::Attribute> {
1445 enum { NumLowBitsAvailable = 3 };
1449 struct PointerLikeTypeTraits<
mlir::SymbolRefAttr>
1450 :
public PointerLikeTypeTraits<mlir::Attribute> {
1452 return PointerLikeTypeTraits<mlir::Attribute>::getFromVoidPointer(ptr)
Definition: Attributes.h:456
Definition: InferTypeOpInterface.cpp:20
Definition: Attributes.h:1052
static void * getAsVoidPointer(mlir::Attribute attr)
Definition: Attributes.h:1439
Definition: Attributes.h:976
U cast() const
Definition: Attributes.h:1353
Definition: Attributes.h:130
U dyn_cast_or_null() const
Definition: Attributes.h:1350
Elements Attributes.
Definition: Attributes.h:143
Definition: PassRegistry.cpp:413
static bool classof(Attribute attr)
Method for support type inquiry through isa, cast and dyn_cast.
Definition: Attributes.h:1198
Definition: Attributes.h:139
static const char * getFromVoidPointer(const void *ptr)
Definition: Attributes.h:620
Definition: Attributes.h:519
Definition: Attributes.h:129
Definition: Attributes.h:491
StringRef ValueType
Definition: Attributes.h:432
const void * getAsOpaquePointer() const
Get an opaque pointer to the attribute.
Definition: Attributes.h:110
A utility iterator that allows walking over the internal raw APInt values.
Definition: Attributes.h:780
static bool classof(Attribute attr)
Methods for support type inquiry through isa, cast, and dyn_cast.
Definition: Attributes.h:505
static bool classof(Attribute)
Definition: Attributes.h:91
llvm::ArrayRef< Attribute >::iterator iterator
Support range iteration.
Definition: Attributes.h:209
bool isa() const
Definition: Attributes.h:1343
T getValue(ArrayRef< uint64_t > index) const
Definition: Attributes.h:575
static DenseElementsAttr get(ShapedType type, ArrayRef< Attribute > values)
Definition: Attributes.cpp:572
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.
Definition: Attributes.h:834
Definition: Identifier.h:26
iterator_range< T > getValues() const
static mlir::SymbolRefAttr getFromVoidPointer(void *ptr)
Definition: Attributes.h:1451
Definition: Attributes.h:269
llvm::iterator_range< BoolElementIterator > getValues() const
Definition: Attributes.h:891
static bool kindof(unsigned kind)
Methods for support type inquiry through isa, cast, and dyn_cast.
Definition: Attributes.h:187
Definition: Attributes.h:198
iterator end() const
Definition: Attributes.h:211
APFloat reference
Definition: Attributes.h:807
ElementsAttrIterator(const ElementsAttrIterator< T > &rhs)
Definition: Attributes.h:1272
~ElementsAttrIterator()
Definition: Attributes.h:1276
bool operator==(const ElementsAttrIterator< T > &rhs) const
Definition: Attributes.h:1283
llvm::iterator_range< ElementIterator< T > > getValues() const
Definition: Attributes.h:854
Definition: Attributes.h:131
llvm::iterator_range< DerivedAttributeElementIterator< T > > getValues() const
Definition: Attributes.h:880
Definition: StandardTypes.h:178
Definition: Attributes.h:132
Definition: Location.h:52
iterator begin() const
Iterator access to the float element values.
Definition: Attributes.h:1003
std::pair< Identifier, Attribute > NamedAttribute
Definition: Attributes.h:264
A utility iterator that allows walking over the internal bool values.
Definition: Attributes.h:765
static bool kindof(unsigned kind)
Method for support type inquiry through isa, cast and dyn_cast.
Definition: Attributes.h:1077
static mlir::Attribute getTombstoneKey()
Definition: Attributes.h:1425
APFloat ValueType
Definition: Attributes.h:306
llvm::iterator_range< AttributeElementIterator > getValues() const
Definition: Attributes.h:866
Definition: Attributes.h:553
Definition: LogicalResult.h:18
static bool classof(Attribute attr)
Method for support type inquiry through isa, cast and dyn_cast.
Definition: Attributes.h:667
Definition: Attributes.h:153
NamedAttributeList(DictionaryAttr attrs=nullptr)
Definition: Attributes.h:1376
bool operator!=(const NamedAttributeList &other) const
Definition: Attributes.h:1380
iterator end() const
Definition: Attributes.h:1041
size_t size() const
Definition: Attributes.h:212
Definition: Attributes.h:155
Definition: Attributes.h:660
ElementsAttrIterator< T > & operator+=(ptrdiff_t offset)
Definition: Attributes.h:1290
DictionaryAttr getDictionary() const
Definition: Attributes.h:1389
llvm::mapped_iterator< llvm::detail::value_sequence_iterator< ptrdiff_t >, std::function< T(ptrdiff_t)> > iterator
Definition: Attributes.h:1109
Definition: Attributes.h:166
StringRef ValueType
Definition: Attributes.h:1057
Definition: Attributes.h:53
Definition: Attributes.h:243
ptrdiff_t getDataIndex() const
Definition: Attributes.h:648
Attribute(const ImplType *impl)
Definition: Attributes.h:73
Iterator for walking over APFloat values.
Definition: Attributes.h:798
IntElementIterator raw_int_begin() const
Get iterators to the raw APInt values for each element in this attribute.
Definition: Attributes.h:944
static bool classof(Attribute attr)
Method for support type inquiry through isa, cast and dyn_cast.
Definition: Attributes.h:603
IntElementIterator raw_int_end() const
Definition: Attributes.h:947
Definition: Attributes.h:133
Definition: Attributes.h:343
Definition: Attributes.h:617
Definition: Attributes.h:428
llvm::PointerIntPair< const char *, 1, bool, DenseElementDataPointerTypeTraits > DenseIterPtrAndSplat
Pair of raw pointer and a boolean flag of whether the pointer holds a splat,.
Definition: Attributes.h:631
StringRef getValue() const
Returns the name of the held symbol reference.
Definition: Attributes.h:502
ArrayRef< FlatSymbolRefAttr > getNestedReferences() const
Definition: Attributes.cpp:259
Definition: Attributes.h:152
Definition: AffineMap.h:37
Definition: Attributes.h:1374
bool operator==(Attribute other) const
Definition: Attributes.h:79
static bool kindof(unsigned kind)
Method for support type inquiry through isa, cast and dyn_cast.
Definition: Attributes.h:1143
llvm::iterator_range< iterator< T > > getValues() const
Definition: Attributes.h:1121
Attribute()
Definition: Attributes.h:72
Definition: STLExtras.h:145
static bool kindof(unsigned kind)
Methods for support type inquiry through isa, cast, and dyn_cast.
Definition: Attributes.h:530
static bool kindof(unsigned kind)
Methods for support type inquiry through isa, cast, and dyn_cast.
Definition: Attributes.h:443
const char * getData() const
Return the data base pointer.
Definition: Attributes.h:654
void print(raw_ostream &os) const
Print the attribute.
Definition: AsmPrinter.cpp:2061
Attribute getValue(ArrayRef< uint64_t > index) const
Definition: Attributes.h:840
Definition: Attributes.h:391
Definition: Attributes.h:146
iterator end() const
Definition: Attributes.h:1004
void ValueType
Definition: Attributes.h:70
Definition: Attributes.h:136
Definition: Attributes.h:1193
static bool kindof(unsigned kind)
Methods for support type inquiry through isa, cast, and dyn_cast.
Definition: Attributes.h:215
T operator*()
Dereference the iterator at the current index.
Definition: Attributes.h:1300
static bool kindof(unsigned kind)
Methods for support type inquiry through isa, cast, and dyn_cast.
Definition: Attributes.h:326
inline ::llvm::hash_code hash_value(AffineExpr arg)
Make AffineExpr hashable.
Definition: AffineExpr.h:201
Definition: Attributes.h:137
Definition: Attributes.h:302
static bool kindof(unsigned kind)
Definition: Attributes.h:545
Definition: Attributes.h:175
static mlir::Attribute getEmptyKey()
Definition: Attributes.h:1421
bool operator!=(Attribute other) const
Definition: Attributes.h:80
Kind
Integer identifier for all the concrete attribute kinds.
Definition: Attributes.h:56
Definition: Attributes.h:154
static FlatSymbolRefAttr get(StringRef value, MLIRContext *ctx)
Construct a symbol reference for the given value name.
Definition: Attributes.cpp:241
static bool kindof(unsigned kind)
Definition: Attributes.h:419
inline ::llvm::hash_code hash_value(Attribute arg)
Definition: Attributes.h:1359
Definition: Attributes.h:367
bool operator==(const NamedAttributeList &other) const
Definition: Attributes.h:1383
Definition: Attributes.h:140
bool operator!() const
Definition: Attributes.h:83
U dyn_cast() const
Definition: Attributes.h:1347
Definition: Attributes.h:167
Definition: Attributes.h:138
Definition: Attributes.h:147
Definition: Attributes.h:746
Definition: StorageUniquerSupport.h:30
const T & operator*() const
Accesses the raw value at this iterator position.
Definition: Attributes.h:751
ptrdiff_t operator-(const ElementsAttrIterator< T > &rhs) const
Methods necessary to support random access iteration.
Definition: Attributes.h:1279
Definition: MLIRContext.h:34
static bool kindof(unsigned kind)
Methods for support type inquiry through isa, cast, and dyn_cast.
Definition: Attributes.h:379
void print(OpAsmPrinter &p, AffineIfOp op)
Definition: AffineOps.cpp:1671
llvm::mapped_iterator< AttributeElementIterator, T(*)(Attribute)> DerivedAttributeElementIterator
Definition: Attributes.h:876
APInt ValueType
Definition: Attributes.h:348
T getValue(ArrayRef< uint64_t > index) const
Definition: Attributes.h:843
llvm::iterator_range< FloatElementIterator > getValues() const
Definition: Attributes.h:911
static bool isEqual(mlir::Attribute LHS, mlir::Attribute RHS)
Definition: Attributes.h:1432
Definition: AttributeSupport.h:34
llvm::ArrayRef< NamedAttribute >::iterator iterator
Support range iteration.
Definition: Attributes.h:286
Definition: Attributes.h:554
llvm::iterator_range< attr_value_iterator< AttrTy > > getAsRange()
Definition: Attributes.h:233
RemoveResult
Definition: Attributes.h:1405
bool empty() const
Definition: Attributes.h:289
static const void * getAsVoidPointer(const char *ptr)
Definition: Attributes.h:619
ImplType * impl
Definition: Attributes.h:119
static bool kindof(unsigned kind)
Methods for supporting type inquiry through isa, cast, and dyn_cast.
Definition: Attributes.h:293
static bool kindof(unsigned kind)
Methods for support type inquiry through isa, cast, and dyn_cast.
Definition: Attributes.h:358
static bool kindof(unsigned kind)
Methods for support type inquiry through isa, cast, and dyn_cast.
Definition: Attributes.h:484
bool ValueType
Definition: Attributes.h:247
static unsigned getHashValue(mlir::Attribute val)
Definition: Attributes.h:1429
raw_ostream & operator<<(raw_ostream &os, SubViewOp::Range &range)
Definition: Ops.cpp:2759
Definition: Attributes.h:539
Attribute getSplatValue() const
Definition: Attributes.h:820
llvm::iterator_range< IntElementIterator > getValues() const
Definition: Attributes.h:900
AffineExpr operator*(int64_t val, AffineExpr expr)
Definition: AffineExpr.h:206
iterator begin() const
Definition: Attributes.h:210
Definition: Attributes.h:144
Definition: Attributes.h:145
bool isSplat() const
Definition: Attributes.cpp:715
StringRef ValueType
Definition: Attributes.h:494
Definition: Attributes.h:559
Definition: Attributes.h:637
std::enable_if<!std::is_base_of< Attribute, T >::value||std::is_same< Attribute, T >::value, T >::type getSplatValue() const
Definition: Attributes.h:825
Definition: Attributes.h:728
Kind
Definition: Attributes.h:128
static mlir::Attribute getFromVoidPointer(void *ptr)
Definition: Attributes.h:1442
iterator begin() const
Iterator access to the integer element values.
Definition: Attributes.h:1040
static Attribute getFromOpaquePointer(const void *ptr)
Construct an attribute from the opaque pointer representation.
Definition: Attributes.h:112
Definition: Attributes.h:151
Definition: Attributes.h:135
unsigned getKind() const
Return the classification for this attribute.
Definition: Attributes.h:94
Locations.
Definition: Attributes.h:150
ElementsAttrIterator< T > & operator-=(ptrdiff_t offset)
Definition: Attributes.h:1294
Definition: Attributes.h:1100
Definition: Attributes.h:134
static bool kindof(unsigned kind)
Methods for support type inquiry through isa, cast, and dyn_cast.
Definition: Attributes.h:254
DenseElementIndexedIteratorImpl(const char *data, bool isSplat, size_t dataIndex)
Definition: Attributes.h:641
Definition: Attributes.h:1012
Definition: IntegerSet.h:42
Definition: AttributeSupport.h:89