LLZK 3.0.0
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
Ops.h.inc
Go to the documentation of this file.
1/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2|* *|
3|* Op Declarations *|
4|* *|
5|* Automatically generated file, do not edit! *|
6|* From: Ops.td *|
7|* *|
8\*===----------------------------------------------------------------------===*/
9
10namespace llzk::global {
11
31class GlobalDefOp;
32
33} // namespace llzk::global
34namespace llzk::global {
35
40class GlobalReadOp;
41
42} // namespace llzk::global
43namespace llzk::global {
44
49class GlobalWriteOp;
50
51} // namespace llzk::global
52#ifdef GET_OP_CLASSES
53#undef GET_OP_CLASSES
54
55namespace llzk::global {
56
57
58//===----------------------------------------------------------------------===//
59// ::llzk::global::GlobalDefOp declarations
60//===----------------------------------------------------------------------===//
61
62namespace detail {
63
65public:
66 struct Properties {
67 using constantTy = ::mlir::UnitAttr;
69
70 auto getConstant() const {
71 auto &propStorage = this->constant;
72 return ::llvm::dyn_cast_or_null<::mlir::UnitAttr>(propStorage);
73 }
74 void setConstant(const ::mlir::UnitAttr &propValue) {
75 this->constant = propValue;
76 }
77 using initial_valueTy = ::mlir::Attribute;
79
80 auto getInitialValue() const {
81 auto &propStorage = this->initial_value;
82 return ::llvm::dyn_cast_or_null<::mlir::Attribute>(propStorage);
83 }
84 void setInitialValue(const ::mlir::Attribute &propValue) {
85 this->initial_value = propValue;
86 }
87 using sym_nameTy = ::mlir::StringAttr;
89
90 auto getSymName() const {
91 auto &propStorage = this->sym_name;
92 return ::llvm::cast<::mlir::StringAttr>(propStorage);
93 }
94 void setSymName(const ::mlir::StringAttr &propValue) {
95 this->sym_name = propValue;
96 }
97 using typeTy = ::mlir::TypeAttr;
99
100 auto getType() const {
101 auto &propStorage = this->type;
102 return ::llvm::cast<::mlir::TypeAttr>(propStorage);
103 }
104 void setType(const ::mlir::TypeAttr &propValue) {
105 this->type = propValue;
106 }
107 bool operator==(const Properties &rhs) const {
108 return
109 rhs.constant == this->constant &&
110 rhs.initial_value == this->initial_value &&
111 rhs.sym_name == this->sym_name &&
112 rhs.type == this->type &&
113 true;
114 }
115 bool operator!=(const Properties &rhs) const {
116 return !(*this == rhs);
117 }
118 };
119protected:
120 ::mlir::DictionaryAttr odsAttrs;
121 ::std::optional<::mlir::OperationName> odsOpName;
123 ::mlir::RegionRange odsRegions;
124public:
125 GlobalDefOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
126 odsOpName.emplace("global.def", odsAttrs.getContext());
127 }
128
130
131 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
132 return {index, 1};
133 }
134
136 return properties;
137 }
138
139 ::mlir::DictionaryAttr getAttributes() {
140 return odsAttrs;
141 }
142
143 ::mlir::StringAttr getSymNameAttr() {
144 auto attr = ::llvm::cast<::mlir::StringAttr>(getProperties().sym_name);
145 return attr;
146 }
147
148 ::llvm::StringRef getSymName();
149 ::mlir::UnitAttr getConstantAttr();
150 bool getConstant();
151 ::mlir::TypeAttr getTypeAttr() {
152 auto attr = ::llvm::cast<::mlir::TypeAttr>(getProperties().type);
153 return attr;
154 }
155
156 ::mlir::Type getType();
157 ::mlir::Attribute getInitialValueAttr();
158 ::mlir::Attribute getInitialValue();
159};
160
161} // namespace detail
162template <typename RangeT>
164 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
166public:
167 GlobalDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
168
169 GlobalDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : GlobalDefOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
170
171 GlobalDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : GlobalDefOpGenericAdaptor(values, attrs, Properties{}, {}) {}
172
173 GlobalDefOpGenericAdaptor(RangeT values, const GlobalDefOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {}
174
175 template <typename LateInst = GlobalDefOp, typename = std::enable_if_t<std::is_same_v<LateInst, GlobalDefOp>>>
176 GlobalDefOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
177
178 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
179 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
180 }
181
182 RangeT getODSOperands(unsigned index) {
183 auto valueRange = getODSOperandIndexAndLength(index);
184 return {std::next(odsOperands.begin(), valueRange.first),
185 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
186 }
187
188 RangeT getOperands() {
189 return odsOperands;
190 }
191
192private:
193 RangeT odsOperands;
194};
195class GlobalDefOpAdaptor : public GlobalDefOpGenericAdaptor<::mlir::ValueRange> {
196public:
199
200 ::llvm::LogicalResult verify(::mlir::Location loc);
201};
202class GlobalDefOp : public ::mlir::Op<GlobalDefOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::ZeroResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::ZeroOperands, ::mlir::OpTrait::HasParent<mlir::ModuleOp>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::SymbolUserOpInterface::Trait, ::mlir::SymbolOpInterface::Trait> {
203public:
204 using Op::Op;
205 using Op::print;
207 template <typename RangeT>
211 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
212 static ::llvm::StringRef attrNames[] = {::llvm::StringRef("constant"), ::llvm::StringRef("initial_value"), ::llvm::StringRef("sym_name"), ::llvm::StringRef("type")};
213 return ::llvm::ArrayRef(attrNames);
214 }
215
216 ::mlir::StringAttr getConstantAttrName() {
217 return getAttributeNameForIndex(0);
218 }
219
220 static ::mlir::StringAttr getConstantAttrName(::mlir::OperationName name) {
221 return getAttributeNameForIndex(name, 0);
222 }
223
224 ::mlir::StringAttr getInitialValueAttrName() {
225 return getAttributeNameForIndex(1);
226 }
227
228 static ::mlir::StringAttr getInitialValueAttrName(::mlir::OperationName name) {
229 return getAttributeNameForIndex(name, 1);
230 }
231
232 ::mlir::StringAttr getSymNameAttrName() {
233 return getAttributeNameForIndex(2);
234 }
235
236 static ::mlir::StringAttr getSymNameAttrName(::mlir::OperationName name) {
237 return getAttributeNameForIndex(name, 2);
238 }
239
240 ::mlir::StringAttr getTypeAttrName() {
241 return getAttributeNameForIndex(3);
242 }
243
244 static ::mlir::StringAttr getTypeAttrName(::mlir::OperationName name) {
245 return getAttributeNameForIndex(name, 3);
246 }
247
248 static constexpr ::llvm::StringLiteral getOperationName() {
249 return ::llvm::StringLiteral("global.def");
250 }
251
252 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
253 return {index, 1};
254 }
255
256 ::mlir::Operation::operand_range getODSOperands(unsigned index) {
257 auto valueRange = getODSOperandIndexAndLength(index);
258 return {std::next(getOperation()->operand_begin(), valueRange.first),
259 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
260 }
261
262 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) {
263 return {index, 1};
264 }
265
266 ::mlir::Operation::result_range getODSResults(unsigned index) {
267 auto valueRange = getODSResultIndexAndLength(index);
268 return {std::next(getOperation()->result_begin(), valueRange.first),
269 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
270 }
271
272 static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
273 static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
274 static llvm::hash_code computePropertiesHash(const Properties &prop);
275 static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
276 static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
277 static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
278 static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
279 static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
280 void writeProperties(::mlir::DialectBytecodeWriter &writer);
281 ::mlir::StringAttr getSymNameAttr() {
282 return ::llvm::cast<::mlir::StringAttr>(getProperties().sym_name);
283 }
284
285 ::llvm::StringRef getSymName();
286 ::mlir::UnitAttr getConstantAttr() {
287 return ::llvm::dyn_cast_or_null<::mlir::UnitAttr>(getProperties().constant);
288 }
289
290 bool getConstant();
291 ::mlir::TypeAttr getTypeAttr() {
292 return ::llvm::cast<::mlir::TypeAttr>(getProperties().type);
293 }
294
295 ::mlir::Type getType();
296 ::mlir::Attribute getInitialValueAttr() {
297 return ::llvm::dyn_cast_or_null<::mlir::Attribute>(getProperties().initial_value);
298 }
299
300 ::mlir::Attribute getInitialValue();
301 void setSymNameAttr(::mlir::StringAttr attr) {
302 getProperties().sym_name = attr;
303 }
304
305 void setSymName(::llvm::StringRef attrValue);
306 void setConstantAttr(::mlir::UnitAttr attr) {
307 getProperties().constant = attr;
308 }
309
310 void setConstant(bool attrValue);
311 void setTypeAttr(::mlir::TypeAttr attr) {
312 getProperties().type = attr;
313 }
314
315 void setType(::mlir::Type attrValue);
316 void setInitialValueAttr(::mlir::Attribute attr) {
317 getProperties().initial_value = attr;
318 }
319
320 ::mlir::Attribute removeConstantAttr() {
321 auto attr = getProperties().constant;
322 getProperties().constant = {};
323 return attr;
324 }
325
326 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name, /*optional*/::mlir::UnitAttr constant, ::mlir::TypeAttr type, ::mlir::Attribute initial_value = nullptr);
327 static GlobalDefOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::StringAttr sym_name, /*optional*/::mlir::UnitAttr constant, ::mlir::TypeAttr type, ::mlir::Attribute initial_value = nullptr);
328 static GlobalDefOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::StringAttr sym_name, /*optional*/::mlir::UnitAttr constant, ::mlir::TypeAttr type, ::mlir::Attribute initial_value = nullptr);
329 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::StringAttr sym_name, /*optional*/::mlir::UnitAttr constant, ::mlir::TypeAttr type, ::mlir::Attribute initial_value = nullptr);
330 static GlobalDefOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::StringAttr sym_name, /*optional*/::mlir::UnitAttr constant, ::mlir::TypeAttr type, ::mlir::Attribute initial_value = nullptr);
331 static GlobalDefOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::StringAttr sym_name, /*optional*/::mlir::UnitAttr constant, ::mlir::TypeAttr type, ::mlir::Attribute initial_value = nullptr);
332 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llvm::StringRef sym_name, /*optional*/bool constant, ::mlir::Type type, ::mlir::Attribute initial_value);
333 static GlobalDefOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::llvm::StringRef sym_name, /*optional*/bool constant, ::mlir::Type type, ::mlir::Attribute initial_value);
334 static GlobalDefOp create(::mlir::ImplicitLocOpBuilder &builder, ::llvm::StringRef sym_name, /*optional*/bool constant, ::mlir::Type type, ::mlir::Attribute initial_value);
335 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef sym_name, /*optional*/bool constant, ::mlir::Type type, ::mlir::Attribute initial_value);
336 static GlobalDefOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::llvm::StringRef sym_name, /*optional*/bool constant, ::mlir::Type type, ::mlir::Attribute initial_value);
337 static GlobalDefOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::llvm::StringRef sym_name, /*optional*/bool constant, ::mlir::Type type, ::mlir::Attribute initial_value);
338 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
339 static GlobalDefOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
340 static GlobalDefOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
341 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {});
342 static GlobalDefOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {});
343 static GlobalDefOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {});
344 static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties);
345 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
346 void print(::mlir::OpAsmPrinter &p);
347 ::llvm::LogicalResult verifyInvariantsImpl();
348 ::llvm::LogicalResult verifyInvariants();
349 ::llvm::LogicalResult verify();
350 ::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable);
351 static ::llvm::LogicalResult setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
352private:
353 ::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
354 return getAttributeNameForIndex((*this)->getName(), index);
355 }
356
357 static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
358 assert(index < 4 && "invalid attribute index");
359 assert(name.getStringRef() == getOperationName() && "invalid operation name");
360 assert(name.isRegistered() && "Operation isn't registered, missing a "
361 "dependent dialect loading?");
362 return name.getAttributeNames()[index];
363 }
364
365public:
367 inline bool isConstant() { return getConstant(); }
368};
369
370} // namespace llzk::global
371MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::global::GlobalDefOp)
373
374namespace llzk::global {
375
376
377//===----------------------------------------------------------------------===//
378// ::llzk::global::GlobalReadOp declarations
379//===----------------------------------------------------------------------===//
380
381namespace detail {
382
384public:
385 struct Properties {
386 using constantTy = ::mlir::UnitAttr;
388
389 auto getConstant() const {
390 auto &propStorage = this->constant;
391 return ::llvm::dyn_cast_or_null<::mlir::UnitAttr>(propStorage);
392 }
393 void setConstant(const ::mlir::UnitAttr &propValue) {
394 this->constant = propValue;
395 }
396 using name_refTy = ::mlir::SymbolRefAttr;
398
399 auto getNameRef() const {
400 auto &propStorage = this->name_ref;
401 return ::llvm::cast<::mlir::SymbolRefAttr>(propStorage);
402 }
403 void setNameRef(const ::mlir::SymbolRefAttr &propValue) {
404 this->name_ref = propValue;
405 }
406 bool operator==(const Properties &rhs) const {
407 return
408 rhs.constant == this->constant &&
409 rhs.name_ref == this->name_ref &&
410 true;
411 }
412 bool operator!=(const Properties &rhs) const {
413 return !(*this == rhs);
414 }
415 };
416protected:
417 ::mlir::DictionaryAttr odsAttrs;
418 ::std::optional<::mlir::OperationName> odsOpName;
420 ::mlir::RegionRange odsRegions;
421public:
422 GlobalReadOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
423 odsOpName.emplace("global.read", odsAttrs.getContext());
424 }
425
427
428 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
429 return {index, 1};
430 }
431
433 return properties;
434 }
435
436 ::mlir::DictionaryAttr getAttributes() {
437 return odsAttrs;
438 }
439
440 ::mlir::UnitAttr getConstantAttr();
441 bool getConstant();
442 ::mlir::SymbolRefAttr getNameRefAttr() {
443 auto attr = ::llvm::cast<::mlir::SymbolRefAttr>(getProperties().name_ref);
444 return attr;
445 }
446
447 ::mlir::SymbolRefAttr getNameRef();
448};
449
450} // namespace detail
451template <typename RangeT>
453 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
455public:
456 GlobalReadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
457
458 GlobalReadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : GlobalReadOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
459
460 GlobalReadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : GlobalReadOpGenericAdaptor(values, attrs, Properties{}, {}) {}
461
462 GlobalReadOpGenericAdaptor(RangeT values, const GlobalReadOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {}
463
464 template <typename LateInst = GlobalReadOp, typename = std::enable_if_t<std::is_same_v<LateInst, GlobalReadOp>>>
465 GlobalReadOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
466
467 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
468 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
469 }
470
471 RangeT getODSOperands(unsigned index) {
472 auto valueRange = getODSOperandIndexAndLength(index);
473 return {std::next(odsOperands.begin(), valueRange.first),
474 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
475 }
476
477 RangeT getOperands() {
478 return odsOperands;
479 }
480
481private:
482 RangeT odsOperands;
483};
484class GlobalReadOpAdaptor : public GlobalReadOpGenericAdaptor<::mlir::ValueRange> {
485public:
488
489 ::llvm::LogicalResult verify(::mlir::Location loc);
490};
491class GlobalReadOp : public ::mlir::Op<GlobalReadOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::ZeroOperands, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::llzk::global::GlobalRefOpInterface::Trait, ::mlir::SymbolUserOpInterface::Trait> {
492public:
493 using Op::Op;
494 using Op::print;
496 template <typename RangeT>
500 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
501 static ::llvm::StringRef attrNames[] = {::llvm::StringRef("constant"), ::llvm::StringRef("name_ref")};
502 return ::llvm::ArrayRef(attrNames);
503 }
504
505 ::mlir::StringAttr getConstantAttrName() {
506 return getAttributeNameForIndex(0);
507 }
508
509 static ::mlir::StringAttr getConstantAttrName(::mlir::OperationName name) {
510 return getAttributeNameForIndex(name, 0);
511 }
512
513 ::mlir::StringAttr getNameRefAttrName() {
514 return getAttributeNameForIndex(1);
515 }
516
517 static ::mlir::StringAttr getNameRefAttrName(::mlir::OperationName name) {
518 return getAttributeNameForIndex(name, 1);
519 }
520
521 static constexpr ::llvm::StringLiteral getOperationName() {
522 return ::llvm::StringLiteral("global.read");
523 }
524
525 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
526 return {index, 1};
527 }
528
529 ::mlir::Operation::operand_range getODSOperands(unsigned index) {
530 auto valueRange = getODSOperandIndexAndLength(index);
531 return {std::next(getOperation()->operand_begin(), valueRange.first),
532 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
533 }
534
535 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) {
536 return {index, 1};
537 }
538
539 ::mlir::Operation::result_range getODSResults(unsigned index) {
540 auto valueRange = getODSResultIndexAndLength(index);
541 return {std::next(getOperation()->result_begin(), valueRange.first),
542 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
543 }
544
545 ::mlir::TypedValue<::mlir::Type> getVal() {
546 return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(*getODSResults(0).begin());
547 }
548
549 static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
550 static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
551 static llvm::hash_code computePropertiesHash(const Properties &prop);
552 static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
553 static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
554 static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
555 static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
556 static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
557 void writeProperties(::mlir::DialectBytecodeWriter &writer);
558 ::mlir::UnitAttr getConstantAttr() {
559 return ::llvm::dyn_cast_or_null<::mlir::UnitAttr>(getProperties().constant);
560 }
561
562 bool getConstant();
563 ::mlir::SymbolRefAttr getNameRefAttr() {
564 return ::llvm::cast<::mlir::SymbolRefAttr>(getProperties().name_ref);
565 }
566
567 ::mlir::SymbolRefAttr getNameRef();
568 void setConstantAttr(::mlir::UnitAttr attr) {
569 getProperties().constant = attr;
570 }
571
572 void setConstant(bool attrValue);
573 void setNameRefAttr(::mlir::SymbolRefAttr attr) {
574 getProperties().name_ref = attr;
575 }
576
577 ::mlir::Attribute removeConstantAttr() {
578 auto attr = getProperties().constant;
579 getProperties().constant = {};
580 return attr;
581 }
582
583 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type val, /*optional*/::mlir::UnitAttr constant, ::mlir::SymbolRefAttr name_ref);
584 static GlobalReadOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type val, /*optional*/::mlir::UnitAttr constant, ::mlir::SymbolRefAttr name_ref);
585 static GlobalReadOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type val, /*optional*/::mlir::UnitAttr constant, ::mlir::SymbolRefAttr name_ref);
586 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, /*optional*/::mlir::UnitAttr constant, ::mlir::SymbolRefAttr name_ref);
587 static GlobalReadOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, /*optional*/::mlir::UnitAttr constant, ::mlir::SymbolRefAttr name_ref);
588 static GlobalReadOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, /*optional*/::mlir::UnitAttr constant, ::mlir::SymbolRefAttr name_ref);
589 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type val, /*optional*/bool constant, ::mlir::SymbolRefAttr name_ref);
590 static GlobalReadOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type val, /*optional*/bool constant, ::mlir::SymbolRefAttr name_ref);
591 static GlobalReadOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type val, /*optional*/bool constant, ::mlir::SymbolRefAttr name_ref);
592 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, /*optional*/bool constant, ::mlir::SymbolRefAttr name_ref);
593 static GlobalReadOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, /*optional*/bool constant, ::mlir::SymbolRefAttr name_ref);
594 static GlobalReadOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, /*optional*/bool constant, ::mlir::SymbolRefAttr name_ref);
595 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
596 static GlobalReadOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
597 static GlobalReadOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
598 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {});
599 static GlobalReadOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {});
600 static GlobalReadOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {});
601 ::llvm::LogicalResult verifyInvariantsImpl();
602 ::llvm::LogicalResult verifyInvariants();
603 void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
604 ::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable);
605 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
606 void print(::mlir::OpAsmPrinter &_odsPrinter);
607private:
608 ::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
609 return getAttributeNameForIndex((*this)->getName(), index);
610 }
611
612 static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
613 assert(index < 2 && "invalid attribute index");
614 assert(name.getStringRef() == getOperationName() && "invalid operation name");
615 assert(name.isRegistered() && "Operation isn't registered, missing a "
616 "dependent dialect loading?");
617 return name.getAttributeNames()[index];
618 }
619
620public:
622 inline bool isConstant() { return getConstant(); }
623};
624
625} // namespace llzk::global
626MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::global::GlobalReadOp)
628
629namespace llzk::global {
630
631
632//===----------------------------------------------------------------------===//
633// ::llzk::global::GlobalWriteOp declarations
634//===----------------------------------------------------------------------===//
635
636namespace detail {
637
639public:
640 struct Properties {
641 using name_refTy = ::mlir::SymbolRefAttr;
643
644 auto getNameRef() const {
645 auto &propStorage = this->name_ref;
646 return ::llvm::cast<::mlir::SymbolRefAttr>(propStorage);
647 }
648 void setNameRef(const ::mlir::SymbolRefAttr &propValue) {
649 this->name_ref = propValue;
650 }
651 bool operator==(const Properties &rhs) const {
652 return
653 rhs.name_ref == this->name_ref &&
654 true;
655 }
656 bool operator!=(const Properties &rhs) const {
657 return !(*this == rhs);
658 }
659 };
660protected:
661 ::mlir::DictionaryAttr odsAttrs;
662 ::std::optional<::mlir::OperationName> odsOpName;
664 ::mlir::RegionRange odsRegions;
665public:
666 GlobalWriteOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
667 odsOpName.emplace("global.write", odsAttrs.getContext());
668 }
669
671
672 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
673 return {index, 1};
674 }
675
677 return properties;
678 }
679
680 ::mlir::DictionaryAttr getAttributes() {
681 return odsAttrs;
682 }
683
684 ::mlir::SymbolRefAttr getNameRefAttr() {
685 auto attr = ::llvm::cast<::mlir::SymbolRefAttr>(getProperties().name_ref);
686 return attr;
687 }
688
689 ::mlir::SymbolRefAttr getNameRef();
690};
691
692} // namespace detail
693template <typename RangeT>
695 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
697 static constexpr int odsIndex_val = 0;
698public:
699 GlobalWriteOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
700
701 GlobalWriteOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : GlobalWriteOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
702
703 GlobalWriteOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : GlobalWriteOpGenericAdaptor(values, attrs, Properties{}, {}) {}
704
705 GlobalWriteOpGenericAdaptor(RangeT values, const GlobalWriteOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {}
706
707 template <typename LateInst = GlobalWriteOp, typename = std::enable_if_t<std::is_same_v<LateInst, GlobalWriteOp>>>
708 GlobalWriteOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
709
710 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
711 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
712 }
713
714 RangeT getODSOperands(unsigned index) {
715 auto valueRange = getODSOperandIndexAndLength(index);
716 return {std::next(odsOperands.begin(), valueRange.first),
717 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
718 }
719
720 ValueT getVal() {
721 return (*getODSOperands(0).begin());
722 }
723
724 RangeT getOperands() {
725 return odsOperands;
726 }
727
728private:
729 RangeT odsOperands;
730};
731class GlobalWriteOpAdaptor : public GlobalWriteOpGenericAdaptor<::mlir::ValueRange> {
732public:
735
736 ::llvm::LogicalResult verify(::mlir::Location loc);
737};
738class GlobalWriteOp : public ::mlir::Op<GlobalWriteOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::ZeroResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::llzk::function::WitnessGen, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::llzk::global::GlobalRefOpInterface::Trait, ::mlir::SymbolUserOpInterface::Trait> {
739public:
740 using Op::Op;
741 using Op::print;
743 template <typename RangeT>
746 static constexpr int odsIndex_val = 0;
748 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
749 static ::llvm::StringRef attrNames[] = {::llvm::StringRef("name_ref")};
750 return ::llvm::ArrayRef(attrNames);
751 }
752
753 ::mlir::StringAttr getNameRefAttrName() {
754 return getAttributeNameForIndex(0);
755 }
756
757 static ::mlir::StringAttr getNameRefAttrName(::mlir::OperationName name) {
758 return getAttributeNameForIndex(name, 0);
759 }
760
761 static constexpr ::llvm::StringLiteral getOperationName() {
762 return ::llvm::StringLiteral("global.write");
763 }
764
765 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
766 return {index, 1};
767 }
768
769 ::mlir::Operation::operand_range getODSOperands(unsigned index) {
770 auto valueRange = getODSOperandIndexAndLength(index);
771 return {std::next(getOperation()->operand_begin(), valueRange.first),
772 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
773 }
774
775 ::mlir::TypedValue<::mlir::Type> getVal() {
776 return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(*getODSOperands(0).begin());
777 }
778
779 ::mlir::OpOperand &getValMutable() {
780 auto range = getODSOperandIndexAndLength(0);
781 return getOperation()->getOpOperand(range.first);
782 }
783
784 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) {
785 return {index, 1};
786 }
787
788 ::mlir::Operation::result_range getODSResults(unsigned index) {
789 auto valueRange = getODSResultIndexAndLength(index);
790 return {std::next(getOperation()->result_begin(), valueRange.first),
791 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
792 }
793
794 static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
795 static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
796 static llvm::hash_code computePropertiesHash(const Properties &prop);
797 static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
798 static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
799 static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
800 static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
801 static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
802 void writeProperties(::mlir::DialectBytecodeWriter &writer);
803 ::mlir::SymbolRefAttr getNameRefAttr() {
804 return ::llvm::cast<::mlir::SymbolRefAttr>(getProperties().name_ref);
805 }
806
807 ::mlir::SymbolRefAttr getNameRef();
808 void setNameRefAttr(::mlir::SymbolRefAttr attr) {
809 getProperties().name_ref = attr;
810 }
811
812 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::SymbolRefAttr name_ref, ::mlir::Value val);
813 static GlobalWriteOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::SymbolRefAttr name_ref, ::mlir::Value val);
814 static GlobalWriteOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::SymbolRefAttr name_ref, ::mlir::Value val);
815 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::SymbolRefAttr name_ref, ::mlir::Value val);
816 static GlobalWriteOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::SymbolRefAttr name_ref, ::mlir::Value val);
817 static GlobalWriteOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::SymbolRefAttr name_ref, ::mlir::Value val);
818 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
819 static GlobalWriteOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
820 static GlobalWriteOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
821 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {});
822 static GlobalWriteOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {});
823 static GlobalWriteOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {});
824 ::llvm::LogicalResult verifyInvariantsImpl();
825 ::llvm::LogicalResult verifyInvariants();
826 ::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable);
827 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
828 void print(::mlir::OpAsmPrinter &_odsPrinter);
829 void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
830private:
831 ::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
832 return getAttributeNameForIndex((*this)->getName(), index);
833 }
834
835 static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
836 assert(index < 1 && "invalid attribute index");
837 assert(name.getStringRef() == getOperationName() && "invalid operation name");
838 assert(name.isRegistered() && "Operation isn't registered, missing a "
839 "dependent dialect loading?");
840 return name.getAttributeNames()[index];
841 }
842
843public:
845 inline ::mlir::FailureOr<SymbolLookupResult<GlobalDefOp>> getGlobalDefOp(::mlir::SymbolTableCollection &tables) {
846 return ::llvm::cast<GlobalRefOpInterface>(getOperation()).getGlobalDefOp(tables);
847 }
848};
849
850} // namespace llzk::global
851MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::global::GlobalWriteOp)
853
854
855#endif // GET_OP_CLASSES
856
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:155
GlobalDefOpAdaptor(GlobalDefOp op)
Definition Ops.cpp.inc:153
GlobalDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:167
GlobalDefOpGenericAdaptor(RangeT values, const GlobalDefOpGenericAdaptorBase &base)
Definition Ops.h.inc:173
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:178
GlobalDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:169
RangeT getODSOperands(unsigned index)
Definition Ops.h.inc:182
GlobalDefOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:176
GlobalDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr)
Definition Ops.h.inc:171
GlobalDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:167
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:335
void setInitialValueAttr(::mlir::Attribute attr)
Definition Ops.h.inc:316
static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties)
Definition Ops.cpp.inc:569
GlobalDefOpAdaptor Adaptor
Definition Ops.h.inc:206
FoldAdaptor::Properties Properties
Definition Ops.h.inc:210
::mlir::Attribute getInitialValue()
Definition Ops.cpp.inc:405
void setType(::mlir::Type attrValue)
Definition Ops.cpp.inc:422
::mlir::StringAttr getSymNameAttrName(::mlir::OperationName name)
Definition Ops.h.inc:236
::mlir::Attribute removeConstantAttr()
Definition Ops.h.inc:320
::mlir::Type getType()
Definition Ops.cpp.inc:400
::mlir::StringAttr getConstantAttrName(::mlir::OperationName name)
Definition Ops.h.inc:220
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.h.inc:262
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:362
void setTypeAttr(::mlir::TypeAttr attr)
Definition Ops.h.inc:311
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:288
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:597
::mlir::TypeAttr getTypeAttr()
Definition Ops.h.inc:291
::llvm::StringRef getSymName()
Definition Ops.cpp.inc:388
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:252
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:209
::mlir::StringAttr getSymNameAttrName()
Definition Ops.h.inc:232
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp:208
::llvm::LogicalResult setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:603
static GlobalDefOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::StringAttr sym_name, ::mlir::UnitAttr constant, ::mlir::TypeAttr type, ::mlir::Attribute initial_value=nullptr)
Definition Ops.cpp.inc:437
bool isConstant()
Returns true when this def is marked as const.
Definition Ops.h.inc:367
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:242
::mlir::Attribute getInitialValueAttr()
Definition Ops.h.inc:296
::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable)
Definition Ops.cpp:280
GlobalDefOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:208
void print(::mlir::OpAsmPrinter &p)
Definition Ops.cpp:265
::mlir::StringAttr getSymNameAttr()
Definition Ops.h.inc:281
::mlir::StringAttr getInitialValueAttrName(::mlir::OperationName name)
Definition Ops.h.inc:228
::mlir::UnitAttr getConstantAttr()
Definition Ops.h.inc:286
void setSymName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:410
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:378
::mlir::StringAttr getTypeAttrName(::mlir::OperationName name)
Definition Ops.h.inc:244
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:575
::mlir::StringAttr getTypeAttrName()
Definition Ops.h.inc:240
void setConstant(bool attrValue)
Definition Ops.cpp.inc:414
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:177
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:248
void setConstantAttr(::mlir::UnitAttr attr)
Definition Ops.h.inc:306
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:325
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name, ::mlir::UnitAttr constant, ::mlir::TypeAttr type, ::mlir::Attribute initial_value=nullptr)
Definition Ops.cpp.inc:426
::mlir::StringAttr getInitialValueAttrName()
Definition Ops.h.inc:224
::llvm::LogicalResult verify()
Definition Ops.cpp:399
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:279
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:266
::mlir::StringAttr getConstantAttrName()
Definition Ops.h.inc:216
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
Definition Ops.h.inc:211
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:256
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:303
void setSymNameAttr(::mlir::StringAttr attr)
Definition Ops.h.inc:301
GlobalReadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:456
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:746
GlobalReadOpAdaptor(GlobalReadOp op)
Definition Ops.cpp.inc:744
GlobalReadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr)
Definition Ops.h.inc:460
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:467
GlobalReadOpGenericAdaptor(RangeT values, const GlobalReadOpGenericAdaptorBase &base)
Definition Ops.h.inc:462
GlobalReadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:456
RangeT getODSOperands(unsigned index)
Definition Ops.h.inc:471
GlobalReadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:458
GlobalReadOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:465
::mlir::StringAttr getNameRefAttrName()
Definition Ops.h.inc:513
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp:481
static GlobalReadOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type val, ::mlir::UnitAttr constant, ::mlir::SymbolRefAttr name_ref)
Definition Ops.cpp.inc:896
::mlir::UnitAttr getConstantAttr()
Definition Ops.h.inc:558
FoldAdaptor::Properties Properties
Definition Ops.h.inc:499
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:521
GlobalReadOpAdaptor Adaptor
Definition Ops.h.inc:495
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:796
GlobalReadOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:497
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:525
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type val, ::mlir::UnitAttr constant, ::mlir::SymbolRefAttr name_ref)
Definition Ops.cpp.inc:888
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:539
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1043
::mlir::Attribute removeConstantAttr()
Definition Ops.h.inc:577
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
Definition Ops.h.inc:500
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1080
::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable)
Definition Ops.cpp:441
::mlir::StringAttr getConstantAttrName(::mlir::OperationName name)
Definition Ops.h.inc:509
void setConstant(bool attrValue)
Definition Ops.cpp.inc:880
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp:487
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:819
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:498
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1047
bool isConstant()
Returns true when this read is marked as const.
Definition Ops.h.inc:622
::mlir::StringAttr getConstantAttrName()
Definition Ops.h.inc:505
void setConstantAttr(::mlir::UnitAttr attr)
Definition Ops.h.inc:568
::mlir::StringAttr getNameRefAttrName(::mlir::OperationName name)
Definition Ops.h.inc:517
void setNameRefAttr(::mlir::SymbolRefAttr attr)
Definition Ops.h.inc:573
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:826
::mlir::SymbolRefAttr getNameRefAttr()
Definition Ops.h.inc:563
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:835
::mlir::TypedValue<::mlir::Type > getVal()
Definition Ops.h.inc:545
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.h.inc:535
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp:466
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:759
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:853
::mlir::SymbolRefAttr getNameRef()
Definition Ops.cpp.inc:875
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:529
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:847
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1021
GlobalWriteOpAdaptor(GlobalWriteOp op)
Definition Ops.cpp.inc:1130
GlobalWriteOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:699
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:1132
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:710
GlobalWriteOpGenericAdaptor(RangeT values, const GlobalWriteOpGenericAdaptorBase &base)
Definition Ops.h.inc:705
GlobalWriteOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:699
RangeT getODSOperands(unsigned index)
Definition Ops.h.inc:714
GlobalWriteOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:701
GlobalWriteOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:708
GlobalWriteOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr)
Definition Ops.h.inc:703
::mlir::OpOperand & getValMutable()
Definition Ops.h.inc:779
::mlir::TypedValue<::mlir::Type > getVal()
Definition Ops.h.inc:775
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:1180
::mlir::StringAttr getNameRefAttrName()
Definition Ops.h.inc:753
::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable)
Definition Ops.cpp:495
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:761
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1338
::mlir::SymbolRefAttr getNameRefAttr()
Definition Ops.h.inc:803
static constexpr int odsIndex_val
Definition Ops.h.inc:746
::mlir::StringAttr getNameRefAttrName(::mlir::OperationName name)
Definition Ops.h.inc:757
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:769
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:1199
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1379
GlobalWriteOpAdaptor Adaptor
Definition Ops.h.inc:742
inline ::mlir::FailureOr< SymbolLookupResult< GlobalDefOp > > getGlobalDefOp(::mlir::SymbolTableCollection &tables)
Gets the definition for the global referenced in this op.
Definition Ops.h.inc:845
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:765
FoldAdaptor::Properties Properties
Definition Ops.h.inc:747
void setNameRefAttr(::mlir::SymbolRefAttr attr)
Definition Ops.h.inc:808
GlobalWriteOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:744
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1334
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:1399
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:1164
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1203
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:788
static GlobalWriteOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::SymbolRefAttr name_ref, ::mlir::Value val)
Definition Ops.cpp.inc:1234
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::SymbolRefAttr name_ref, ::mlir::Value val)
Definition Ops.cpp.inc:1229
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:745
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:1192
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.h.inc:784
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:1219
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:1186
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1316
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
Definition Ops.h.inc:748
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1141
::mlir::SymbolRefAttr getNameRef()
Definition Ops.cpp.inc:1224
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:1212
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.h.inc:131
GlobalDefOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:125
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:121
GlobalReadOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:422
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:418
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.h.inc:428
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.h.inc:672
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:662
GlobalWriteOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:666
Common interface for operations that read or write from a global.
void setInitialValue(const ::mlir::Attribute &propValue)
Definition Ops.h.inc:84
void setType(const ::mlir::TypeAttr &propValue)
Definition Ops.h.inc:104
void setSymName(const ::mlir::StringAttr &propValue)
Definition Ops.h.inc:94
void setConstant(const ::mlir::UnitAttr &propValue)
Definition Ops.h.inc:74
void setConstant(const ::mlir::UnitAttr &propValue)
Definition Ops.h.inc:393
void setNameRef(const ::mlir::SymbolRefAttr &propValue)
Definition Ops.h.inc:403
void setNameRef(const ::mlir::SymbolRefAttr &propValue)
Definition Ops.h.inc:648