LLZK 0.1.0
Veridise's ZK Language IR
Loading...
Searching...
No Matches
Ops.cpp.inc
Go to the documentation of this file.
1/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2|* *|
3|* Op Definitions *|
4|* *|
5|* Automatically generated file, do not edit! *|
6|* From: Ops.td *|
7|* *|
8\*===----------------------------------------------------------------------===*/
9
10#ifdef GET_OP_LIST
11#undef GET_OP_LIST
12
16#endif // GET_OP_LIST
17
18#ifdef GET_OP_CLASSES
19#undef GET_OP_CLASSES
20
21
22//===----------------------------------------------------------------------===//
23// Local Utility Method Definitions
24//===----------------------------------------------------------------------===//
25
26namespace llzk {
27namespace global {
28
29static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops1(
30 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
31 unsigned valueIndex) {
32 if (!((::llzk::isValidGlobalType(type)))) {
33 return op->emitOpError(valueKind) << " #" << valueIndex
34 << " must be any LLZK type except non-constant types, but got " << type;
35 }
36 return ::mlir::success();
37}
38
39static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops1(
40 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
41 if (attr && !((::llvm::isa<::mlir::StringAttr>(attr))))
42 return emitError() << "attribute '" << attrName
43 << "' failed to satisfy constraint: string attribute";
44 return ::mlir::success();
45}
46static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops1(
47 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
48 return __mlir_ods_local_attr_constraint_Ops1(attr, attrName, [op]() {
49 return op->emitOpError();
50 });
51}
52
53static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops2(
54 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
55 if (attr && !((::llvm::isa<::mlir::UnitAttr>(attr))))
56 return emitError() << "attribute '" << attrName
57 << "' failed to satisfy constraint: unit attribute";
58 return ::mlir::success();
59}
60static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops2(
61 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
62 return __mlir_ods_local_attr_constraint_Ops2(attr, attrName, [op]() {
63 return op->emitOpError();
64 });
65}
66
67static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops3(
68 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
69 if (attr && !(((::llvm::isa<::mlir::TypeAttr>(attr))) && ((::llvm::isa<::mlir::Type>(::llvm::cast<::mlir::TypeAttr>(attr).getValue()))) && ((::llzk::isValidGlobalType(::llvm::cast<::mlir::TypeAttr>(attr).getValue())))))
70 return emitError() << "attribute '" << attrName
71 << "' failed to satisfy constraint: type attribute of any LLZK type except non-constant types";
72 return ::mlir::success();
73}
74static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops3(
75 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
76 return __mlir_ods_local_attr_constraint_Ops3(attr, attrName, [op]() {
77 return op->emitOpError();
78 });
79}
80
81static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops4(
82 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
83 if (attr && !((true)))
84 return emitError() << "attribute '" << attrName
85 << "' failed to satisfy constraint: any attribute";
86 return ::mlir::success();
87}
88static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops4(
89 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
90 return __mlir_ods_local_attr_constraint_Ops4(attr, attrName, [op]() {
91 return op->emitOpError();
92 });
93}
94
95static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops5(
96 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
97 if (attr && !((::llvm::isa<::mlir::SymbolRefAttr>(attr))))
98 return emitError() << "attribute '" << attrName
99 << "' failed to satisfy constraint: symbol reference attribute";
100 return ::mlir::success();
101}
102static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops5(
103 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
104 return __mlir_ods_local_attr_constraint_Ops5(attr, attrName, [op]() {
105 return op->emitOpError();
106 });
107}
108} // namespace global
109} // namespace llzk
110namespace llzk {
111namespace global {
112
113//===----------------------------------------------------------------------===//
114// ::llzk::global::GlobalDefOp definitions
115//===----------------------------------------------------------------------===//
116
117namespace detail {
118GlobalDefOpGenericAdaptorBase::GlobalDefOpGenericAdaptorBase(GlobalDefOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
119
121 auto attr = getSymNameAttr();
122 return attr.getValue();
123}
124
126 auto attr = ::llvm::dyn_cast_or_null<::mlir::UnitAttr>(getProperties().constant);
127 if (!attr)
128 attr = ((false) ? ::mlir::Builder(odsAttrs.getContext()).getUnitAttr() : nullptr);
129 return attr;
130}
131
133 auto attr = getConstantAttr();
134 if (!attr)
135 return ((false) ? ::mlir::Builder(odsAttrs.getContext()).getUnitAttr() : nullptr) != nullptr;
136 return attr != nullptr;
137}
138
140 auto attr = getTypeAttr();
141 return ::llvm::cast<::mlir::Type>(attr.getValue());
142}
143
145 auto attr = ::llvm::dyn_cast_or_null<::mlir::Attribute>(getProperties().initial_value);
146 return attr;
147}
148
150 auto attr = getInitialValueAttr();
151 return attr;
152}
153
154} // namespace detail
156
157::llvm::LogicalResult GlobalDefOpAdaptor::verify(::mlir::Location loc) {
158 auto tblgen_constant = getProperties().constant; (void)tblgen_constant;
159 auto tblgen_initial_value = getProperties().initial_value; (void)tblgen_initial_value;
160 auto tblgen_sym_name = getProperties().sym_name; (void)tblgen_sym_name;
161 if (!tblgen_sym_name) return emitError(loc, "'global.def' op ""requires attribute 'sym_name'");
162 auto tblgen_type = getProperties().type; (void)tblgen_type;
163 if (!tblgen_type) return emitError(loc, "'global.def' op ""requires attribute 'type'");
164
165 if (tblgen_sym_name && !((::llvm::isa<::mlir::StringAttr>(tblgen_sym_name))))
166 return emitError(loc, "'global.def' op ""attribute 'sym_name' failed to satisfy constraint: string attribute");
167
168 if (tblgen_constant && !((::llvm::isa<::mlir::UnitAttr>(tblgen_constant))))
169 return emitError(loc, "'global.def' op ""attribute 'constant' failed to satisfy constraint: unit attribute");
170
171 if (tblgen_type && !(((::llvm::isa<::mlir::TypeAttr>(tblgen_type))) && ((::llvm::isa<::mlir::Type>(::llvm::cast<::mlir::TypeAttr>(tblgen_type).getValue()))) && ((::llzk::isValidGlobalType(::llvm::cast<::mlir::TypeAttr>(tblgen_type).getValue())))))
172 return emitError(loc, "'global.def' op ""attribute 'type' failed to satisfy constraint: type attribute of any LLZK type except non-constant types");
173
174 if (tblgen_initial_value && !((true)))
175 return emitError(loc, "'global.def' op ""attribute 'initial_value' failed to satisfy constraint: any attribute");
176 return ::mlir::success();
177}
178
179::llvm::LogicalResult GlobalDefOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
180 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
181 if (!dict) {
182 emitError() << "expected DictionaryAttr to set properties";
183 return ::mlir::failure();
184 }
185
186 {
187 auto &propStorage = prop.constant;
188 auto attr = dict.get("constant");
189 if (attr) {
190 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
191 if (convertedAttr) {
192 propStorage = convertedAttr;
193 } else {
194 emitError() << "Invalid attribute `constant` in property conversion: " << attr;
195 return ::mlir::failure();
196 }
197 }
198 }
199
200 {
201 auto &propStorage = prop.initial_value;
202 auto attr = dict.get("initial_value");
203 if (attr) {
204 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
205 if (convertedAttr) {
206 propStorage = convertedAttr;
207 } else {
208 emitError() << "Invalid attribute `initial_value` in property conversion: " << attr;
209 return ::mlir::failure();
210 }
211 }
212 }
213
214 {
215 auto &propStorage = prop.sym_name;
216 auto attr = dict.get("sym_name");
217 if (attr) {
218 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
219 if (convertedAttr) {
220 propStorage = convertedAttr;
221 } else {
222 emitError() << "Invalid attribute `sym_name` in property conversion: " << attr;
223 return ::mlir::failure();
224 }
225 }
226 }
227
228 {
229 auto &propStorage = prop.type;
230 auto attr = dict.get("type");
231 if (attr) {
232 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
233 if (convertedAttr) {
234 propStorage = convertedAttr;
235 } else {
236 emitError() << "Invalid attribute `type` in property conversion: " << attr;
237 return ::mlir::failure();
238 }
239 }
240 }
241 return ::mlir::success();
242}
243
244::mlir::Attribute GlobalDefOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
245 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
246 ::mlir::Builder odsBuilder{ctx};
247
248 {
249 const auto &propStorage = prop.constant;
250 if (propStorage)
251 attrs.push_back(odsBuilder.getNamedAttr("constant",
252 propStorage));
253 }
254
255 {
256 const auto &propStorage = prop.initial_value;
257 if (propStorage)
258 attrs.push_back(odsBuilder.getNamedAttr("initial_value",
259 propStorage));
260 }
261
262 {
263 const auto &propStorage = prop.sym_name;
264 if (propStorage)
265 attrs.push_back(odsBuilder.getNamedAttr("sym_name",
266 propStorage));
267 }
268
269 {
270 const auto &propStorage = prop.type;
271 if (propStorage)
272 attrs.push_back(odsBuilder.getNamedAttr("type",
273 propStorage));
274 }
275
276 if (!attrs.empty())
277 return odsBuilder.getDictionaryAttr(attrs);
278 return {};
279}
280
281llvm::hash_code GlobalDefOp::computePropertiesHash(const Properties &prop) {
282 return llvm::hash_combine(
283 llvm::hash_value(prop.constant.getAsOpaquePointer()),
284 llvm::hash_value(prop.initial_value.getAsOpaquePointer()),
285 llvm::hash_value(prop.sym_name.getAsOpaquePointer()),
286 llvm::hash_value(prop.type.getAsOpaquePointer()));
287}
288
289std::optional<mlir::Attribute> GlobalDefOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
290 if (name == "constant")
291 return prop.constant;
292
293 if (name == "initial_value")
294 return prop.initial_value;
295
296 if (name == "sym_name")
297 return prop.sym_name;
298
299 if (name == "type")
300 return prop.type;
301 return std::nullopt;
302}
303
304void GlobalDefOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
305 if (name == "constant") {
306 prop.constant = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.constant)>>(value);
307 return;
308 }
309
310 if (name == "initial_value") {
311 prop.initial_value = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.initial_value)>>(value);
312 return;
313 }
314
315 if (name == "sym_name") {
316 prop.sym_name = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.sym_name)>>(value);
317 return;
318 }
319
320 if (name == "type") {
321 prop.type = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.type)>>(value);
322 return;
323 }
324}
325
326void GlobalDefOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
327 if (prop.constant) attrs.append("constant", prop.constant);
328
329 if (prop.initial_value) attrs.append("initial_value", prop.initial_value);
330
331 if (prop.sym_name) attrs.append("sym_name", prop.sym_name);
332
333 if (prop.type) attrs.append("type", prop.type);
334}
335
336::llvm::LogicalResult GlobalDefOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
337 {
338 ::mlir::Attribute attr = attrs.get(getConstantAttrName(opName));
339 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops2(attr, "constant", emitError)))
340 return ::mlir::failure();
341 }
342
343 {
344 ::mlir::Attribute attr = attrs.get(getInitialValueAttrName(opName));
345 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops4(attr, "initial_value", emitError)))
346 return ::mlir::failure();
347 }
348
349 {
350 ::mlir::Attribute attr = attrs.get(getSymNameAttrName(opName));
351 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(attr, "sym_name", emitError)))
352 return ::mlir::failure();
353 }
354
355 {
356 ::mlir::Attribute attr = attrs.get(getTypeAttrName(opName));
357 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops3(attr, "type", emitError)))
358 return ::mlir::failure();
359 }
360 return ::mlir::success();
361}
362
363::llvm::LogicalResult GlobalDefOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
364 auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
365 if (::mlir::failed(reader.readOptionalAttribute(prop.constant)))
366 return ::mlir::failure();
367
368 if (::mlir::failed(reader.readOptionalAttribute(prop.initial_value)))
369 return ::mlir::failure();
370
371 if (::mlir::failed(reader.readAttribute(prop.sym_name)))
372 return ::mlir::failure();
373
374 if (::mlir::failed(reader.readAttribute(prop.type)))
375 return ::mlir::failure();
376 return ::mlir::success();
377}
378
379void GlobalDefOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
380 auto &prop = getProperties(); (void)prop;
381
382 writer.writeOptionalAttribute(prop.constant);
383
384 writer.writeOptionalAttribute(prop.initial_value);
385 writer.writeAttribute(prop.sym_name);
386 writer.writeAttribute(prop.type);
387}
388
389::llvm::StringRef GlobalDefOp::getSymName() {
390 auto attr = getSymNameAttr();
391 return attr.getValue();
392}
393
395 auto attr = getConstantAttr();
396 if (!attr)
397 return ((false) ? ::mlir::Builder((*this)->getContext()).getUnitAttr() : nullptr) != nullptr;
398 return attr != nullptr;
399}
400
401::mlir::Type GlobalDefOp::getType() {
402 auto attr = getTypeAttr();
403 return ::llvm::cast<::mlir::Type>(attr.getValue());
404}
405
406::mlir::Attribute GlobalDefOp::getInitialValue() {
407 auto attr = getInitialValueAttr();
408 return attr;
409}
410
411void GlobalDefOp::setSymName(::llvm::StringRef attrValue) {
412 getProperties().sym_name = ::mlir::Builder((*this)->getContext()).getStringAttr(attrValue);
413}
414
415void GlobalDefOp::setConstant(bool attrValue) {
416 auto &odsProp = getProperties().constant;
417 if (attrValue)
418 odsProp = ((attrValue) ? ::mlir::Builder((*this)->getContext()).getUnitAttr() : nullptr);
419 else
420 odsProp = nullptr;
421}
422
423void GlobalDefOp::setType(::mlir::Type attrValue) {
424 getProperties().type = ::mlir::TypeAttr::get(attrValue);
425}
426
427void GlobalDefOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name, /*optional*/::mlir::UnitAttr constant, ::mlir::TypeAttr type, ::mlir::Attribute initial_value) {
428 odsState.getOrAddProperties<Properties>().sym_name = sym_name;
429 if (constant) {
430 odsState.getOrAddProperties<Properties>().constant = constant;
431 }
432 odsState.getOrAddProperties<Properties>().type = type;
433 if (initial_value) {
434 odsState.getOrAddProperties<Properties>().initial_value = initial_value;
435 }
436}
437
438void GlobalDefOp::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) {
439 odsState.getOrAddProperties<Properties>().sym_name = sym_name;
440 if (constant) {
441 odsState.getOrAddProperties<Properties>().constant = constant;
442 }
443 odsState.getOrAddProperties<Properties>().type = type;
444 if (initial_value) {
445 odsState.getOrAddProperties<Properties>().initial_value = initial_value;
446 }
447 assert(resultTypes.size() == 0u && "mismatched number of results");
448 odsState.addTypes(resultTypes);
449}
450
451void GlobalDefOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llvm::StringRef sym_name, /*optional*/bool constant, ::mlir::Type type, ::mlir::Attribute initial_value) {
452 odsState.getOrAddProperties<Properties>().sym_name = odsBuilder.getStringAttr(sym_name);
453 if (constant) {
454 odsState.getOrAddProperties<Properties>().constant = ((constant) ? odsBuilder.getUnitAttr() : nullptr);
455 }
456 odsState.getOrAddProperties<Properties>().type = ::mlir::TypeAttr::get(type);
457 odsState.getOrAddProperties<Properties>().initial_value = initial_value;
458}
459
460void GlobalDefOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef sym_name, /*optional*/bool constant, ::mlir::Type type, ::mlir::Attribute initial_value) {
461 odsState.getOrAddProperties<Properties>().sym_name = odsBuilder.getStringAttr(sym_name);
462 if (constant) {
463 odsState.getOrAddProperties<Properties>().constant = ((constant) ? odsBuilder.getUnitAttr() : nullptr);
464 }
465 odsState.getOrAddProperties<Properties>().type = ::mlir::TypeAttr::get(type);
466 odsState.getOrAddProperties<Properties>().initial_value = initial_value;
467 assert(resultTypes.size() == 0u && "mismatched number of results");
468 odsState.addTypes(resultTypes);
469}
470
471void GlobalDefOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
472 assert(operands.size() == 0u && "mismatched number of parameters");
473 odsState.addOperands(operands);
474 odsState.addAttributes(attributes);
475 assert(resultTypes.size() == 0u && "mismatched number of return types");
476 odsState.addTypes(resultTypes);
477
478 if (!attributes.empty()) {
479 ::mlir::OpaqueProperties properties =
480 &odsState.getOrAddProperties<GlobalDefOp::Properties>();
481 std::optional<::mlir::RegisteredOperationName> info =
482 odsState.name.getRegisteredInfo();
483 if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
484 odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
485 ::llvm::report_fatal_error("Property conversion failed.");
486 }
487}
488
489void GlobalDefOp::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
490 ::mlir::Builder odsBuilder(opName.getContext());
491 if (!properties.initial_value)
492 properties.initial_value = nullptr;
493}
494
495::llvm::LogicalResult GlobalDefOp::verifyInvariantsImpl() {
496 auto tblgen_constant = getProperties().constant; (void)tblgen_constant;
497 auto tblgen_initial_value = getProperties().initial_value; (void)tblgen_initial_value;
498 auto tblgen_sym_name = getProperties().sym_name; (void)tblgen_sym_name;
499 if (!tblgen_sym_name) return emitOpError("requires attribute 'sym_name'");
500 auto tblgen_type = getProperties().type; (void)tblgen_type;
501 if (!tblgen_type) return emitOpError("requires attribute 'type'");
502
503 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(*this, tblgen_sym_name, "sym_name")))
504 return ::mlir::failure();
505
506 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops2(*this, tblgen_constant, "constant")))
507 return ::mlir::failure();
508
509 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops3(*this, tblgen_type, "type")))
510 return ::mlir::failure();
511
512 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops4(*this, tblgen_initial_value, "initial_value")))
513 return ::mlir::failure();
514 return ::mlir::success();
515}
516
517::llvm::LogicalResult GlobalDefOp::verifyInvariants() {
518 if(::mlir::succeeded(verifyInvariantsImpl()) && ::mlir::succeeded(verify()))
519 return ::mlir::success();
520 return ::mlir::failure();
521}
522
523::mlir::ParseResult GlobalDefOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
524 ::mlir::StringAttr sym_nameAttr;
525 ::mlir::TypeAttr typeAttr;
526 ::mlir::Attribute initial_valueAttr;
527 if (::mlir::succeeded(parser.parseOptionalKeyword("const"))) {
528 result.getOrAddProperties<GlobalDefOp::Properties>().constant = parser.getBuilder().getUnitAttr(); }
529
530 if (parser.parseSymbolName(sym_nameAttr))
531 return ::mlir::failure();
532 if (sym_nameAttr) result.getOrAddProperties<GlobalDefOp::Properties>().sym_name = sym_nameAttr;
533 if (parser.parseColon())
534 return ::mlir::failure();
535
536 if (parser.parseCustomAttributeWithFallback(typeAttr, parser.getBuilder().getType<::mlir::NoneType>())) {
537 return ::mlir::failure();
538 }
539 if (typeAttr) result.getOrAddProperties<GlobalDefOp::Properties>().type = typeAttr;
540 {
541 auto odsResult = parseGlobalInitialValue(parser, initial_valueAttr, typeAttr);
542 if (odsResult) return ::mlir::failure();
543 if (initial_valueAttr)
544 result.getOrAddProperties<GlobalDefOp::Properties>().initial_value = initial_valueAttr;
545 }
546 {
547 auto loc = parser.getCurrentLocation();(void)loc;
548 if (parser.parseOptionalAttrDict(result.attributes))
549 return ::mlir::failure();
550 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
551 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
552 })))
553 return ::mlir::failure();
554 }
555 return ::mlir::success();
556}
557
558void GlobalDefOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
559 if ((getConstantAttr() && getConstantAttr() != ((false) ? ::mlir::OpBuilder((*this)->getContext()).getUnitAttr() : nullptr))) {
560 _odsPrinter << ' ' << "const";
561 }
562 _odsPrinter << ' ';
563 _odsPrinter.printSymbolName(getSymNameAttr().getValue());
564 _odsPrinter << ' ' << ":";
565 _odsPrinter << ' ';
566 _odsPrinter.printAttributeWithoutType(getTypeAttr());
568 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
569 elidedAttrs.push_back("constant");
570 elidedAttrs.push_back("sym_name");
571 elidedAttrs.push_back("type");
572 elidedAttrs.push_back("initial_value");
573 {
574 ::mlir::Builder odsBuilder(getContext());
575 ::mlir::Attribute attr = getConstantAttr();
576 if(attr && (attr == ((false) ? odsBuilder.getUnitAttr() : nullptr)))
577 elidedAttrs.push_back("constant");
578 }
579 {
580 ::mlir::Builder odsBuilder(getContext());
581 ::mlir::Attribute attr = getInitialValueAttr();
582 if(attr && (attr == nullptr))
583 elidedAttrs.push_back("initial_value");
584 }
585 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
586}
587
588} // namespace global
589} // namespace llzk
590MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::global::GlobalDefOp)
591
592namespace llzk {
593namespace global {
594
595//===----------------------------------------------------------------------===//
596// ::llzk::global::GlobalReadOp definitions
597//===----------------------------------------------------------------------===//
598
599namespace detail {
600GlobalReadOpGenericAdaptorBase::GlobalReadOpGenericAdaptorBase(GlobalReadOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
601
603 auto attr = getNameRefAttr();
604 return attr;
605}
606
607} // namespace detail
609
610::llvm::LogicalResult GlobalReadOpAdaptor::verify(::mlir::Location loc) {
611 auto tblgen_name_ref = getProperties().name_ref; (void)tblgen_name_ref;
612 if (!tblgen_name_ref) return emitError(loc, "'global.read' op ""requires attribute 'name_ref'");
613
614 if (tblgen_name_ref && !((::llvm::isa<::mlir::SymbolRefAttr>(tblgen_name_ref))))
615 return emitError(loc, "'global.read' op ""attribute 'name_ref' failed to satisfy constraint: symbol reference attribute");
616 return ::mlir::success();
617}
618
619::llvm::LogicalResult GlobalReadOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
620 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
621 if (!dict) {
622 emitError() << "expected DictionaryAttr to set properties";
623 return ::mlir::failure();
624 }
625
626 {
627 auto &propStorage = prop.name_ref;
628 auto attr = dict.get("name_ref");
629 if (attr) {
630 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
631 if (convertedAttr) {
632 propStorage = convertedAttr;
633 } else {
634 emitError() << "Invalid attribute `name_ref` in property conversion: " << attr;
635 return ::mlir::failure();
636 }
637 }
638 }
639 return ::mlir::success();
640}
641
642::mlir::Attribute GlobalReadOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
643 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
644 ::mlir::Builder odsBuilder{ctx};
645
646 {
647 const auto &propStorage = prop.name_ref;
648 if (propStorage)
649 attrs.push_back(odsBuilder.getNamedAttr("name_ref",
650 propStorage));
651 }
652
653 if (!attrs.empty())
654 return odsBuilder.getDictionaryAttr(attrs);
655 return {};
656}
657
659 return llvm::hash_combine(
660 llvm::hash_value(prop.name_ref.getAsOpaquePointer()));
661}
662
663std::optional<mlir::Attribute> GlobalReadOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
664 if (name == "name_ref")
665 return prop.name_ref;
666 return std::nullopt;
667}
668
669void GlobalReadOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
670 if (name == "name_ref") {
671 prop.name_ref = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.name_ref)>>(value);
672 return;
673 }
674}
675
676void GlobalReadOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
677 if (prop.name_ref) attrs.append("name_ref", prop.name_ref);
678}
679
680::llvm::LogicalResult GlobalReadOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
681 {
682 ::mlir::Attribute attr = attrs.get(getNameRefAttrName(opName));
683 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops5(attr, "name_ref", emitError)))
684 return ::mlir::failure();
685 }
686 return ::mlir::success();
687}
688
689::llvm::LogicalResult GlobalReadOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
690 auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
691 if (::mlir::failed(reader.readAttribute(prop.name_ref)))
692 return ::mlir::failure();
693 return ::mlir::success();
694}
695
696void GlobalReadOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
697 auto &prop = getProperties(); (void)prop;
698 writer.writeAttribute(prop.name_ref);
699}
700
701::mlir::SymbolRefAttr GlobalReadOp::getNameRef() {
702 auto attr = getNameRefAttr();
703 return attr;
704}
705
706void GlobalReadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type val, ::mlir::SymbolRefAttr name_ref) {
707 odsState.getOrAddProperties<Properties>().name_ref = name_ref;
708 odsState.addTypes(val);
709}
710
711void GlobalReadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::SymbolRefAttr name_ref) {
712 odsState.getOrAddProperties<Properties>().name_ref = name_ref;
713 assert(resultTypes.size() == 1u && "mismatched number of results");
714 odsState.addTypes(resultTypes);
715}
716
717void GlobalReadOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
718 assert(operands.size() == 0u && "mismatched number of parameters");
719 odsState.addOperands(operands);
720 odsState.addAttributes(attributes);
721 assert(resultTypes.size() == 1u && "mismatched number of return types");
722 odsState.addTypes(resultTypes);
723
724 if (!attributes.empty()) {
725 ::mlir::OpaqueProperties properties =
726 &odsState.getOrAddProperties<GlobalReadOp::Properties>();
727 std::optional<::mlir::RegisteredOperationName> info =
728 odsState.name.getRegisteredInfo();
729 if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
730 odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
731 ::llvm::report_fatal_error("Property conversion failed.");
732 }
733}
734
735::llvm::LogicalResult GlobalReadOp::verifyInvariantsImpl() {
736 auto tblgen_name_ref = getProperties().name_ref; (void)tblgen_name_ref;
737 if (!tblgen_name_ref) return emitOpError("requires attribute 'name_ref'");
738
739 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops5(*this, tblgen_name_ref, "name_ref")))
740 return ::mlir::failure();
741 {
742 unsigned index = 0; (void)index;
743 auto valueGroup0 = getODSResults(0);
744
745 for (auto v : valueGroup0) {
746 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "result", index++)))
747 return ::mlir::failure();
748 }
749 }
750 return ::mlir::success();
751}
752
753::llvm::LogicalResult GlobalReadOp::verifyInvariants() {
754 return verifyInvariantsImpl();
755}
756
757::mlir::ParseResult GlobalReadOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
758 ::mlir::SymbolRefAttr name_refAttr;
759 ::mlir::Type valRawType{};
760 ::llvm::ArrayRef<::mlir::Type> valTypes(&valRawType, 1);
761
762 if (parser.parseCustomAttributeWithFallback(name_refAttr, parser.getBuilder().getType<::mlir::NoneType>())) {
763 return ::mlir::failure();
764 }
765 if (name_refAttr) result.getOrAddProperties<GlobalReadOp::Properties>().name_ref = name_refAttr;
766 if (parser.parseColon())
767 return ::mlir::failure();
768
769 {
770 ::mlir::Type type;
771 if (parser.parseCustomTypeWithFallback(type))
772 return ::mlir::failure();
773 valRawType = type;
774 }
775 {
776 auto loc = parser.getCurrentLocation();(void)loc;
777 if (parser.parseOptionalAttrDict(result.attributes))
778 return ::mlir::failure();
779 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
780 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
781 })))
782 return ::mlir::failure();
783 }
784 result.addTypes(valTypes);
785 return ::mlir::success();
786}
787
788void GlobalReadOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
789 _odsPrinter << ' ';
790 _odsPrinter.printAttributeWithoutType(getNameRefAttr());
791 _odsPrinter << ' ' << ":";
792 _odsPrinter << ' ';
793 {
794 auto type = getVal().getType();
795 if (auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
796 _odsPrinter.printStrippedAttrOrType(validType);
797 else
798 _odsPrinter << type;
799 }
800 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
801 elidedAttrs.push_back("name_ref");
802 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
803}
804
805} // namespace global
806} // namespace llzk
807MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::global::GlobalReadOp)
808
809namespace llzk {
810namespace global {
811
812//===----------------------------------------------------------------------===//
813// ::llzk::global::GlobalWriteOp definitions
814//===----------------------------------------------------------------------===//
815
816namespace detail {
818
820 auto attr = getNameRefAttr();
821 return attr;
822}
823
824} // namespace detail
826
827::llvm::LogicalResult GlobalWriteOpAdaptor::verify(::mlir::Location loc) {
828 auto tblgen_name_ref = getProperties().name_ref; (void)tblgen_name_ref;
829 if (!tblgen_name_ref) return emitError(loc, "'global.write' op ""requires attribute 'name_ref'");
830
831 if (tblgen_name_ref && !((::llvm::isa<::mlir::SymbolRefAttr>(tblgen_name_ref))))
832 return emitError(loc, "'global.write' op ""attribute 'name_ref' failed to satisfy constraint: symbol reference attribute");
833 return ::mlir::success();
834}
835
836::llvm::LogicalResult GlobalWriteOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
837 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
838 if (!dict) {
839 emitError() << "expected DictionaryAttr to set properties";
840 return ::mlir::failure();
841 }
842
843 {
844 auto &propStorage = prop.name_ref;
845 auto attr = dict.get("name_ref");
846 if (attr) {
847 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
848 if (convertedAttr) {
849 propStorage = convertedAttr;
850 } else {
851 emitError() << "Invalid attribute `name_ref` in property conversion: " << attr;
852 return ::mlir::failure();
853 }
854 }
855 }
856 return ::mlir::success();
857}
858
859::mlir::Attribute GlobalWriteOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
860 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
861 ::mlir::Builder odsBuilder{ctx};
862
863 {
864 const auto &propStorage = prop.name_ref;
865 if (propStorage)
866 attrs.push_back(odsBuilder.getNamedAttr("name_ref",
867 propStorage));
868 }
869
870 if (!attrs.empty())
871 return odsBuilder.getDictionaryAttr(attrs);
872 return {};
873}
874
876 return llvm::hash_combine(
877 llvm::hash_value(prop.name_ref.getAsOpaquePointer()));
878}
879
880std::optional<mlir::Attribute> GlobalWriteOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
881 if (name == "name_ref")
882 return prop.name_ref;
883 return std::nullopt;
884}
885
886void GlobalWriteOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
887 if (name == "name_ref") {
888 prop.name_ref = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.name_ref)>>(value);
889 return;
890 }
891}
892
893void GlobalWriteOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
894 if (prop.name_ref) attrs.append("name_ref", prop.name_ref);
895}
896
897::llvm::LogicalResult GlobalWriteOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
898 {
899 ::mlir::Attribute attr = attrs.get(getNameRefAttrName(opName));
900 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops5(attr, "name_ref", emitError)))
901 return ::mlir::failure();
902 }
903 return ::mlir::success();
904}
905
906::llvm::LogicalResult GlobalWriteOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
907 auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
908 if (::mlir::failed(reader.readAttribute(prop.name_ref)))
909 return ::mlir::failure();
910 return ::mlir::success();
911}
912
913void GlobalWriteOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
914 auto &prop = getProperties(); (void)prop;
915 writer.writeAttribute(prop.name_ref);
916}
917
918::mlir::SymbolRefAttr GlobalWriteOp::getNameRef() {
919 auto attr = getNameRefAttr();
920 return attr;
921}
922
923void GlobalWriteOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::SymbolRefAttr name_ref, ::mlir::Value val) {
924 odsState.addOperands(val);
925 odsState.getOrAddProperties<Properties>().name_ref = name_ref;
926}
927
928void GlobalWriteOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::SymbolRefAttr name_ref, ::mlir::Value val) {
929 odsState.addOperands(val);
930 odsState.getOrAddProperties<Properties>().name_ref = name_ref;
931 assert(resultTypes.size() == 0u && "mismatched number of results");
932 odsState.addTypes(resultTypes);
933}
934
935void GlobalWriteOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
936 assert(operands.size() == 1u && "mismatched number of parameters");
937 odsState.addOperands(operands);
938 odsState.addAttributes(attributes);
939 assert(resultTypes.size() == 0u && "mismatched number of return types");
940 odsState.addTypes(resultTypes);
941
942 if (!attributes.empty()) {
943 ::mlir::OpaqueProperties properties =
944 &odsState.getOrAddProperties<GlobalWriteOp::Properties>();
945 std::optional<::mlir::RegisteredOperationName> info =
946 odsState.name.getRegisteredInfo();
947 if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
948 odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
949 ::llvm::report_fatal_error("Property conversion failed.");
950 }
951}
952
953::llvm::LogicalResult GlobalWriteOp::verifyInvariantsImpl() {
954 auto tblgen_name_ref = getProperties().name_ref; (void)tblgen_name_ref;
955 if (!tblgen_name_ref) return emitOpError("requires attribute 'name_ref'");
956
957 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops5(*this, tblgen_name_ref, "name_ref")))
958 return ::mlir::failure();
959 {
960 unsigned index = 0; (void)index;
961 auto valueGroup0 = getODSOperands(0);
962
963 for (auto v : valueGroup0) {
964 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
965 return ::mlir::failure();
966 }
967 }
968 return ::mlir::success();
969}
970
971::llvm::LogicalResult GlobalWriteOp::verifyInvariants() {
972 return verifyInvariantsImpl();
973}
974
975::mlir::ParseResult GlobalWriteOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
976 ::mlir::SymbolRefAttr name_refAttr;
977 ::mlir::OpAsmParser::UnresolvedOperand valRawOperand{};
978 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> valOperands(&valRawOperand, 1); ::llvm::SMLoc valOperandsLoc;
979 (void)valOperandsLoc;
980 ::mlir::Type valRawType{};
981 ::llvm::ArrayRef<::mlir::Type> valTypes(&valRawType, 1);
982
983 if (parser.parseCustomAttributeWithFallback(name_refAttr, parser.getBuilder().getType<::mlir::NoneType>())) {
984 return ::mlir::failure();
985 }
986 if (name_refAttr) result.getOrAddProperties<GlobalWriteOp::Properties>().name_ref = name_refAttr;
987 if (parser.parseEqual())
988 return ::mlir::failure();
989
990 valOperandsLoc = parser.getCurrentLocation();
991 if (parser.parseOperand(valRawOperand))
992 return ::mlir::failure();
993 if (parser.parseColon())
994 return ::mlir::failure();
995
996 {
997 ::mlir::Type type;
998 if (parser.parseCustomTypeWithFallback(type))
999 return ::mlir::failure();
1000 valRawType = type;
1001 }
1002 {
1003 auto loc = parser.getCurrentLocation();(void)loc;
1004 if (parser.parseOptionalAttrDict(result.attributes))
1005 return ::mlir::failure();
1006 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
1007 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
1008 })))
1009 return ::mlir::failure();
1010 }
1011 if (parser.resolveOperands(valOperands, valTypes, valOperandsLoc, result.operands))
1012 return ::mlir::failure();
1013 return ::mlir::success();
1014}
1015
1016void GlobalWriteOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
1017 _odsPrinter << ' ';
1018 _odsPrinter.printAttributeWithoutType(getNameRefAttr());
1019 _odsPrinter << ' ' << "=";
1020 _odsPrinter << ' ';
1021 _odsPrinter << getVal();
1022 _odsPrinter << ' ' << ":";
1023 _odsPrinter << ' ';
1024 {
1025 auto type = getVal().getType();
1026 if (auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
1027 _odsPrinter.printStrippedAttrOrType(validType);
1028 else
1029 _odsPrinter << type;
1030 }
1031 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1032 elidedAttrs.push_back("name_ref");
1033 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1034}
1035
1036} // namespace global
1037} // namespace llzk
1038MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::global::GlobalWriteOp)
1039
1040
1041#endif // GET_OP_CLASSES
1042
MlirStringRef name
Definition Poly.cpp:48
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:157
GlobalDefOpAdaptor(GlobalDefOp op)
Definition Ops.cpp.inc:155
GlobalDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:138
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:336
static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties)
Definition Ops.cpp.inc:489
FoldAdaptor::Properties Properties
Definition Ops.h.inc:181
::mlir::Attribute getInitialValue()
Definition Ops.cpp.inc:406
void setType(::mlir::Type attrValue)
Definition Ops.cpp.inc:423
::mlir::Type getType()
Definition Ops.cpp.inc:401
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:363
::mlir::ParseResult parseGlobalInitialValue(::mlir::OpAsmParser &parser, ::mlir::Attribute &initialValue, ::mlir::TypeAttr typeAttr)
Definition Ops.cpp:36
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:289
static void printGlobalInitialValue(::mlir::OpAsmPrinter &printer, GlobalDefOp op, ::mlir::Attribute initialValue, ::mlir::TypeAttr typeAttr)
Definition Ops.cpp:62
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:517
::mlir::TypeAttr getTypeAttr()
Definition Ops.h.inc:262
::llvm::StringRef getSymName()
Definition Ops.cpp.inc:389
::mlir::StringAttr getSymNameAttrName()
Definition Ops.h.inc:203
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:244
::mlir::Attribute getInitialValueAttr()
Definition Ops.h.inc:267
::mlir::StringAttr getSymNameAttr()
Definition Ops.h.inc:252
::mlir::UnitAttr getConstantAttr()
Definition Ops.h.inc:257
void setSymName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:411
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:379
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:558
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:495
::mlir::StringAttr getTypeAttrName()
Definition Ops.h.inc:211
void setConstant(bool attrValue)
Definition Ops.cpp.inc:415
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:179
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:326
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:427
::mlir::StringAttr getInitialValueAttrName()
Definition Ops.h.inc:195
::llvm::LogicalResult verify()
Definition Ops.cpp:170
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:281
::mlir::StringAttr getConstantAttrName()
Definition Ops.h.inc:187
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:304
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:523
GlobalReadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:403
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:610
GlobalReadOpAdaptor(GlobalReadOp op)
Definition Ops.cpp.inc:608
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type val, ::mlir::SymbolRefAttr name_ref)
Definition Ops.cpp.inc:706
::mlir::StringAttr getNameRefAttrName()
Definition Ops.h.inc:452
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:696
FoldAdaptor::Properties Properties
Definition Ops.h.inc:446
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:642
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:478
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:753
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:788
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:658
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:757
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:663
::mlir::SymbolRefAttr getNameRefAttr()
Definition Ops.h.inc:497
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:669
::mlir::TypedValue<::mlir::Type > getVal()
Definition Ops.h.inc:484
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:619
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:680
::mlir::SymbolRefAttr getNameRef()
Definition Ops.cpp.inc:701
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:689
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:676
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:735
GlobalWriteOpAdaptor(GlobalWriteOp op)
Definition Ops.cpp.inc:825
GlobalWriteOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:604
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:827
::mlir::TypedValue<::mlir::Type > getVal()
Definition Ops.h.inc:679
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:875
::mlir::StringAttr getNameRefAttrName()
Definition Ops.h.inc:657
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:975
::mlir::SymbolRefAttr getNameRefAttr()
Definition Ops.h.inc:707
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:673
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:893
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1016
FoldAdaptor::Properties Properties
Definition Ops.h.inc:651
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:971
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:859
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:897
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::SymbolRefAttr name_ref, ::mlir::Value val)
Definition Ops.cpp.inc:923
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:886
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:913
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:880
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:953
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:836
::mlir::SymbolRefAttr getNameRef()
Definition Ops.cpp.inc:918
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:906
GlobalDefOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:97
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:93
GlobalReadOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:372
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:368
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:569
GlobalWriteOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:573
bool isValidGlobalType(Type type)