LLZK 3.0.0
An open-source IR for Zero Knowledge (ZK) circuits
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} // namespace global
524} // namespace llzk
525MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::global::GlobalDefOp)
526
527namespace llzk {
528namespace global {
529
530//===----------------------------------------------------------------------===//
531// ::llzk::global::GlobalReadOp definitions
532//===----------------------------------------------------------------------===//
533
534namespace detail {
535GlobalReadOpGenericAdaptorBase::GlobalReadOpGenericAdaptorBase(GlobalReadOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
536
538 auto attr = getNameRefAttr();
539 return attr;
540}
541
542} // namespace detail
544
545::llvm::LogicalResult GlobalReadOpAdaptor::verify(::mlir::Location loc) {
546 auto tblgen_name_ref = getProperties().name_ref; (void)tblgen_name_ref;
547 if (!tblgen_name_ref) return emitError(loc, "'global.read' op ""requires attribute 'name_ref'");
548
549 if (tblgen_name_ref && !((::llvm::isa<::mlir::SymbolRefAttr>(tblgen_name_ref))))
550 return emitError(loc, "'global.read' op ""attribute 'name_ref' failed to satisfy constraint: symbol reference attribute");
551 return ::mlir::success();
552}
553
554::llvm::LogicalResult GlobalReadOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
555 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
556 if (!dict) {
557 emitError() << "expected DictionaryAttr to set properties";
558 return ::mlir::failure();
559 }
560
561 {
562 auto &propStorage = prop.name_ref;
563 auto attr = dict.get("name_ref");
564 if (attr) {
565 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
566 if (convertedAttr) {
567 propStorage = convertedAttr;
568 } else {
569 emitError() << "Invalid attribute `name_ref` in property conversion: " << attr;
570 return ::mlir::failure();
571 }
572 }
573 }
574 return ::mlir::success();
575}
576
577::mlir::Attribute GlobalReadOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
578 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
579 ::mlir::Builder odsBuilder{ctx};
580
581 {
582 const auto &propStorage = prop.name_ref;
583 if (propStorage)
584 attrs.push_back(odsBuilder.getNamedAttr("name_ref",
585 propStorage));
586 }
587
588 if (!attrs.empty())
589 return odsBuilder.getDictionaryAttr(attrs);
590 return {};
591}
592
594 return llvm::hash_combine(
595 llvm::hash_value(prop.name_ref.getAsOpaquePointer()));
596}
597
598std::optional<mlir::Attribute> GlobalReadOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
599 if (name == "name_ref")
600 return prop.name_ref;
601 return std::nullopt;
602}
603
604void GlobalReadOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
605 if (name == "name_ref") {
606 prop.name_ref = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.name_ref)>>(value);
607 return;
608 }
609}
610
611void GlobalReadOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
612 if (prop.name_ref) attrs.append("name_ref", prop.name_ref);
613}
614
615::llvm::LogicalResult GlobalReadOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
616 {
617 ::mlir::Attribute attr = attrs.get(getNameRefAttrName(opName));
618 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops5(attr, "name_ref", emitError)))
619 return ::mlir::failure();
620 }
621 return ::mlir::success();
622}
623
624::llvm::LogicalResult GlobalReadOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
625 auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
626 if (::mlir::failed(reader.readAttribute(prop.name_ref)))
627 return ::mlir::failure();
628 return ::mlir::success();
629}
630
631void GlobalReadOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
632 auto &prop = getProperties(); (void)prop;
633 writer.writeAttribute(prop.name_ref);
634}
635
636::mlir::SymbolRefAttr GlobalReadOp::getNameRef() {
637 auto attr = getNameRefAttr();
638 return attr;
639}
640
641void GlobalReadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type val, ::mlir::SymbolRefAttr name_ref) {
642 odsState.getOrAddProperties<Properties>().name_ref = name_ref;
643 odsState.addTypes(val);
644}
645
646void GlobalReadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::SymbolRefAttr name_ref) {
647 odsState.getOrAddProperties<Properties>().name_ref = name_ref;
648 assert(resultTypes.size() == 1u && "mismatched number of results");
649 odsState.addTypes(resultTypes);
650}
651
652void GlobalReadOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
653 assert(operands.size() == 0u && "mismatched number of parameters");
654 odsState.addOperands(operands);
655 odsState.addAttributes(attributes);
656 assert(resultTypes.size() == 1u && "mismatched number of return types");
657 odsState.addTypes(resultTypes);
658
659 if (!attributes.empty()) {
660 ::mlir::OpaqueProperties properties =
661 &odsState.getOrAddProperties<GlobalReadOp::Properties>();
662 std::optional<::mlir::RegisteredOperationName> info =
663 odsState.name.getRegisteredInfo();
664 if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
665 odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
666 ::llvm::report_fatal_error("Property conversion failed.");
667 }
668}
669
670::llvm::LogicalResult GlobalReadOp::verifyInvariantsImpl() {
671 auto tblgen_name_ref = getProperties().name_ref; (void)tblgen_name_ref;
672 if (!tblgen_name_ref) return emitOpError("requires attribute 'name_ref'");
673
674 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops5(*this, tblgen_name_ref, "name_ref")))
675 return ::mlir::failure();
676 {
677 unsigned index = 0; (void)index;
678 auto valueGroup0 = getODSResults(0);
679
680 for (auto v : valueGroup0) {
681 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "result", index++)))
682 return ::mlir::failure();
683 }
684 }
685 return ::mlir::success();
686}
687
688::llvm::LogicalResult GlobalReadOp::verifyInvariants() {
689 return verifyInvariantsImpl();
690}
691
692::mlir::ParseResult GlobalReadOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
693 ::mlir::SymbolRefAttr name_refAttr;
694 ::mlir::Type valRawType{};
695 ::llvm::ArrayRef<::mlir::Type> valTypes(&valRawType, 1);
696
697 if (parser.parseCustomAttributeWithFallback(name_refAttr, parser.getBuilder().getType<::mlir::NoneType>())) {
698 return ::mlir::failure();
699 }
700 if (name_refAttr) result.getOrAddProperties<GlobalReadOp::Properties>().name_ref = name_refAttr;
701 if (parser.parseColon())
702 return ::mlir::failure();
703
704 {
705 ::mlir::Type type;
706 if (parser.parseCustomTypeWithFallback(type))
707 return ::mlir::failure();
708 valRawType = type;
709 }
710 {
711 auto loc = parser.getCurrentLocation();(void)loc;
712 if (parser.parseOptionalAttrDict(result.attributes))
713 return ::mlir::failure();
714 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
715 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
716 })))
717 return ::mlir::failure();
718 }
719 result.addTypes(valTypes);
720 return ::mlir::success();
721}
722
723void GlobalReadOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
724 _odsPrinter << ' ';
725 _odsPrinter.printAttributeWithoutType(getNameRefAttr());
726 _odsPrinter << ' ' << ":";
727 _odsPrinter << ' ';
728 {
729 auto type = getVal().getType();
730 if (auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
731 _odsPrinter.printStrippedAttrOrType(validType);
732 else
733 _odsPrinter << type;
734 }
735 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
736 elidedAttrs.push_back("name_ref");
737 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
738}
739
740void GlobalReadOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
741 effects.emplace_back(::mlir::MemoryEffects::Read::get(), 0, false, ::mlir::SideEffects::DefaultResource::get());
742}
743
744} // namespace global
745} // namespace llzk
746MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::global::GlobalReadOp)
747
748namespace llzk {
749namespace global {
750
751//===----------------------------------------------------------------------===//
752// ::llzk::global::GlobalWriteOp definitions
753//===----------------------------------------------------------------------===//
754
755namespace detail {
757
759 auto attr = getNameRefAttr();
760 return attr;
761}
762
763} // namespace detail
765
766::llvm::LogicalResult GlobalWriteOpAdaptor::verify(::mlir::Location loc) {
767 auto tblgen_name_ref = getProperties().name_ref; (void)tblgen_name_ref;
768 if (!tblgen_name_ref) return emitError(loc, "'global.write' op ""requires attribute 'name_ref'");
769
770 if (tblgen_name_ref && !((::llvm::isa<::mlir::SymbolRefAttr>(tblgen_name_ref))))
771 return emitError(loc, "'global.write' op ""attribute 'name_ref' failed to satisfy constraint: symbol reference attribute");
772 return ::mlir::success();
773}
774
775::llvm::LogicalResult GlobalWriteOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
776 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
777 if (!dict) {
778 emitError() << "expected DictionaryAttr to set properties";
779 return ::mlir::failure();
780 }
781
782 {
783 auto &propStorage = prop.name_ref;
784 auto attr = dict.get("name_ref");
785 if (attr) {
786 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
787 if (convertedAttr) {
788 propStorage = convertedAttr;
789 } else {
790 emitError() << "Invalid attribute `name_ref` in property conversion: " << attr;
791 return ::mlir::failure();
792 }
793 }
794 }
795 return ::mlir::success();
796}
797
798::mlir::Attribute GlobalWriteOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
799 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
800 ::mlir::Builder odsBuilder{ctx};
801
802 {
803 const auto &propStorage = prop.name_ref;
804 if (propStorage)
805 attrs.push_back(odsBuilder.getNamedAttr("name_ref",
806 propStorage));
807 }
808
809 if (!attrs.empty())
810 return odsBuilder.getDictionaryAttr(attrs);
811 return {};
812}
813
815 return llvm::hash_combine(
816 llvm::hash_value(prop.name_ref.getAsOpaquePointer()));
817}
818
819std::optional<mlir::Attribute> GlobalWriteOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
820 if (name == "name_ref")
821 return prop.name_ref;
822 return std::nullopt;
823}
824
825void GlobalWriteOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
826 if (name == "name_ref") {
827 prop.name_ref = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.name_ref)>>(value);
828 return;
829 }
830}
831
832void GlobalWriteOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
833 if (prop.name_ref) attrs.append("name_ref", prop.name_ref);
834}
835
836::llvm::LogicalResult GlobalWriteOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
837 {
838 ::mlir::Attribute attr = attrs.get(getNameRefAttrName(opName));
839 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops5(attr, "name_ref", emitError)))
840 return ::mlir::failure();
841 }
842 return ::mlir::success();
843}
844
845::llvm::LogicalResult GlobalWriteOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
846 auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
847 if (::mlir::failed(reader.readAttribute(prop.name_ref)))
848 return ::mlir::failure();
849 return ::mlir::success();
850}
851
852void GlobalWriteOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
853 auto &prop = getProperties(); (void)prop;
854 writer.writeAttribute(prop.name_ref);
855}
856
857::mlir::SymbolRefAttr GlobalWriteOp::getNameRef() {
858 auto attr = getNameRefAttr();
859 return attr;
860}
861
862void GlobalWriteOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::SymbolRefAttr name_ref, ::mlir::Value val) {
863 odsState.addOperands(val);
864 odsState.getOrAddProperties<Properties>().name_ref = name_ref;
865}
866
867void GlobalWriteOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::SymbolRefAttr name_ref, ::mlir::Value val) {
868 odsState.addOperands(val);
869 odsState.getOrAddProperties<Properties>().name_ref = name_ref;
870 assert(resultTypes.size() == 0u && "mismatched number of results");
871 odsState.addTypes(resultTypes);
872}
873
874void GlobalWriteOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
875 assert(operands.size() == 1u && "mismatched number of parameters");
876 odsState.addOperands(operands);
877 odsState.addAttributes(attributes);
878 assert(resultTypes.size() == 0u && "mismatched number of return types");
879 odsState.addTypes(resultTypes);
880
881 if (!attributes.empty()) {
882 ::mlir::OpaqueProperties properties =
883 &odsState.getOrAddProperties<GlobalWriteOp::Properties>();
884 std::optional<::mlir::RegisteredOperationName> info =
885 odsState.name.getRegisteredInfo();
886 if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
887 odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
888 ::llvm::report_fatal_error("Property conversion failed.");
889 }
890}
891
892::llvm::LogicalResult GlobalWriteOp::verifyInvariantsImpl() {
893 auto tblgen_name_ref = getProperties().name_ref; (void)tblgen_name_ref;
894 if (!tblgen_name_ref) return emitOpError("requires attribute 'name_ref'");
895
896 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops5(*this, tblgen_name_ref, "name_ref")))
897 return ::mlir::failure();
898 {
899 unsigned index = 0; (void)index;
900 auto valueGroup0 = getODSOperands(0);
901
902 for (auto v : valueGroup0) {
903 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
904 return ::mlir::failure();
905 }
906 }
907 return ::mlir::success();
908}
909
910::llvm::LogicalResult GlobalWriteOp::verifyInvariants() {
911 return verifyInvariantsImpl();
912}
913
914::mlir::ParseResult GlobalWriteOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
915 ::mlir::SymbolRefAttr name_refAttr;
916 ::mlir::OpAsmParser::UnresolvedOperand valRawOperand{};
917 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> valOperands(&valRawOperand, 1); ::llvm::SMLoc valOperandsLoc;
918 (void)valOperandsLoc;
919 ::mlir::Type valRawType{};
920 ::llvm::ArrayRef<::mlir::Type> valTypes(&valRawType, 1);
921
922 if (parser.parseCustomAttributeWithFallback(name_refAttr, parser.getBuilder().getType<::mlir::NoneType>())) {
923 return ::mlir::failure();
924 }
925 if (name_refAttr) result.getOrAddProperties<GlobalWriteOp::Properties>().name_ref = name_refAttr;
926 if (parser.parseEqual())
927 return ::mlir::failure();
928
929 valOperandsLoc = parser.getCurrentLocation();
930 if (parser.parseOperand(valRawOperand))
931 return ::mlir::failure();
932 if (parser.parseColon())
933 return ::mlir::failure();
934
935 {
936 ::mlir::Type type;
937 if (parser.parseCustomTypeWithFallback(type))
938 return ::mlir::failure();
939 valRawType = type;
940 }
941 {
942 auto loc = parser.getCurrentLocation();(void)loc;
943 if (parser.parseOptionalAttrDict(result.attributes))
944 return ::mlir::failure();
945 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
946 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
947 })))
948 return ::mlir::failure();
949 }
950 if (parser.resolveOperands(valOperands, valTypes, valOperandsLoc, result.operands))
951 return ::mlir::failure();
952 return ::mlir::success();
953}
954
955void GlobalWriteOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
956 _odsPrinter << ' ';
957 _odsPrinter.printAttributeWithoutType(getNameRefAttr());
958 _odsPrinter << ' ' << "=";
959 _odsPrinter << ' ';
960 _odsPrinter << getVal();
961 _odsPrinter << ' ' << ":";
962 _odsPrinter << ' ';
963 {
964 auto type = getVal().getType();
965 if (auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
966 _odsPrinter.printStrippedAttrOrType(validType);
967 else
968 _odsPrinter << type;
969 }
970 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
971 elidedAttrs.push_back("name_ref");
972 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
973}
974
975void GlobalWriteOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
976 effects.emplace_back(::mlir::MemoryEffects::Write::get(), 0, false, ::mlir::SideEffects::DefaultResource::get());
977}
978
979} // namespace global
980} // namespace llzk
981MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::global::GlobalWriteOp)
982
983
984#endif // GET_OP_CLASSES
985
::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
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:289
::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
::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:393
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
GlobalReadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:397
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:545
GlobalReadOpAdaptor(GlobalReadOp op)
Definition Ops.cpp.inc:543
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type val, ::mlir::SymbolRefAttr name_ref)
Definition Ops.cpp.inc:641
::mlir::StringAttr getNameRefAttrName()
Definition Ops.h.inc:446
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:631
FoldAdaptor::Properties Properties
Definition Ops.h.inc:440
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:577
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:472
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:688
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:723
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:740
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:593
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:692
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:598
::mlir::SymbolRefAttr getNameRefAttr()
Definition Ops.h.inc:491
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:604
::mlir::TypedValue<::mlir::Type > getVal()
Definition Ops.h.inc:478
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:554
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:615
::mlir::SymbolRefAttr getNameRef()
Definition Ops.cpp.inc:636
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:624
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:611
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:670
GlobalWriteOpAdaptor(GlobalWriteOp op)
Definition Ops.cpp.inc:764
GlobalWriteOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:599
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:766
::mlir::TypedValue<::mlir::Type > getVal()
Definition Ops.h.inc:674
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:814
::mlir::StringAttr getNameRefAttrName()
Definition Ops.h.inc:652
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:914
::mlir::SymbolRefAttr getNameRefAttr()
Definition Ops.h.inc:702
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:668
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:832
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:955
FoldAdaptor::Properties Properties
Definition Ops.h.inc:646
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:910
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:975
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:798
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:836
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::SymbolRefAttr name_ref, ::mlir::Value val)
Definition Ops.cpp.inc:862
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:825
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:852
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:819
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:892
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:775
::mlir::SymbolRefAttr getNameRef()
Definition Ops.cpp.inc:857
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:845
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:366
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:362
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:564
GlobalWriteOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:568
bool isValidGlobalType(Type type)