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
22#endif // GET_OP_LIST
23
24#ifdef GET_OP_CLASSES
25#undef GET_OP_CLASSES
26
27
28//===----------------------------------------------------------------------===//
29// Local Utility Method Definitions
30//===----------------------------------------------------------------------===//
31
32
33static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops1(
34 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
35 unsigned valueIndex) {
36 if (!((::llvm::isa<::llzk::array::ArrayType>(type)))) {
37 return op->emitOpError(valueKind) << " #" << valueIndex
38 << " must be n-dimensional array, but got " << type;
39 }
40 return ::mlir::success();
41}
42
43static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops2(
44 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
45 unsigned valueIndex) {
46 if (!((type.isSignlessInteger(1)))) {
47 return op->emitOpError(valueKind) << " #" << valueIndex
48 << " must be 1-bit signless integer, but got " << type;
49 }
50 return ::mlir::success();
51}
52
53static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops3(
54 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
55 unsigned valueIndex) {
56 if (!((::llvm::isa<llzk::polymorphic::TypeVarType,::mlir::IntegerType>(type)))) {
57 return op->emitOpError(valueKind) << " #" << valueIndex
58 << " must be 1-bit signless integer or type variable, but got " << type;
59 }
60 return ::mlir::success();
61}
62
63static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops4(
64 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
65 unsigned valueIndex) {
66 if (!((::llvm::isa<::llzk::felt::FeltType>(type)))) {
67 return op->emitOpError(valueKind) << " #" << valueIndex
68 << " must be finite field element, but got " << type;
69 }
70 return ::mlir::success();
71}
72
73static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops1(
74 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
75 if (attr && !((::llvm::isa<::mlir::StringAttr>(attr))))
76 return emitError() << "attribute '" << attrName
77 << "' failed to satisfy constraint: string attribute";
78 return ::mlir::success();
79}
80static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops1(
81 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
82 return __mlir_ods_local_attr_constraint_Ops1(attr, attrName, [op]() {
83 return op->emitOpError();
84 });
85}
86
87static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops2(
88 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
89 if (attr && !((::llvm::isa<::llzk::boolean::FeltCmpPredicateAttr>(attr))))
90 return emitError() << "attribute '" << attrName
91 << "' failed to satisfy constraint: Field element comparison predicate";
92 return ::mlir::success();
93}
94static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops2(
95 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
96 return __mlir_ods_local_attr_constraint_Ops2(attr, attrName, [op]() {
97 return op->emitOpError();
98 });
99}
100
101static ::llvm::LogicalResult __mlir_ods_local_region_constraint_Ops1(
102 ::mlir::Operation *op, ::mlir::Region &region, ::llvm::StringRef regionName,
103 unsigned regionIndex) {
104 if (!((::llvm::hasNItems(region, 1)))) {
105 return op->emitOpError("region #") << regionIndex
106 << (regionName.empty() ? " " : " ('" + regionName + "') ")
107 << "failed to verify constraint: region with 1 blocks";
108 }
109 return ::mlir::success();
110}
111namespace llzk::boolean {
112
113
114//===----------------------------------------------------------------------===//
115// ::llzk::boolean::ExistsOp definitions
116//===----------------------------------------------------------------------===//
117
118namespace detail {
119
121
122
123} // namespace detail
125
126::llvm::LogicalResult ExistsOpAdaptor::verify(::mlir::Location loc) {
127 return ::mlir::success();
128}
129
130::llvm::LogicalResult ExistsOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
131 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
132 if (!dict) {
133 emitError() << "expected DictionaryAttr to set properties";
134 return ::mlir::failure();
135 }
136 return ::mlir::success();
137}
138
139::mlir::Attribute ExistsOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
140 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
141 ::mlir::Builder odsBuilder{ctx};
142
143 if (!attrs.empty())
144 return odsBuilder.getDictionaryAttr(attrs);
145 return {};
146}
147
148llvm::hash_code ExistsOp::computePropertiesHash(const Properties &prop) {
149 using llvm::hash_value;
150 return llvm::hash_combine();
151}
152
153std::optional<mlir::Attribute> ExistsOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
154 return std::nullopt;
155}
156
157void ExistsOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
158}
159
160void ExistsOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
161}
162
163::llvm::LogicalResult ExistsOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
164 return ::mlir::success();
165}
166
167void ExistsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value sort) {
168 odsState.addOperands(sort);
169 (void)odsState.addRegion();
170 odsState.addTypes(result);
171}
172
173ExistsOp ExistsOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value sort) {
174 ::mlir::OperationState __state__(location, getOperationName());
175 build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(sort)>(sort));
176 auto __res__ = ::llvm::dyn_cast<ExistsOp>(builder.create(__state__));
177 assert(__res__ && "builder didn't return the right type");
178 return __res__;
179}
180
181ExistsOp ExistsOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value sort) {
182 return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(sort)>(sort));
183}
184
185void ExistsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value sort) {
186 odsState.addOperands(sort);
187 (void)odsState.addRegion();
188
189 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
190 if (::mlir::succeeded(ExistsOp::inferReturnTypes(odsBuilder.getContext(),
191 odsState.location, odsState.operands,
192 odsState.attributes.getDictionary(odsState.getContext()),
193 odsState.getRawProperties(),
194 odsState.regions, inferredReturnTypes)))
195 odsState.addTypes(inferredReturnTypes);
196 else
197 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
198
199}
200
201ExistsOp ExistsOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value sort) {
202 ::mlir::OperationState __state__(location, getOperationName());
203 build(builder, __state__, std::forward<decltype(sort)>(sort));
204 auto __res__ = ::llvm::dyn_cast<ExistsOp>(builder.create(__state__));
205 assert(__res__ && "builder didn't return the right type");
206 return __res__;
207}
208
209ExistsOp ExistsOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value sort) {
210 return create(builder, builder.getLoc(), std::forward<decltype(sort)>(sort));
211}
212
213void ExistsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value sort) {
214 odsState.addOperands(sort);
215 (void)odsState.addRegion();
216 assert(resultTypes.size() == 1u && "mismatched number of results");
217 odsState.addTypes(resultTypes);
218}
219
220ExistsOp ExistsOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value sort) {
221 ::mlir::OperationState __state__(location, getOperationName());
222 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(sort)>(sort));
223 auto __res__ = ::llvm::dyn_cast<ExistsOp>(builder.create(__state__));
224 assert(__res__ && "builder didn't return the right type");
225 return __res__;
226}
227
228ExistsOp ExistsOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value sort) {
229 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(sort)>(sort));
230}
231
232void ExistsOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
233 assert(operands.size() == 1u && "mismatched number of parameters");
234 odsState.addOperands(operands);
235 odsState.addAttributes(attributes);
236 for (unsigned i = 0; i != 1; ++i)
237 (void)odsState.addRegion();
238 assert(resultTypes.size() == 1u && "mismatched number of return types");
239 odsState.addTypes(resultTypes);
240}
241
242ExistsOp ExistsOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
243 ::mlir::OperationState __state__(location, getOperationName());
244 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
245 auto __res__ = ::llvm::dyn_cast<ExistsOp>(builder.create(__state__));
246 assert(__res__ && "builder didn't return the right type");
247 return __res__;
248}
249
250ExistsOp ExistsOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
251 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
252}
253
254void ExistsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
255 assert(operands.size() == 1u && "mismatched number of parameters");
256 odsState.addOperands(operands);
257 odsState.addAttributes(attributes);
258 for (unsigned i = 0; i != 1; ++i)
259 (void)odsState.addRegion();
260
261 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
262 if (::mlir::succeeded(ExistsOp::inferReturnTypes(odsBuilder.getContext(),
263 odsState.location, operands,
264 odsState.attributes.getDictionary(odsState.getContext()),
265 odsState.getRawProperties(),
266 odsState.regions, inferredReturnTypes))) {
267 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
268 odsState.addTypes(inferredReturnTypes);
269 } else {
270 ::llvm::report_fatal_error("Failed to infer result type(s).");
271 }
272}
273
274ExistsOp ExistsOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
275 ::mlir::OperationState __state__(location, getOperationName());
276 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
277 auto __res__ = ::llvm::dyn_cast<ExistsOp>(builder.create(__state__));
278 assert(__res__ && "builder didn't return the right type");
279 return __res__;
280}
281
282ExistsOp ExistsOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
283 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
284}
285
286void ExistsOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
287 assert(operands.size() == 1u && "mismatched number of parameters");
288 odsState.addOperands(operands);
289 odsState.useProperties(const_cast<Properties&>(properties));
290 odsState.addAttributes(discardableAttributes);
291 for (unsigned i = 0; i != 1; ++i)
292 (void)odsState.addRegion();
293 assert(resultTypes.size() == 1u && "mismatched number of return types");
294 odsState.addTypes(resultTypes);
295}
296
297ExistsOp ExistsOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
298 ::mlir::OperationState __state__(location, getOperationName());
299 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
300 auto __res__ = ::llvm::dyn_cast<ExistsOp>(builder.create(__state__));
301 assert(__res__ && "builder didn't return the right type");
302 return __res__;
303}
304
305ExistsOp ExistsOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
306 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
307}
308
309void ExistsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
310 assert(operands.size() == 1u && "mismatched number of parameters");
311 odsState.addOperands(operands);
312 odsState.useProperties(const_cast<Properties &>(properties));
313 odsState.addAttributes(discardableAttributes);
314 for (unsigned i = 0; i != 1; ++i)
315 (void)odsState.addRegion();
316
317 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
318 if (::mlir::succeeded(ExistsOp::inferReturnTypes(odsBuilder.getContext(),
319 odsState.location, operands,
320 odsState.attributes.getDictionary(odsState.getContext()),
321 odsState.getRawProperties(),
322 odsState.regions, inferredReturnTypes))) {
323 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
324 odsState.addTypes(inferredReturnTypes);
325 } else {
326 ::llvm::report_fatal_error("Failed to infer result type(s).");
327 }
328}
329
330ExistsOp ExistsOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
331 ::mlir::OperationState __state__(location, getOperationName());
332 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
333 auto __res__ = ::llvm::dyn_cast<ExistsOp>(builder.create(__state__));
334 assert(__res__ && "builder didn't return the right type");
335 return __res__;
336}
337
338ExistsOp ExistsOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
339 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
340}
341
342::llvm::LogicalResult ExistsOp::verifyInvariantsImpl() {
343 {
344 unsigned index = 0; (void)index;
345 auto valueGroup0 = getODSOperands(0);
346
347 for (auto v : valueGroup0) {
348 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
349 return ::mlir::failure();
350 }
351 }
352 {
353 unsigned index = 0; (void)index;
354 auto valueGroup0 = getODSResults(0);
355
356 for (auto v : valueGroup0) {
357 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
358 return ::mlir::failure();
359 }
360 }
361 {
362 unsigned index = 0; (void)index;
363
364 for (auto &region : ::llvm::MutableArrayRef((*this)->getRegion(0)))
365 if (::mlir::failed(__mlir_ods_local_region_constraint_Ops1(*this, region, "region", index++)))
366 return ::mlir::failure();
367 }
368 return ::mlir::success();
369}
370
371::llvm::LogicalResult ExistsOp::verifyInvariants() {
372 if(::mlir::succeeded(verifyInvariantsImpl()) && ::mlir::succeeded(verify()))
373 return ::mlir::success();
374 return ::mlir::failure();
375}
376
377::llvm::LogicalResult ExistsOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) {
378 inferredReturnTypes.resize(1);
379 ::mlir::Builder odsBuilder(context);
380 ::mlir::Type odsInferredType0 = odsBuilder.getIntegerType(1);
381 inferredReturnTypes[0] = odsInferredType0;
382 return ::mlir::success();
383}
384
385::llvm::LogicalResult ExistsOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
386 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
387 if (!dict) {
388 emitError() << "expected DictionaryAttr to set properties";
389 return ::mlir::failure();
390 }
391 // keep track of used keys in the input dictionary to be able to error out
392 // if there are some unknown ones.
393 ::mlir::DenseSet<::mlir::StringAttr> usedKeys;
394 ::mlir::MLIRContext *ctx = dict.getContext();
395 (void)ctx;
396
397 for (::mlir::NamedAttribute attr : dict) {
398 if (!usedKeys.contains(attr.getName()))
399 return emitError() << "unknown key '" << attr.getName() <<
400 "' when parsing properties dictionary";
401 }
402 return ::mlir::success();
403}
404
405void ExistsOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
406}
407
408
409} // namespace llzk::boolean
410MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::boolean::ExistsOp)
411
412namespace llzk::boolean {
413
414
415//===----------------------------------------------------------------------===//
416// ::llzk::boolean::ForAllOp definitions
417//===----------------------------------------------------------------------===//
418
419namespace detail {
420
422
423
424} // namespace detail
426
427::llvm::LogicalResult ForAllOpAdaptor::verify(::mlir::Location loc) {
428 return ::mlir::success();
429}
430
431::llvm::LogicalResult ForAllOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
432 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
433 if (!dict) {
434 emitError() << "expected DictionaryAttr to set properties";
435 return ::mlir::failure();
436 }
437 return ::mlir::success();
438}
439
440::mlir::Attribute ForAllOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
441 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
442 ::mlir::Builder odsBuilder{ctx};
443
444 if (!attrs.empty())
445 return odsBuilder.getDictionaryAttr(attrs);
446 return {};
447}
448
449llvm::hash_code ForAllOp::computePropertiesHash(const Properties &prop) {
450 using llvm::hash_value;
451 return llvm::hash_combine();
452}
453
454std::optional<mlir::Attribute> ForAllOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
455 return std::nullopt;
456}
457
458void ForAllOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
459}
460
461void ForAllOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
462}
463
464::llvm::LogicalResult ForAllOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
465 return ::mlir::success();
466}
467
468void ForAllOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value sort) {
469 odsState.addOperands(sort);
470 (void)odsState.addRegion();
471 odsState.addTypes(result);
472}
473
474ForAllOp ForAllOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value sort) {
475 ::mlir::OperationState __state__(location, getOperationName());
476 build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(sort)>(sort));
477 auto __res__ = ::llvm::dyn_cast<ForAllOp>(builder.create(__state__));
478 assert(__res__ && "builder didn't return the right type");
479 return __res__;
480}
481
482ForAllOp ForAllOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value sort) {
483 return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(sort)>(sort));
484}
485
486void ForAllOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value sort) {
487 odsState.addOperands(sort);
488 (void)odsState.addRegion();
489
490 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
491 if (::mlir::succeeded(ForAllOp::inferReturnTypes(odsBuilder.getContext(),
492 odsState.location, odsState.operands,
493 odsState.attributes.getDictionary(odsState.getContext()),
494 odsState.getRawProperties(),
495 odsState.regions, inferredReturnTypes)))
496 odsState.addTypes(inferredReturnTypes);
497 else
498 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
499
500}
501
502ForAllOp ForAllOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value sort) {
503 ::mlir::OperationState __state__(location, getOperationName());
504 build(builder, __state__, std::forward<decltype(sort)>(sort));
505 auto __res__ = ::llvm::dyn_cast<ForAllOp>(builder.create(__state__));
506 assert(__res__ && "builder didn't return the right type");
507 return __res__;
508}
509
510ForAllOp ForAllOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value sort) {
511 return create(builder, builder.getLoc(), std::forward<decltype(sort)>(sort));
512}
513
514void ForAllOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value sort) {
515 odsState.addOperands(sort);
516 (void)odsState.addRegion();
517 assert(resultTypes.size() == 1u && "mismatched number of results");
518 odsState.addTypes(resultTypes);
519}
520
521ForAllOp ForAllOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value sort) {
522 ::mlir::OperationState __state__(location, getOperationName());
523 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(sort)>(sort));
524 auto __res__ = ::llvm::dyn_cast<ForAllOp>(builder.create(__state__));
525 assert(__res__ && "builder didn't return the right type");
526 return __res__;
527}
528
529ForAllOp ForAllOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value sort) {
530 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(sort)>(sort));
531}
532
533void ForAllOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
534 assert(operands.size() == 1u && "mismatched number of parameters");
535 odsState.addOperands(operands);
536 odsState.addAttributes(attributes);
537 for (unsigned i = 0; i != 1; ++i)
538 (void)odsState.addRegion();
539 assert(resultTypes.size() == 1u && "mismatched number of return types");
540 odsState.addTypes(resultTypes);
541}
542
543ForAllOp ForAllOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
544 ::mlir::OperationState __state__(location, getOperationName());
545 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
546 auto __res__ = ::llvm::dyn_cast<ForAllOp>(builder.create(__state__));
547 assert(__res__ && "builder didn't return the right type");
548 return __res__;
549}
550
551ForAllOp ForAllOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
552 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
553}
554
555void ForAllOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
556 assert(operands.size() == 1u && "mismatched number of parameters");
557 odsState.addOperands(operands);
558 odsState.addAttributes(attributes);
559 for (unsigned i = 0; i != 1; ++i)
560 (void)odsState.addRegion();
561
562 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
563 if (::mlir::succeeded(ForAllOp::inferReturnTypes(odsBuilder.getContext(),
564 odsState.location, operands,
565 odsState.attributes.getDictionary(odsState.getContext()),
566 odsState.getRawProperties(),
567 odsState.regions, inferredReturnTypes))) {
568 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
569 odsState.addTypes(inferredReturnTypes);
570 } else {
571 ::llvm::report_fatal_error("Failed to infer result type(s).");
572 }
573}
574
575ForAllOp ForAllOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
576 ::mlir::OperationState __state__(location, getOperationName());
577 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
578 auto __res__ = ::llvm::dyn_cast<ForAllOp>(builder.create(__state__));
579 assert(__res__ && "builder didn't return the right type");
580 return __res__;
581}
582
583ForAllOp ForAllOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
584 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
585}
586
587void ForAllOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
588 assert(operands.size() == 1u && "mismatched number of parameters");
589 odsState.addOperands(operands);
590 odsState.useProperties(const_cast<Properties&>(properties));
591 odsState.addAttributes(discardableAttributes);
592 for (unsigned i = 0; i != 1; ++i)
593 (void)odsState.addRegion();
594 assert(resultTypes.size() == 1u && "mismatched number of return types");
595 odsState.addTypes(resultTypes);
596}
597
598ForAllOp ForAllOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
599 ::mlir::OperationState __state__(location, getOperationName());
600 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
601 auto __res__ = ::llvm::dyn_cast<ForAllOp>(builder.create(__state__));
602 assert(__res__ && "builder didn't return the right type");
603 return __res__;
604}
605
606ForAllOp ForAllOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
607 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
608}
609
610void ForAllOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
611 assert(operands.size() == 1u && "mismatched number of parameters");
612 odsState.addOperands(operands);
613 odsState.useProperties(const_cast<Properties &>(properties));
614 odsState.addAttributes(discardableAttributes);
615 for (unsigned i = 0; i != 1; ++i)
616 (void)odsState.addRegion();
617
618 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
619 if (::mlir::succeeded(ForAllOp::inferReturnTypes(odsBuilder.getContext(),
620 odsState.location, operands,
621 odsState.attributes.getDictionary(odsState.getContext()),
622 odsState.getRawProperties(),
623 odsState.regions, inferredReturnTypes))) {
624 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
625 odsState.addTypes(inferredReturnTypes);
626 } else {
627 ::llvm::report_fatal_error("Failed to infer result type(s).");
628 }
629}
630
631ForAllOp ForAllOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
632 ::mlir::OperationState __state__(location, getOperationName());
633 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
634 auto __res__ = ::llvm::dyn_cast<ForAllOp>(builder.create(__state__));
635 assert(__res__ && "builder didn't return the right type");
636 return __res__;
637}
638
639ForAllOp ForAllOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
640 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
641}
642
643::llvm::LogicalResult ForAllOp::verifyInvariantsImpl() {
644 {
645 unsigned index = 0; (void)index;
646 auto valueGroup0 = getODSOperands(0);
647
648 for (auto v : valueGroup0) {
649 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
650 return ::mlir::failure();
651 }
652 }
653 {
654 unsigned index = 0; (void)index;
655 auto valueGroup0 = getODSResults(0);
656
657 for (auto v : valueGroup0) {
658 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
659 return ::mlir::failure();
660 }
661 }
662 {
663 unsigned index = 0; (void)index;
664
665 for (auto &region : ::llvm::MutableArrayRef((*this)->getRegion(0)))
666 if (::mlir::failed(__mlir_ods_local_region_constraint_Ops1(*this, region, "region", index++)))
667 return ::mlir::failure();
668 }
669 return ::mlir::success();
670}
671
672::llvm::LogicalResult ForAllOp::verifyInvariants() {
673 if(::mlir::succeeded(verifyInvariantsImpl()) && ::mlir::succeeded(verify()))
674 return ::mlir::success();
675 return ::mlir::failure();
676}
677
678::llvm::LogicalResult ForAllOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) {
679 inferredReturnTypes.resize(1);
680 ::mlir::Builder odsBuilder(context);
681 ::mlir::Type odsInferredType0 = odsBuilder.getIntegerType(1);
682 inferredReturnTypes[0] = odsInferredType0;
683 return ::mlir::success();
684}
685
686::llvm::LogicalResult ForAllOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
687 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
688 if (!dict) {
689 emitError() << "expected DictionaryAttr to set properties";
690 return ::mlir::failure();
691 }
692 // keep track of used keys in the input dictionary to be able to error out
693 // if there are some unknown ones.
694 ::mlir::DenseSet<::mlir::StringAttr> usedKeys;
695 ::mlir::MLIRContext *ctx = dict.getContext();
696 (void)ctx;
697
698 for (::mlir::NamedAttribute attr : dict) {
699 if (!usedKeys.contains(attr.getName()))
700 return emitError() << "unknown key '" << attr.getName() <<
701 "' when parsing properties dictionary";
702 }
703 return ::mlir::success();
704}
705
706void ForAllOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
707}
708
709
710} // namespace llzk::boolean
711MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::boolean::ForAllOp)
712
713namespace llzk::boolean {
714
715
716//===----------------------------------------------------------------------===//
717// ::llzk::boolean::AndBoolOp definitions
718//===----------------------------------------------------------------------===//
719
720namespace detail {
721
722AndBoolOpGenericAdaptorBase::AndBoolOpGenericAdaptorBase(AndBoolOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
723
724
725} // namespace detail
727
728::llvm::LogicalResult AndBoolOpAdaptor::verify(::mlir::Location loc) {
729 return ::mlir::success();
730}
731
732::llvm::LogicalResult AndBoolOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
733 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
734 if (!dict) {
735 emitError() << "expected DictionaryAttr to set properties";
736 return ::mlir::failure();
737 }
738 return ::mlir::success();
739}
740
741::mlir::Attribute AndBoolOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
742 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
743 ::mlir::Builder odsBuilder{ctx};
744
745 if (!attrs.empty())
746 return odsBuilder.getDictionaryAttr(attrs);
747 return {};
748}
749
750llvm::hash_code AndBoolOp::computePropertiesHash(const Properties &prop) {
751 using llvm::hash_value;
752 return llvm::hash_combine();
753}
754
755std::optional<mlir::Attribute> AndBoolOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
756 return std::nullopt;
757}
758
759void AndBoolOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
760}
761
762void AndBoolOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
763}
764
765::llvm::LogicalResult AndBoolOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
766 return ::mlir::success();
767}
768
769void AndBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
770 odsState.addOperands(lhs);
771 odsState.addOperands(rhs);
772 odsState.addTypes(result);
773}
774
775AndBoolOp AndBoolOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
776 ::mlir::OperationState __state__(location, getOperationName());
777 build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
778 auto __res__ = ::llvm::dyn_cast<AndBoolOp>(builder.create(__state__));
779 assert(__res__ && "builder didn't return the right type");
780 return __res__;
781}
782
783AndBoolOp AndBoolOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
784 return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
785}
786
787void AndBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) {
788 odsState.addOperands(lhs);
789 odsState.addOperands(rhs);
790
791 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
792 if (::mlir::succeeded(AndBoolOp::inferReturnTypes(odsBuilder.getContext(),
793 odsState.location, odsState.operands,
794 odsState.attributes.getDictionary(odsState.getContext()),
795 odsState.getRawProperties(),
796 odsState.regions, inferredReturnTypes)))
797 odsState.addTypes(inferredReturnTypes);
798 else
799 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
800
801}
802
803AndBoolOp AndBoolOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs) {
804 ::mlir::OperationState __state__(location, getOperationName());
805 build(builder, __state__, std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
806 auto __res__ = ::llvm::dyn_cast<AndBoolOp>(builder.create(__state__));
807 assert(__res__ && "builder didn't return the right type");
808 return __res__;
809}
810
811AndBoolOp AndBoolOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs) {
812 return create(builder, builder.getLoc(), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
813}
814
815void AndBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
816 odsState.addOperands(lhs);
817 odsState.addOperands(rhs);
818 assert(resultTypes.size() == 1u && "mismatched number of results");
819 odsState.addTypes(resultTypes);
820}
821
822AndBoolOp AndBoolOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
823 ::mlir::OperationState __state__(location, getOperationName());
824 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
825 auto __res__ = ::llvm::dyn_cast<AndBoolOp>(builder.create(__state__));
826 assert(__res__ && "builder didn't return the right type");
827 return __res__;
828}
829
830AndBoolOp AndBoolOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
831 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
832}
833
834void AndBoolOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
835 assert(operands.size() == 2u && "mismatched number of parameters");
836 odsState.addOperands(operands);
837 odsState.addAttributes(attributes);
838 assert(resultTypes.size() == 1u && "mismatched number of return types");
839 odsState.addTypes(resultTypes);
840}
841
842AndBoolOp AndBoolOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
843 ::mlir::OperationState __state__(location, getOperationName());
844 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
845 auto __res__ = ::llvm::dyn_cast<AndBoolOp>(builder.create(__state__));
846 assert(__res__ && "builder didn't return the right type");
847 return __res__;
848}
849
850AndBoolOp AndBoolOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
851 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
852}
853
854void AndBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
855 assert(operands.size() == 2u && "mismatched number of parameters");
856 odsState.addOperands(operands);
857 odsState.addAttributes(attributes);
858
859 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
860 if (::mlir::succeeded(AndBoolOp::inferReturnTypes(odsBuilder.getContext(),
861 odsState.location, operands,
862 odsState.attributes.getDictionary(odsState.getContext()),
863 odsState.getRawProperties(),
864 odsState.regions, inferredReturnTypes))) {
865 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
866 odsState.addTypes(inferredReturnTypes);
867 } else {
868 ::llvm::report_fatal_error("Failed to infer result type(s).");
869 }
870}
871
872AndBoolOp AndBoolOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
873 ::mlir::OperationState __state__(location, getOperationName());
874 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
875 auto __res__ = ::llvm::dyn_cast<AndBoolOp>(builder.create(__state__));
876 assert(__res__ && "builder didn't return the right type");
877 return __res__;
878}
879
880AndBoolOp AndBoolOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
881 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
882}
883
884void AndBoolOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
885 assert(operands.size() == 2u && "mismatched number of parameters");
886 odsState.addOperands(operands);
887 odsState.useProperties(const_cast<Properties&>(properties));
888 odsState.addAttributes(discardableAttributes);
889 assert(resultTypes.size() == 1u && "mismatched number of return types");
890 odsState.addTypes(resultTypes);
891}
892
893AndBoolOp AndBoolOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
894 ::mlir::OperationState __state__(location, getOperationName());
895 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
896 auto __res__ = ::llvm::dyn_cast<AndBoolOp>(builder.create(__state__));
897 assert(__res__ && "builder didn't return the right type");
898 return __res__;
899}
900
901AndBoolOp AndBoolOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
902 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
903}
904
905void AndBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
906 assert(operands.size() == 2u && "mismatched number of parameters");
907 odsState.addOperands(operands);
908 odsState.useProperties(const_cast<Properties &>(properties));
909 odsState.addAttributes(discardableAttributes);
910
911 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
912 if (::mlir::succeeded(AndBoolOp::inferReturnTypes(odsBuilder.getContext(),
913 odsState.location, operands,
914 odsState.attributes.getDictionary(odsState.getContext()),
915 odsState.getRawProperties(),
916 odsState.regions, inferredReturnTypes))) {
917 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
918 odsState.addTypes(inferredReturnTypes);
919 } else {
920 ::llvm::report_fatal_error("Failed to infer result type(s).");
921 }
922}
923
924AndBoolOp AndBoolOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
925 ::mlir::OperationState __state__(location, getOperationName());
926 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
927 auto __res__ = ::llvm::dyn_cast<AndBoolOp>(builder.create(__state__));
928 assert(__res__ && "builder didn't return the right type");
929 return __res__;
930}
931
932AndBoolOp AndBoolOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
933 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
934}
935
936::llvm::LogicalResult AndBoolOp::verifyInvariantsImpl() {
937 {
938 unsigned index = 0; (void)index;
939 auto valueGroup0 = getODSOperands(0);
940
941 for (auto v : valueGroup0) {
942 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops3(*this, v.getType(), "operand", index++)))
943 return ::mlir::failure();
944 }
945 auto valueGroup1 = getODSOperands(1);
946
947 for (auto v : valueGroup1) {
948 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops3(*this, v.getType(), "operand", index++)))
949 return ::mlir::failure();
950 }
951 }
952 {
953 unsigned index = 0; (void)index;
954 auto valueGroup0 = getODSResults(0);
955
956 for (auto v : valueGroup0) {
957 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
958 return ::mlir::failure();
959 }
960 }
961 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
962 return emitOpError("failed to verify that result type matches with lhs type");
963 if (!((::llzk::typesUnify((*this->getODSOperands(1).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
964 return emitOpError("failed to verify that result type matches with rhs type");
965 return ::mlir::success();
966}
967
968::llvm::LogicalResult AndBoolOp::verifyInvariants() {
969 return verifyInvariantsImpl();
970}
971
972::llvm::LogicalResult AndBoolOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) {
973 inferredReturnTypes.resize(1);
974 ::mlir::Builder odsBuilder(context);
975 ::mlir::Type odsInferredType0 = odsBuilder.getIntegerType(1);
976 inferredReturnTypes[0] = odsInferredType0;
977 return ::mlir::success();
978}
979
980::mlir::ParseResult AndBoolOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
981 ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{};
982 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc;
983 (void)lhsOperandsLoc;
984 ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{};
985 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc;
986 (void)rhsOperandsLoc;
987 ::mlir::Type lhsRawType{};
988 ::llvm::ArrayRef<::mlir::Type> lhsTypes(&lhsRawType, 1);
989 ::mlir::Type rhsRawType{};
990 ::llvm::ArrayRef<::mlir::Type> rhsTypes(&rhsRawType, 1);
991
992 lhsOperandsLoc = parser.getCurrentLocation();
993 if (parser.parseOperand(lhsRawOperand))
994 return ::mlir::failure();
995 if (parser.parseComma())
996 return ::mlir::failure();
997
998 rhsOperandsLoc = parser.getCurrentLocation();
999 if (parser.parseOperand(rhsRawOperand))
1000 return ::mlir::failure();
1001 {
1002 auto odsResult = parseInferredOrParsedType(parser, lhsRawType, true);
1003 if (odsResult) return ::mlir::failure();
1004 }
1005 {
1006 auto odsResult = parseInferredOrParsedType(parser, rhsRawType, false);
1007 if (odsResult) return ::mlir::failure();
1008 }
1009 {
1010 auto loc = parser.getCurrentLocation();(void)loc;
1011 if (parser.parseOptionalAttrDict(result.attributes))
1012 return ::mlir::failure();
1013 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
1014 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
1015 })))
1016 return ::mlir::failure();
1017 }
1018 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIntegerType(1);
1019 result.addTypes(odsBuildableType0);
1020 if (parser.resolveOperands(lhsOperands, lhsTypes, lhsOperandsLoc, result.operands))
1021 return ::mlir::failure();
1022 if (parser.resolveOperands(rhsOperands, rhsTypes, rhsOperandsLoc, result.operands))
1023 return ::mlir::failure();
1024 return ::mlir::success();
1025}
1026
1027void AndBoolOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
1028 _odsPrinter << ' ';
1029 _odsPrinter << getLhs();
1030 _odsPrinter << ",";
1031 _odsPrinter << ' ';
1032 _odsPrinter << getRhs();
1033 printInferredOrParsedType(_odsPrinter, *this, getLhs().getType(), true);
1034 printInferredOrParsedType(_odsPrinter, *this, getRhs().getType(), false);
1035 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1036 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1037}
1038
1039void AndBoolOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
1040}
1041
1042
1043} // namespace llzk::boolean
1044MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::boolean::AndBoolOp)
1045
1046namespace llzk::boolean {
1047
1048
1049//===----------------------------------------------------------------------===//
1050// ::llzk::boolean::AssertOp definitions
1051//===----------------------------------------------------------------------===//
1052
1053namespace detail {
1054
1055AssertOpGenericAdaptorBase::AssertOpGenericAdaptorBase(AssertOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
1056
1057::std::optional< ::llvm::StringRef > AssertOpGenericAdaptorBase::getMsg() {
1058 auto attr = getMsgAttr();
1059 return attr ? ::std::optional< ::llvm::StringRef >(attr.getValue()) : (::std::nullopt);
1060}
1061
1062
1063} // namespace detail
1065
1066::llvm::LogicalResult AssertOpAdaptor::verify(::mlir::Location loc) {
1067 auto tblgen_msg = getProperties().msg; (void)tblgen_msg;
1068
1069 if (tblgen_msg && !((::llvm::isa<::mlir::StringAttr>(tblgen_msg))))
1070 return emitError(loc, "'bool.assert' op attribute 'msg' failed to satisfy constraint: string attribute");
1071 return ::mlir::success();
1072}
1073
1074::llvm::LogicalResult AssertOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
1075 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
1076 if (!dict) {
1077 emitError() << "expected DictionaryAttr to set properties";
1078 return ::mlir::failure();
1079 }
1080
1081 {
1082 auto &propStorage = prop.msg;
1083 auto attr = dict.get("msg");
1084 if (attr) {
1085 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
1086 if (convertedAttr) {
1087 propStorage = convertedAttr;
1088 } else {
1089 emitError() << "Invalid attribute `msg` in property conversion: " << attr;
1090 return ::mlir::failure();
1091 }
1092 }
1093 }
1094 return ::mlir::success();
1095}
1096
1097::mlir::Attribute AssertOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
1098 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
1099 ::mlir::Builder odsBuilder{ctx};
1100
1101 {
1102 const auto &propStorage = prop.msg;
1103 if (propStorage)
1104 attrs.push_back(odsBuilder.getNamedAttr("msg",
1105 propStorage));
1106 }
1107
1108 if (!attrs.empty())
1109 return odsBuilder.getDictionaryAttr(attrs);
1110 return {};
1111}
1112
1113llvm::hash_code AssertOp::computePropertiesHash(const Properties &prop) {
1114 using llvm::hash_value;
1115 return llvm::hash_combine(
1116 llvm::hash_value(prop.msg.getAsOpaquePointer()));
1117}
1118
1119std::optional<mlir::Attribute> AssertOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
1120 if (name == "msg")
1121 return prop.msg;
1122 return std::nullopt;
1123}
1124
1125void AssertOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
1126 if (name == "msg") {
1127 prop.msg = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.msg)>>(value);
1128 return;
1129 }
1130}
1131
1132void AssertOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
1133 if (prop.msg) attrs.append("msg", prop.msg);
1134}
1135
1136::llvm::LogicalResult AssertOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
1137 {
1138 ::mlir::Attribute attr = attrs.get(getMsgAttrName(opName));
1139 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(attr, "msg", emitError)))
1140 return ::mlir::failure();
1141 }
1142 return ::mlir::success();
1143}
1144
1145::llvm::LogicalResult AssertOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
1146 auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
1147 if (::mlir::failed(reader.readOptionalAttribute(prop.msg)))
1148 return ::mlir::failure();
1149 return ::mlir::success();
1150}
1151
1152void AssertOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
1153 auto &prop = getProperties(); (void)prop;
1154
1155 writer.writeOptionalAttribute(prop.msg);
1156}
1157
1158::std::optional< ::llvm::StringRef > AssertOp::getMsg() {
1159 auto attr = getMsgAttr();
1160 return attr ? ::std::optional< ::llvm::StringRef >(attr.getValue()) : (::std::nullopt);
1161}
1162
1163void AssertOp::setMsg(::std::optional<::llvm::StringRef> attrValue) {
1164 auto &odsProp = getProperties().msg;
1165 if (attrValue)
1166 odsProp = ::mlir::Builder((*this)->getContext()).getStringAttr(*attrValue);
1167 else
1168 odsProp = nullptr;
1169}
1170
1171void AssertOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value condition, /*optional*/::mlir::StringAttr msg) {
1172 odsState.addOperands(condition);
1173 if (msg) {
1174 odsState.getOrAddProperties<Properties>().msg = msg;
1175 }
1176}
1177
1178AssertOp AssertOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value condition, /*optional*/::mlir::StringAttr msg) {
1179 ::mlir::OperationState __state__(location, getOperationName());
1180 build(builder, __state__, std::forward<decltype(condition)>(condition), std::forward<decltype(msg)>(msg));
1181 auto __res__ = ::llvm::dyn_cast<AssertOp>(builder.create(__state__));
1182 assert(__res__ && "builder didn't return the right type");
1183 return __res__;
1184}
1185
1186AssertOp AssertOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value condition, /*optional*/::mlir::StringAttr msg) {
1187 return create(builder, builder.getLoc(), std::forward<decltype(condition)>(condition), std::forward<decltype(msg)>(msg));
1188}
1189
1190void AssertOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value condition, /*optional*/::mlir::StringAttr msg) {
1191 odsState.addOperands(condition);
1192 if (msg) {
1193 odsState.getOrAddProperties<Properties>().msg = msg;
1194 }
1195 assert(resultTypes.size() == 0u && "mismatched number of results");
1196 odsState.addTypes(resultTypes);
1197}
1198
1199AssertOp AssertOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value condition, /*optional*/::mlir::StringAttr msg) {
1200 ::mlir::OperationState __state__(location, getOperationName());
1201 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(condition)>(condition), std::forward<decltype(msg)>(msg));
1202 auto __res__ = ::llvm::dyn_cast<AssertOp>(builder.create(__state__));
1203 assert(__res__ && "builder didn't return the right type");
1204 return __res__;
1205}
1206
1207AssertOp AssertOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value condition, /*optional*/::mlir::StringAttr msg) {
1208 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(condition)>(condition), std::forward<decltype(msg)>(msg));
1209}
1210
1211void AssertOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1212 assert(operands.size() == 1u && "mismatched number of parameters");
1213 odsState.addOperands(operands);
1214 odsState.addAttributes(attributes);
1215 assert(resultTypes.size() == 0u && "mismatched number of return types");
1216 odsState.addTypes(resultTypes);
1217
1218 if (!attributes.empty()) {
1219 (void)odsState.getOrAddProperties<AssertOp::Properties>();
1220 ::mlir::PropertyRef properties = odsState.getRawProperties();
1221 std::optional<::mlir::RegisteredOperationName> info =
1222 odsState.name.getRegisteredInfo();
1223 if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
1224 odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
1225 ::llvm::report_fatal_error("Property conversion failed.");
1226 }
1227}
1228
1229AssertOp AssertOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1230 ::mlir::OperationState __state__(location, getOperationName());
1231 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
1232 auto __res__ = ::llvm::dyn_cast<AssertOp>(builder.create(__state__));
1233 assert(__res__ && "builder didn't return the right type");
1234 return __res__;
1235}
1236
1237AssertOp AssertOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1238 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
1239}
1240
1241void AssertOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1242 assert(operands.size() == 1u && "mismatched number of parameters");
1243 odsState.addOperands(operands);
1244 odsState.useProperties(const_cast<Properties&>(properties));
1245 odsState.addAttributes(discardableAttributes);
1246 assert(resultTypes.size() == 0u && "mismatched number of return types");
1247 odsState.addTypes(resultTypes);
1248}
1249
1250AssertOp AssertOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1251 ::mlir::OperationState __state__(location, getOperationName());
1252 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
1253 auto __res__ = ::llvm::dyn_cast<AssertOp>(builder.create(__state__));
1254 assert(__res__ && "builder didn't return the right type");
1255 return __res__;
1256}
1257
1258AssertOp AssertOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1259 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
1260}
1261
1262::llvm::LogicalResult AssertOp::verifyInvariantsImpl() {
1263 auto tblgen_msg = getProperties().msg; (void)tblgen_msg;
1264
1265 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(*this, tblgen_msg, "msg")))
1266 return ::mlir::failure();
1267 {
1268 unsigned index = 0; (void)index;
1269 auto valueGroup0 = getODSOperands(0);
1270
1271 for (auto v : valueGroup0) {
1272 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "operand", index++)))
1273 return ::mlir::failure();
1274 }
1275 }
1276 return ::mlir::success();
1277}
1278
1279::llvm::LogicalResult AssertOp::verifyInvariants() {
1280 return verifyInvariantsImpl();
1281}
1282
1283::mlir::ParseResult AssertOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
1284 ::mlir::OpAsmParser::UnresolvedOperand conditionRawOperand{};
1285 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> conditionOperands(&conditionRawOperand, 1); ::llvm::SMLoc conditionOperandsLoc;
1286 (void)conditionOperandsLoc;
1287 ::mlir::StringAttr msgAttr;
1288
1289 conditionOperandsLoc = parser.getCurrentLocation();
1290 if (parser.parseOperand(conditionRawOperand))
1291 return ::mlir::failure();
1292 if (::mlir::succeeded(parser.parseOptionalComma())) {
1293
1294 if (parser.parseCustomAttributeWithFallback(msgAttr, parser.getBuilder().getType<::mlir::NoneType>())) {
1295 return ::mlir::failure();
1296 }
1297 if (msgAttr) result.getOrAddProperties<AssertOp::Properties>().msg = msgAttr;
1298 }
1299 {
1300 auto loc = parser.getCurrentLocation();(void)loc;
1301 if (parser.parseOptionalAttrDict(result.attributes))
1302 return ::mlir::failure();
1303 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
1304 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
1305 })))
1306 return ::mlir::failure();
1307 }
1308 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIntegerType(1);
1309 if (parser.resolveOperands(conditionOperands, odsBuildableType0, conditionOperandsLoc, result.operands))
1310 return ::mlir::failure();
1311 return ::mlir::success();
1312}
1313
1314void AssertOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
1315 _odsPrinter << ' ';
1316 _odsPrinter << getCondition();
1317 if (getMsgAttr()) {
1318 _odsPrinter << ",";
1319 _odsPrinter << ' ';
1320 _odsPrinter.printAttributeWithoutType(getMsgAttr());
1321 }
1322 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1323 elidedAttrs.push_back("msg");
1324 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1325}
1326
1327
1328} // namespace llzk::boolean
1329MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::boolean::AssertOp)
1331
1332namespace llzk::boolean {
1333
1334
1335//===----------------------------------------------------------------------===//
1336// ::llzk::boolean::CmpOp definitions
1337//===----------------------------------------------------------------------===//
1338
1339namespace detail {
1340
1341CmpOpGenericAdaptorBase::CmpOpGenericAdaptorBase(CmpOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
1342
1344 auto attr = getPredicateAttr();
1345 return attr.getValue();
1346}
1347
1348
1349} // namespace detail
1351
1352::llvm::LogicalResult CmpOpAdaptor::verify(::mlir::Location loc) {
1353 auto tblgen_predicate = getProperties().predicate; (void)tblgen_predicate;
1354 if (!tblgen_predicate) return emitError(loc, "'bool.cmp' op requires attribute 'predicate'");
1355
1356 if (tblgen_predicate && !((::llvm::isa<::llzk::boolean::FeltCmpPredicateAttr>(tblgen_predicate))))
1357 return emitError(loc, "'bool.cmp' op attribute 'predicate' failed to satisfy constraint: Field element comparison predicate");
1358 return ::mlir::success();
1359}
1360
1361::llvm::LogicalResult CmpOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
1362 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
1363 if (!dict) {
1364 emitError() << "expected DictionaryAttr to set properties";
1365 return ::mlir::failure();
1366 }
1367
1368 {
1369 auto &propStorage = prop.predicate;
1370 auto attr = dict.get("predicate");
1371 if (attr) {
1372 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
1373 if (convertedAttr) {
1374 propStorage = convertedAttr;
1375 } else {
1376 emitError() << "Invalid attribute `predicate` in property conversion: " << attr;
1377 return ::mlir::failure();
1378 }
1379 }
1380 }
1381 return ::mlir::success();
1382}
1383
1384::mlir::Attribute CmpOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
1385 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
1386 ::mlir::Builder odsBuilder{ctx};
1387
1388 {
1389 const auto &propStorage = prop.predicate;
1390 if (propStorage)
1391 attrs.push_back(odsBuilder.getNamedAttr("predicate",
1392 propStorage));
1393 }
1394
1395 if (!attrs.empty())
1396 return odsBuilder.getDictionaryAttr(attrs);
1397 return {};
1398}
1399
1400llvm::hash_code CmpOp::computePropertiesHash(const Properties &prop) {
1401 using llvm::hash_value;
1402 return llvm::hash_combine(
1403 llvm::hash_value(prop.predicate.getAsOpaquePointer()));
1404}
1405
1406std::optional<mlir::Attribute> CmpOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
1407 if (name == "predicate")
1408 return prop.predicate;
1409 return std::nullopt;
1410}
1411
1412void CmpOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
1413 if (name == "predicate") {
1414 prop.predicate = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.predicate)>>(value);
1415 return;
1416 }
1417}
1418
1419void CmpOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
1420 if (prop.predicate) attrs.append("predicate", prop.predicate);
1421}
1422
1423::llvm::LogicalResult CmpOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
1424 {
1425 ::mlir::Attribute attr = attrs.get(getPredicateAttrName(opName));
1426 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops2(attr, "predicate", emitError)))
1427 return ::mlir::failure();
1428 }
1429 return ::mlir::success();
1430}
1431
1432::llvm::LogicalResult CmpOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
1433 auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
1434 if (::mlir::failed(reader.readAttribute(prop.predicate)))
1435 return ::mlir::failure();
1436 return ::mlir::success();
1437}
1438
1439void CmpOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
1440 auto &prop = getProperties(); (void)prop;
1441 writer.writeAttribute(prop.predicate);
1442}
1443
1445 auto attr = getPredicateAttr();
1446 return attr.getValue();
1447}
1448
1450 getProperties().predicate = ::llzk::boolean::FeltCmpPredicateAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
1451}
1452
1453void CmpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::llzk::boolean::FeltCmpPredicateAttr predicate, ::mlir::Value lhs, ::mlir::Value rhs) {
1454 odsState.addOperands(lhs);
1455 odsState.addOperands(rhs);
1456 odsState.getOrAddProperties<Properties>().predicate = predicate;
1457 odsState.addTypes(result);
1458}
1459
1460CmpOp CmpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::llzk::boolean::FeltCmpPredicateAttr predicate, ::mlir::Value lhs, ::mlir::Value rhs) {
1461 ::mlir::OperationState __state__(location, getOperationName());
1462 build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(predicate)>(predicate), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
1463 auto __res__ = ::llvm::dyn_cast<CmpOp>(builder.create(__state__));
1464 assert(__res__ && "builder didn't return the right type");
1465 return __res__;
1466}
1467
1468CmpOp CmpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::llzk::boolean::FeltCmpPredicateAttr predicate, ::mlir::Value lhs, ::mlir::Value rhs) {
1469 return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(predicate)>(predicate), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
1470}
1471
1472void CmpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llzk::boolean::FeltCmpPredicateAttr predicate, ::mlir::Value lhs, ::mlir::Value rhs) {
1473 odsState.addOperands(lhs);
1474 odsState.addOperands(rhs);
1475 odsState.getOrAddProperties<Properties>().predicate = predicate;
1476
1477 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1478 if (::mlir::succeeded(CmpOp::inferReturnTypes(odsBuilder.getContext(),
1479 odsState.location, odsState.operands,
1480 odsState.attributes.getDictionary(odsState.getContext()),
1481 odsState.getRawProperties(),
1482 odsState.regions, inferredReturnTypes)))
1483 odsState.addTypes(inferredReturnTypes);
1484 else
1485 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
1486
1487}
1488
1489CmpOp CmpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::llzk::boolean::FeltCmpPredicateAttr predicate, ::mlir::Value lhs, ::mlir::Value rhs) {
1490 ::mlir::OperationState __state__(location, getOperationName());
1491 build(builder, __state__, std::forward<decltype(predicate)>(predicate), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
1492 auto __res__ = ::llvm::dyn_cast<CmpOp>(builder.create(__state__));
1493 assert(__res__ && "builder didn't return the right type");
1494 return __res__;
1495}
1496
1497CmpOp CmpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::llzk::boolean::FeltCmpPredicateAttr predicate, ::mlir::Value lhs, ::mlir::Value rhs) {
1498 return create(builder, builder.getLoc(), std::forward<decltype(predicate)>(predicate), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
1499}
1500
1501void CmpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llzk::boolean::FeltCmpPredicateAttr predicate, ::mlir::Value lhs, ::mlir::Value rhs) {
1502 odsState.addOperands(lhs);
1503 odsState.addOperands(rhs);
1504 odsState.getOrAddProperties<Properties>().predicate = predicate;
1505 assert(resultTypes.size() == 1u && "mismatched number of results");
1506 odsState.addTypes(resultTypes);
1507}
1508
1509CmpOp CmpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::llzk::boolean::FeltCmpPredicateAttr predicate, ::mlir::Value lhs, ::mlir::Value rhs) {
1510 ::mlir::OperationState __state__(location, getOperationName());
1511 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(predicate)>(predicate), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
1512 auto __res__ = ::llvm::dyn_cast<CmpOp>(builder.create(__state__));
1513 assert(__res__ && "builder didn't return the right type");
1514 return __res__;
1515}
1516
1517CmpOp CmpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::llzk::boolean::FeltCmpPredicateAttr predicate, ::mlir::Value lhs, ::mlir::Value rhs) {
1518 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(predicate)>(predicate), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
1519}
1520
1521void CmpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::llzk::boolean::FeltCmpPredicate predicate, ::mlir::Value lhs, ::mlir::Value rhs) {
1522 odsState.addOperands(lhs);
1523 odsState.addOperands(rhs);
1524 odsState.getOrAddProperties<Properties>().predicate = ::llzk::boolean::FeltCmpPredicateAttr::get(odsBuilder.getContext(), predicate);
1525 odsState.addTypes(result);
1526}
1527
1528CmpOp CmpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::llzk::boolean::FeltCmpPredicate predicate, ::mlir::Value lhs, ::mlir::Value rhs) {
1529 ::mlir::OperationState __state__(location, getOperationName());
1530 build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(predicate)>(predicate), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
1531 auto __res__ = ::llvm::dyn_cast<CmpOp>(builder.create(__state__));
1532 assert(__res__ && "builder didn't return the right type");
1533 return __res__;
1534}
1535
1536CmpOp CmpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::llzk::boolean::FeltCmpPredicate predicate, ::mlir::Value lhs, ::mlir::Value rhs) {
1537 return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(predicate)>(predicate), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
1538}
1539
1540void CmpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llzk::boolean::FeltCmpPredicate predicate, ::mlir::Value lhs, ::mlir::Value rhs) {
1541 odsState.addOperands(lhs);
1542 odsState.addOperands(rhs);
1543 odsState.getOrAddProperties<Properties>().predicate = ::llzk::boolean::FeltCmpPredicateAttr::get(odsBuilder.getContext(), predicate);
1544
1545 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1546 if (::mlir::succeeded(CmpOp::inferReturnTypes(odsBuilder.getContext(),
1547 odsState.location, odsState.operands,
1548 odsState.attributes.getDictionary(odsState.getContext()),
1549 odsState.getRawProperties(),
1550 odsState.regions, inferredReturnTypes)))
1551 odsState.addTypes(inferredReturnTypes);
1552 else
1553 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
1554
1555}
1556
1557CmpOp CmpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::llzk::boolean::FeltCmpPredicate predicate, ::mlir::Value lhs, ::mlir::Value rhs) {
1558 ::mlir::OperationState __state__(location, getOperationName());
1559 build(builder, __state__, std::forward<decltype(predicate)>(predicate), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
1560 auto __res__ = ::llvm::dyn_cast<CmpOp>(builder.create(__state__));
1561 assert(__res__ && "builder didn't return the right type");
1562 return __res__;
1563}
1564
1565CmpOp CmpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::llzk::boolean::FeltCmpPredicate predicate, ::mlir::Value lhs, ::mlir::Value rhs) {
1566 return create(builder, builder.getLoc(), std::forward<decltype(predicate)>(predicate), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
1567}
1568
1569void CmpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llzk::boolean::FeltCmpPredicate predicate, ::mlir::Value lhs, ::mlir::Value rhs) {
1570 odsState.addOperands(lhs);
1571 odsState.addOperands(rhs);
1572 odsState.getOrAddProperties<Properties>().predicate = ::llzk::boolean::FeltCmpPredicateAttr::get(odsBuilder.getContext(), predicate);
1573 assert(resultTypes.size() == 1u && "mismatched number of results");
1574 odsState.addTypes(resultTypes);
1575}
1576
1577CmpOp CmpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::llzk::boolean::FeltCmpPredicate predicate, ::mlir::Value lhs, ::mlir::Value rhs) {
1578 ::mlir::OperationState __state__(location, getOperationName());
1579 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(predicate)>(predicate), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
1580 auto __res__ = ::llvm::dyn_cast<CmpOp>(builder.create(__state__));
1581 assert(__res__ && "builder didn't return the right type");
1582 return __res__;
1583}
1584
1585CmpOp CmpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::llzk::boolean::FeltCmpPredicate predicate, ::mlir::Value lhs, ::mlir::Value rhs) {
1586 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(predicate)>(predicate), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
1587}
1588
1589void CmpOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1590 assert(operands.size() == 2u && "mismatched number of parameters");
1591 odsState.addOperands(operands);
1592 odsState.addAttributes(attributes);
1593 assert(resultTypes.size() == 1u && "mismatched number of return types");
1594 odsState.addTypes(resultTypes);
1595
1596 if (!attributes.empty()) {
1597 (void)odsState.getOrAddProperties<CmpOp::Properties>();
1598 ::mlir::PropertyRef properties = odsState.getRawProperties();
1599 std::optional<::mlir::RegisteredOperationName> info =
1600 odsState.name.getRegisteredInfo();
1601 if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
1602 odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
1603 ::llvm::report_fatal_error("Property conversion failed.");
1604 }
1605}
1606
1607CmpOp CmpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1608 ::mlir::OperationState __state__(location, getOperationName());
1609 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
1610 auto __res__ = ::llvm::dyn_cast<CmpOp>(builder.create(__state__));
1611 assert(__res__ && "builder didn't return the right type");
1612 return __res__;
1613}
1614
1615CmpOp CmpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1616 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
1617}
1618
1619void CmpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1620 assert(operands.size() == 2u && "mismatched number of parameters");
1621 odsState.addOperands(operands);
1622 odsState.addAttributes(attributes);
1623
1624 if (!attributes.empty()) {
1625 (void)odsState.getOrAddProperties<CmpOp::Properties>();
1626 ::mlir::PropertyRef properties = odsState.getRawProperties();
1627 std::optional<::mlir::RegisteredOperationName> info =
1628 odsState.name.getRegisteredInfo();
1629 if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
1630 odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
1631 ::llvm::report_fatal_error("Property conversion failed.");
1632 }
1633 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1634 if (::mlir::succeeded(CmpOp::inferReturnTypes(odsBuilder.getContext(),
1635 odsState.location, operands,
1636 odsState.attributes.getDictionary(odsState.getContext()),
1637 odsState.getRawProperties(),
1638 odsState.regions, inferredReturnTypes))) {
1639 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
1640 odsState.addTypes(inferredReturnTypes);
1641 } else {
1642 ::llvm::report_fatal_error("Failed to infer result type(s).");
1643 }
1644}
1645
1646CmpOp CmpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1647 ::mlir::OperationState __state__(location, getOperationName());
1648 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
1649 auto __res__ = ::llvm::dyn_cast<CmpOp>(builder.create(__state__));
1650 assert(__res__ && "builder didn't return the right type");
1651 return __res__;
1652}
1653
1654CmpOp CmpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1655 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
1656}
1657
1658void CmpOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1659 assert(operands.size() == 2u && "mismatched number of parameters");
1660 odsState.addOperands(operands);
1661 odsState.useProperties(const_cast<Properties&>(properties));
1662 odsState.addAttributes(discardableAttributes);
1663 assert(resultTypes.size() == 1u && "mismatched number of return types");
1664 odsState.addTypes(resultTypes);
1665}
1666
1667CmpOp CmpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1668 ::mlir::OperationState __state__(location, getOperationName());
1669 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
1670 auto __res__ = ::llvm::dyn_cast<CmpOp>(builder.create(__state__));
1671 assert(__res__ && "builder didn't return the right type");
1672 return __res__;
1673}
1674
1675CmpOp CmpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1676 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
1677}
1678
1679void CmpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1680 assert(operands.size() == 2u && "mismatched number of parameters");
1681 odsState.addOperands(operands);
1682 odsState.useProperties(const_cast<Properties &>(properties));
1683 odsState.addAttributes(discardableAttributes);
1684
1685 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1686 if (::mlir::succeeded(CmpOp::inferReturnTypes(odsBuilder.getContext(),
1687 odsState.location, operands,
1688 odsState.attributes.getDictionary(odsState.getContext()),
1689 odsState.getRawProperties(),
1690 odsState.regions, inferredReturnTypes))) {
1691 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
1692 odsState.addTypes(inferredReturnTypes);
1693 } else {
1694 ::llvm::report_fatal_error("Failed to infer result type(s).");
1695 }
1696}
1697
1698CmpOp CmpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1699 ::mlir::OperationState __state__(location, getOperationName());
1700 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
1701 auto __res__ = ::llvm::dyn_cast<CmpOp>(builder.create(__state__));
1702 assert(__res__ && "builder didn't return the right type");
1703 return __res__;
1704}
1705
1706CmpOp CmpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1707 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
1708}
1709
1710::llvm::LogicalResult CmpOp::verifyInvariantsImpl() {
1711 auto tblgen_predicate = getProperties().predicate; (void)tblgen_predicate;
1712 if (!tblgen_predicate) return emitOpError("requires attribute 'predicate'");
1713
1714 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops2(*this, tblgen_predicate, "predicate")))
1715 return ::mlir::failure();
1716 {
1717 unsigned index = 0; (void)index;
1718 auto valueGroup0 = getODSOperands(0);
1719
1720 for (auto v : valueGroup0) {
1721 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops4(*this, v.getType(), "operand", index++)))
1722 return ::mlir::failure();
1723 }
1724 auto valueGroup1 = getODSOperands(1);
1725
1726 for (auto v : valueGroup1) {
1727 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops4(*this, v.getType(), "operand", index++)))
1728 return ::mlir::failure();
1729 }
1730 }
1731 {
1732 unsigned index = 0; (void)index;
1733 auto valueGroup0 = getODSResults(0);
1734
1735 for (auto v : valueGroup0) {
1736 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
1737 return ::mlir::failure();
1738 }
1739 }
1740 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSOperands(1).begin()).getType()))))
1741 return emitOpError("failed to verify that rhs type matches with lhs type");
1742 return ::mlir::success();
1743}
1744
1745::llvm::LogicalResult CmpOp::verifyInvariants() {
1746 return verifyInvariantsImpl();
1747}
1748
1749::llvm::LogicalResult CmpOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) {
1750 inferredReturnTypes.resize(1);
1751 ::mlir::Builder odsBuilder(context);
1752 ::mlir::Type odsInferredType0 = odsBuilder.getIntegerType(1);
1753 inferredReturnTypes[0] = odsInferredType0;
1754 return ::mlir::success();
1755}
1756
1757::mlir::ParseResult CmpOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
1758 ::llzk::boolean::FeltCmpPredicateAttr predicateAttr;
1759 ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{};
1760 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc;
1761 (void)lhsOperandsLoc;
1762 ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{};
1763 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc;
1764 (void)rhsOperandsLoc;
1765 ::mlir::Type lhsRawType{};
1766 ::llvm::ArrayRef<::mlir::Type> lhsTypes(&lhsRawType, 1);
1767 ::mlir::Type rhsRawType{};
1768 ::llvm::ArrayRef<::mlir::Type> rhsTypes(&rhsRawType, 1);
1769
1770 if (parser.parseCustomAttributeWithFallback(predicateAttr, ::mlir::Type{})) {
1771 return ::mlir::failure();
1772 }
1773 if (predicateAttr) result.getOrAddProperties<CmpOp::Properties>().predicate = predicateAttr;
1774 if (parser.parseLParen())
1775 return ::mlir::failure();
1776
1777 lhsOperandsLoc = parser.getCurrentLocation();
1778 if (parser.parseOperand(lhsRawOperand))
1779 return ::mlir::failure();
1780 if (parser.parseComma())
1781 return ::mlir::failure();
1782
1783 rhsOperandsLoc = parser.getCurrentLocation();
1784 if (parser.parseOperand(rhsRawOperand))
1785 return ::mlir::failure();
1786 if (parser.parseRParen())
1787 return ::mlir::failure();
1788 {
1789 auto odsResult = parseInferredOrParsedType(parser, lhsRawType, true);
1790 if (odsResult) return ::mlir::failure();
1791 }
1792 {
1793 auto odsResult = parseInferredOrParsedType(parser, rhsRawType, false);
1794 if (odsResult) return ::mlir::failure();
1795 }
1796 {
1797 auto loc = parser.getCurrentLocation();(void)loc;
1798 if (parser.parseOptionalAttrDict(result.attributes))
1799 return ::mlir::failure();
1800 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
1801 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
1802 })))
1803 return ::mlir::failure();
1804 }
1805 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIntegerType(1);
1806 result.addTypes(odsBuildableType0);
1807 if (parser.resolveOperands(lhsOperands, lhsTypes, lhsOperandsLoc, result.operands))
1808 return ::mlir::failure();
1809 if (parser.resolveOperands(rhsOperands, rhsTypes, rhsOperandsLoc, result.operands))
1810 return ::mlir::failure();
1811 return ::mlir::success();
1812}
1813
1814void CmpOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
1815 _odsPrinter << ' ';
1816_odsPrinter.printStrippedAttrOrType(getPredicateAttr());
1817 _odsPrinter << "(";
1818 _odsPrinter << getLhs();
1819 _odsPrinter << ",";
1820 _odsPrinter << ' ';
1821 _odsPrinter << getRhs();
1822 _odsPrinter << ")";
1823 printInferredOrParsedType(_odsPrinter, *this, getLhs().getType(), true);
1824 printInferredOrParsedType(_odsPrinter, *this, getRhs().getType(), false);
1825 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1826 elidedAttrs.push_back("predicate");
1827 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1828}
1829
1830void CmpOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
1831}
1832
1833
1834} // namespace llzk::boolean
1835MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::boolean::CmpOp)
1837
1838namespace llzk::boolean {
1839
1840
1841//===----------------------------------------------------------------------===//
1842// ::llzk::boolean::NotBoolOp definitions
1843//===----------------------------------------------------------------------===//
1844
1845namespace detail {
1846
1847NotBoolOpGenericAdaptorBase::NotBoolOpGenericAdaptorBase(NotBoolOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
1848
1849
1850} // namespace detail
1852
1853::llvm::LogicalResult NotBoolOpAdaptor::verify(::mlir::Location loc) {
1854 return ::mlir::success();
1855}
1856
1857::llvm::LogicalResult NotBoolOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
1858 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
1859 if (!dict) {
1860 emitError() << "expected DictionaryAttr to set properties";
1861 return ::mlir::failure();
1862 }
1863 return ::mlir::success();
1864}
1865
1866::mlir::Attribute NotBoolOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
1867 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
1868 ::mlir::Builder odsBuilder{ctx};
1869
1870 if (!attrs.empty())
1871 return odsBuilder.getDictionaryAttr(attrs);
1872 return {};
1873}
1874
1875llvm::hash_code NotBoolOp::computePropertiesHash(const Properties &prop) {
1876 using llvm::hash_value;
1877 return llvm::hash_combine();
1878}
1879
1880std::optional<mlir::Attribute> NotBoolOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
1881 return std::nullopt;
1882}
1883
1884void NotBoolOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
1885}
1886
1887void NotBoolOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
1888}
1889
1890::llvm::LogicalResult NotBoolOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
1891 return ::mlir::success();
1892}
1893
1894void NotBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value operand) {
1895 odsState.addOperands(operand);
1896 odsState.addTypes(result);
1897}
1898
1899NotBoolOp NotBoolOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value operand) {
1900 ::mlir::OperationState __state__(location, getOperationName());
1901 build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(operand)>(operand));
1902 auto __res__ = ::llvm::dyn_cast<NotBoolOp>(builder.create(__state__));
1903 assert(__res__ && "builder didn't return the right type");
1904 return __res__;
1905}
1906
1907NotBoolOp NotBoolOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value operand) {
1908 return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(operand)>(operand));
1909}
1910
1911void NotBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value operand) {
1912 odsState.addOperands(operand);
1913
1914 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1915 if (::mlir::succeeded(NotBoolOp::inferReturnTypes(odsBuilder.getContext(),
1916 odsState.location, odsState.operands,
1917 odsState.attributes.getDictionary(odsState.getContext()),
1918 odsState.getRawProperties(),
1919 odsState.regions, inferredReturnTypes)))
1920 odsState.addTypes(inferredReturnTypes);
1921 else
1922 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
1923
1924}
1925
1926NotBoolOp NotBoolOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value operand) {
1927 ::mlir::OperationState __state__(location, getOperationName());
1928 build(builder, __state__, std::forward<decltype(operand)>(operand));
1929 auto __res__ = ::llvm::dyn_cast<NotBoolOp>(builder.create(__state__));
1930 assert(__res__ && "builder didn't return the right type");
1931 return __res__;
1932}
1933
1934NotBoolOp NotBoolOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value operand) {
1935 return create(builder, builder.getLoc(), std::forward<decltype(operand)>(operand));
1936}
1937
1938void NotBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value operand) {
1939 odsState.addOperands(operand);
1940 assert(resultTypes.size() == 1u && "mismatched number of results");
1941 odsState.addTypes(resultTypes);
1942}
1943
1944NotBoolOp NotBoolOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value operand) {
1945 ::mlir::OperationState __state__(location, getOperationName());
1946 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operand)>(operand));
1947 auto __res__ = ::llvm::dyn_cast<NotBoolOp>(builder.create(__state__));
1948 assert(__res__ && "builder didn't return the right type");
1949 return __res__;
1950}
1951
1952NotBoolOp NotBoolOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value operand) {
1953 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operand)>(operand));
1954}
1955
1956void NotBoolOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1957 assert(operands.size() == 1u && "mismatched number of parameters");
1958 odsState.addOperands(operands);
1959 odsState.addAttributes(attributes);
1960 assert(resultTypes.size() == 1u && "mismatched number of return types");
1961 odsState.addTypes(resultTypes);
1962}
1963
1964NotBoolOp NotBoolOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1965 ::mlir::OperationState __state__(location, getOperationName());
1966 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
1967 auto __res__ = ::llvm::dyn_cast<NotBoolOp>(builder.create(__state__));
1968 assert(__res__ && "builder didn't return the right type");
1969 return __res__;
1970}
1971
1972NotBoolOp NotBoolOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1973 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
1974}
1975
1976void NotBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1977 assert(operands.size() == 1u && "mismatched number of parameters");
1978 odsState.addOperands(operands);
1979 odsState.addAttributes(attributes);
1980
1981 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1982 if (::mlir::succeeded(NotBoolOp::inferReturnTypes(odsBuilder.getContext(),
1983 odsState.location, operands,
1984 odsState.attributes.getDictionary(odsState.getContext()),
1985 odsState.getRawProperties(),
1986 odsState.regions, inferredReturnTypes))) {
1987 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
1988 odsState.addTypes(inferredReturnTypes);
1989 } else {
1990 ::llvm::report_fatal_error("Failed to infer result type(s).");
1991 }
1992}
1993
1994NotBoolOp NotBoolOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1995 ::mlir::OperationState __state__(location, getOperationName());
1996 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
1997 auto __res__ = ::llvm::dyn_cast<NotBoolOp>(builder.create(__state__));
1998 assert(__res__ && "builder didn't return the right type");
1999 return __res__;
2000}
2001
2002NotBoolOp NotBoolOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2003 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
2004}
2005
2006void NotBoolOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2007 assert(operands.size() == 1u && "mismatched number of parameters");
2008 odsState.addOperands(operands);
2009 odsState.useProperties(const_cast<Properties&>(properties));
2010 odsState.addAttributes(discardableAttributes);
2011 assert(resultTypes.size() == 1u && "mismatched number of return types");
2012 odsState.addTypes(resultTypes);
2013}
2014
2015NotBoolOp NotBoolOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2016 ::mlir::OperationState __state__(location, getOperationName());
2017 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
2018 auto __res__ = ::llvm::dyn_cast<NotBoolOp>(builder.create(__state__));
2019 assert(__res__ && "builder didn't return the right type");
2020 return __res__;
2021}
2022
2023NotBoolOp NotBoolOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2024 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
2025}
2026
2027void NotBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2028 assert(operands.size() == 1u && "mismatched number of parameters");
2029 odsState.addOperands(operands);
2030 odsState.useProperties(const_cast<Properties &>(properties));
2031 odsState.addAttributes(discardableAttributes);
2032
2033 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
2034 if (::mlir::succeeded(NotBoolOp::inferReturnTypes(odsBuilder.getContext(),
2035 odsState.location, operands,
2036 odsState.attributes.getDictionary(odsState.getContext()),
2037 odsState.getRawProperties(),
2038 odsState.regions, inferredReturnTypes))) {
2039 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
2040 odsState.addTypes(inferredReturnTypes);
2041 } else {
2042 ::llvm::report_fatal_error("Failed to infer result type(s).");
2043 }
2044}
2045
2046NotBoolOp NotBoolOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2047 ::mlir::OperationState __state__(location, getOperationName());
2048 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
2049 auto __res__ = ::llvm::dyn_cast<NotBoolOp>(builder.create(__state__));
2050 assert(__res__ && "builder didn't return the right type");
2051 return __res__;
2052}
2053
2054NotBoolOp NotBoolOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2055 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
2056}
2057
2058::llvm::LogicalResult NotBoolOp::verifyInvariantsImpl() {
2059 {
2060 unsigned index = 0; (void)index;
2061 auto valueGroup0 = getODSOperands(0);
2062
2063 for (auto v : valueGroup0) {
2064 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops3(*this, v.getType(), "operand", index++)))
2065 return ::mlir::failure();
2066 }
2067 }
2068 {
2069 unsigned index = 0; (void)index;
2070 auto valueGroup0 = getODSResults(0);
2071
2072 for (auto v : valueGroup0) {
2073 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
2074 return ::mlir::failure();
2075 }
2076 }
2077 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
2078 return emitOpError("failed to verify that result type matches with operand type");
2079 return ::mlir::success();
2080}
2081
2082::llvm::LogicalResult NotBoolOp::verifyInvariants() {
2083 return verifyInvariantsImpl();
2084}
2085
2086::llvm::LogicalResult NotBoolOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) {
2087 inferredReturnTypes.resize(1);
2088 ::mlir::Builder odsBuilder(context);
2089 ::mlir::Type odsInferredType0 = odsBuilder.getIntegerType(1);
2090 inferredReturnTypes[0] = odsInferredType0;
2091 return ::mlir::success();
2092}
2093
2094::mlir::ParseResult NotBoolOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
2095 ::mlir::OpAsmParser::UnresolvedOperand operandRawOperand{};
2096 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> operandOperands(&operandRawOperand, 1); ::llvm::SMLoc operandOperandsLoc;
2097 (void)operandOperandsLoc;
2098 ::mlir::Type operandRawType{};
2099 ::llvm::ArrayRef<::mlir::Type> operandTypes(&operandRawType, 1);
2100
2101 operandOperandsLoc = parser.getCurrentLocation();
2102 if (parser.parseOperand(operandRawOperand))
2103 return ::mlir::failure();
2104 {
2105 auto odsResult = parseInferredOrParsedType(parser, operandRawType, true);
2106 if (odsResult) return ::mlir::failure();
2107 }
2108 {
2109 auto loc = parser.getCurrentLocation();(void)loc;
2110 if (parser.parseOptionalAttrDict(result.attributes))
2111 return ::mlir::failure();
2112 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
2113 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
2114 })))
2115 return ::mlir::failure();
2116 }
2117 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIntegerType(1);
2118 result.addTypes(odsBuildableType0);
2119 if (parser.resolveOperands(operandOperands, operandTypes, operandOperandsLoc, result.operands))
2120 return ::mlir::failure();
2121 return ::mlir::success();
2122}
2123
2124void NotBoolOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
2125 _odsPrinter << ' ';
2126 _odsPrinter << getOperand();
2127 printInferredOrParsedType(_odsPrinter, *this, getOperand().getType(), true);
2128 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
2129 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
2130}
2131
2132void NotBoolOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
2133}
2134
2135
2136} // namespace llzk::boolean
2137MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::boolean::NotBoolOp)
2138
2139namespace llzk::boolean {
2140
2141
2142//===----------------------------------------------------------------------===//
2143// ::llzk::boolean::OrBoolOp definitions
2144//===----------------------------------------------------------------------===//
2145
2146namespace detail {
2147
2148OrBoolOpGenericAdaptorBase::OrBoolOpGenericAdaptorBase(OrBoolOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
2149
2150
2151} // namespace detail
2153
2154::llvm::LogicalResult OrBoolOpAdaptor::verify(::mlir::Location loc) {
2155 return ::mlir::success();
2156}
2157
2158::llvm::LogicalResult OrBoolOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
2159 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
2160 if (!dict) {
2161 emitError() << "expected DictionaryAttr to set properties";
2162 return ::mlir::failure();
2163 }
2164 return ::mlir::success();
2165}
2166
2167::mlir::Attribute OrBoolOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
2168 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
2169 ::mlir::Builder odsBuilder{ctx};
2170
2171 if (!attrs.empty())
2172 return odsBuilder.getDictionaryAttr(attrs);
2173 return {};
2174}
2175
2176llvm::hash_code OrBoolOp::computePropertiesHash(const Properties &prop) {
2177 using llvm::hash_value;
2178 return llvm::hash_combine();
2179}
2180
2181std::optional<mlir::Attribute> OrBoolOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
2182 return std::nullopt;
2183}
2184
2185void OrBoolOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
2186}
2187
2188void OrBoolOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
2189}
2190
2191::llvm::LogicalResult OrBoolOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
2192 return ::mlir::success();
2193}
2194
2195void OrBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
2196 odsState.addOperands(lhs);
2197 odsState.addOperands(rhs);
2198 odsState.addTypes(result);
2199}
2200
2201OrBoolOp OrBoolOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
2202 ::mlir::OperationState __state__(location, getOperationName());
2203 build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
2204 auto __res__ = ::llvm::dyn_cast<OrBoolOp>(builder.create(__state__));
2205 assert(__res__ && "builder didn't return the right type");
2206 return __res__;
2207}
2208
2209OrBoolOp OrBoolOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
2210 return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
2211}
2212
2213void OrBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) {
2214 odsState.addOperands(lhs);
2215 odsState.addOperands(rhs);
2216
2217 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
2218 if (::mlir::succeeded(OrBoolOp::inferReturnTypes(odsBuilder.getContext(),
2219 odsState.location, odsState.operands,
2220 odsState.attributes.getDictionary(odsState.getContext()),
2221 odsState.getRawProperties(),
2222 odsState.regions, inferredReturnTypes)))
2223 odsState.addTypes(inferredReturnTypes);
2224 else
2225 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
2226
2227}
2228
2229OrBoolOp OrBoolOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs) {
2230 ::mlir::OperationState __state__(location, getOperationName());
2231 build(builder, __state__, std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
2232 auto __res__ = ::llvm::dyn_cast<OrBoolOp>(builder.create(__state__));
2233 assert(__res__ && "builder didn't return the right type");
2234 return __res__;
2235}
2236
2237OrBoolOp OrBoolOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs) {
2238 return create(builder, builder.getLoc(), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
2239}
2240
2241void OrBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
2242 odsState.addOperands(lhs);
2243 odsState.addOperands(rhs);
2244 assert(resultTypes.size() == 1u && "mismatched number of results");
2245 odsState.addTypes(resultTypes);
2246}
2247
2248OrBoolOp OrBoolOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
2249 ::mlir::OperationState __state__(location, getOperationName());
2250 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
2251 auto __res__ = ::llvm::dyn_cast<OrBoolOp>(builder.create(__state__));
2252 assert(__res__ && "builder didn't return the right type");
2253 return __res__;
2254}
2255
2256OrBoolOp OrBoolOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
2257 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
2258}
2259
2260void OrBoolOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2261 assert(operands.size() == 2u && "mismatched number of parameters");
2262 odsState.addOperands(operands);
2263 odsState.addAttributes(attributes);
2264 assert(resultTypes.size() == 1u && "mismatched number of return types");
2265 odsState.addTypes(resultTypes);
2266}
2267
2268OrBoolOp OrBoolOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2269 ::mlir::OperationState __state__(location, getOperationName());
2270 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
2271 auto __res__ = ::llvm::dyn_cast<OrBoolOp>(builder.create(__state__));
2272 assert(__res__ && "builder didn't return the right type");
2273 return __res__;
2274}
2275
2276OrBoolOp OrBoolOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2277 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
2278}
2279
2280void OrBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2281 assert(operands.size() == 2u && "mismatched number of parameters");
2282 odsState.addOperands(operands);
2283 odsState.addAttributes(attributes);
2284
2285 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
2286 if (::mlir::succeeded(OrBoolOp::inferReturnTypes(odsBuilder.getContext(),
2287 odsState.location, operands,
2288 odsState.attributes.getDictionary(odsState.getContext()),
2289 odsState.getRawProperties(),
2290 odsState.regions, inferredReturnTypes))) {
2291 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
2292 odsState.addTypes(inferredReturnTypes);
2293 } else {
2294 ::llvm::report_fatal_error("Failed to infer result type(s).");
2295 }
2296}
2297
2298OrBoolOp OrBoolOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2299 ::mlir::OperationState __state__(location, getOperationName());
2300 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
2301 auto __res__ = ::llvm::dyn_cast<OrBoolOp>(builder.create(__state__));
2302 assert(__res__ && "builder didn't return the right type");
2303 return __res__;
2304}
2305
2306OrBoolOp OrBoolOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2307 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
2308}
2309
2310void OrBoolOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2311 assert(operands.size() == 2u && "mismatched number of parameters");
2312 odsState.addOperands(operands);
2313 odsState.useProperties(const_cast<Properties&>(properties));
2314 odsState.addAttributes(discardableAttributes);
2315 assert(resultTypes.size() == 1u && "mismatched number of return types");
2316 odsState.addTypes(resultTypes);
2317}
2318
2319OrBoolOp OrBoolOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2320 ::mlir::OperationState __state__(location, getOperationName());
2321 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
2322 auto __res__ = ::llvm::dyn_cast<OrBoolOp>(builder.create(__state__));
2323 assert(__res__ && "builder didn't return the right type");
2324 return __res__;
2325}
2326
2327OrBoolOp OrBoolOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2328 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
2329}
2330
2331void OrBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2332 assert(operands.size() == 2u && "mismatched number of parameters");
2333 odsState.addOperands(operands);
2334 odsState.useProperties(const_cast<Properties &>(properties));
2335 odsState.addAttributes(discardableAttributes);
2336
2337 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
2338 if (::mlir::succeeded(OrBoolOp::inferReturnTypes(odsBuilder.getContext(),
2339 odsState.location, operands,
2340 odsState.attributes.getDictionary(odsState.getContext()),
2341 odsState.getRawProperties(),
2342 odsState.regions, inferredReturnTypes))) {
2343 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
2344 odsState.addTypes(inferredReturnTypes);
2345 } else {
2346 ::llvm::report_fatal_error("Failed to infer result type(s).");
2347 }
2348}
2349
2350OrBoolOp OrBoolOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2351 ::mlir::OperationState __state__(location, getOperationName());
2352 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
2353 auto __res__ = ::llvm::dyn_cast<OrBoolOp>(builder.create(__state__));
2354 assert(__res__ && "builder didn't return the right type");
2355 return __res__;
2356}
2357
2358OrBoolOp OrBoolOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2359 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
2360}
2361
2362::llvm::LogicalResult OrBoolOp::verifyInvariantsImpl() {
2363 {
2364 unsigned index = 0; (void)index;
2365 auto valueGroup0 = getODSOperands(0);
2366
2367 for (auto v : valueGroup0) {
2368 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops3(*this, v.getType(), "operand", index++)))
2369 return ::mlir::failure();
2370 }
2371 auto valueGroup1 = getODSOperands(1);
2372
2373 for (auto v : valueGroup1) {
2374 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops3(*this, v.getType(), "operand", index++)))
2375 return ::mlir::failure();
2376 }
2377 }
2378 {
2379 unsigned index = 0; (void)index;
2380 auto valueGroup0 = getODSResults(0);
2381
2382 for (auto v : valueGroup0) {
2383 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
2384 return ::mlir::failure();
2385 }
2386 }
2387 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
2388 return emitOpError("failed to verify that result type matches with lhs type");
2389 if (!((::llzk::typesUnify((*this->getODSOperands(1).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
2390 return emitOpError("failed to verify that result type matches with rhs type");
2391 return ::mlir::success();
2392}
2393
2394::llvm::LogicalResult OrBoolOp::verifyInvariants() {
2395 return verifyInvariantsImpl();
2396}
2397
2398::llvm::LogicalResult OrBoolOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) {
2399 inferredReturnTypes.resize(1);
2400 ::mlir::Builder odsBuilder(context);
2401 ::mlir::Type odsInferredType0 = odsBuilder.getIntegerType(1);
2402 inferredReturnTypes[0] = odsInferredType0;
2403 return ::mlir::success();
2404}
2405
2406::mlir::ParseResult OrBoolOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
2407 ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{};
2408 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc;
2409 (void)lhsOperandsLoc;
2410 ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{};
2411 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc;
2412 (void)rhsOperandsLoc;
2413 ::mlir::Type lhsRawType{};
2414 ::llvm::ArrayRef<::mlir::Type> lhsTypes(&lhsRawType, 1);
2415 ::mlir::Type rhsRawType{};
2416 ::llvm::ArrayRef<::mlir::Type> rhsTypes(&rhsRawType, 1);
2417
2418 lhsOperandsLoc = parser.getCurrentLocation();
2419 if (parser.parseOperand(lhsRawOperand))
2420 return ::mlir::failure();
2421 if (parser.parseComma())
2422 return ::mlir::failure();
2423
2424 rhsOperandsLoc = parser.getCurrentLocation();
2425 if (parser.parseOperand(rhsRawOperand))
2426 return ::mlir::failure();
2427 {
2428 auto odsResult = parseInferredOrParsedType(parser, lhsRawType, true);
2429 if (odsResult) return ::mlir::failure();
2430 }
2431 {
2432 auto odsResult = parseInferredOrParsedType(parser, rhsRawType, false);
2433 if (odsResult) return ::mlir::failure();
2434 }
2435 {
2436 auto loc = parser.getCurrentLocation();(void)loc;
2437 if (parser.parseOptionalAttrDict(result.attributes))
2438 return ::mlir::failure();
2439 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
2440 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
2441 })))
2442 return ::mlir::failure();
2443 }
2444 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIntegerType(1);
2445 result.addTypes(odsBuildableType0);
2446 if (parser.resolveOperands(lhsOperands, lhsTypes, lhsOperandsLoc, result.operands))
2447 return ::mlir::failure();
2448 if (parser.resolveOperands(rhsOperands, rhsTypes, rhsOperandsLoc, result.operands))
2449 return ::mlir::failure();
2450 return ::mlir::success();
2451}
2452
2453void OrBoolOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
2454 _odsPrinter << ' ';
2455 _odsPrinter << getLhs();
2456 _odsPrinter << ",";
2457 _odsPrinter << ' ';
2458 _odsPrinter << getRhs();
2459 printInferredOrParsedType(_odsPrinter, *this, getLhs().getType(), true);
2460 printInferredOrParsedType(_odsPrinter, *this, getRhs().getType(), false);
2461 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
2462 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
2463}
2464
2465void OrBoolOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
2466}
2467
2468
2469} // namespace llzk::boolean
2470MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::boolean::OrBoolOp)
2471
2472namespace llzk::boolean {
2473
2474
2475//===----------------------------------------------------------------------===//
2476// ::llzk::boolean::XorBoolOp definitions
2477//===----------------------------------------------------------------------===//
2478
2479namespace detail {
2480
2481XorBoolOpGenericAdaptorBase::XorBoolOpGenericAdaptorBase(XorBoolOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
2482
2483
2484} // namespace detail
2486
2487::llvm::LogicalResult XorBoolOpAdaptor::verify(::mlir::Location loc) {
2488 return ::mlir::success();
2489}
2490
2491::llvm::LogicalResult XorBoolOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
2492 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
2493 if (!dict) {
2494 emitError() << "expected DictionaryAttr to set properties";
2495 return ::mlir::failure();
2496 }
2497 return ::mlir::success();
2498}
2499
2500::mlir::Attribute XorBoolOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
2501 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
2502 ::mlir::Builder odsBuilder{ctx};
2503
2504 if (!attrs.empty())
2505 return odsBuilder.getDictionaryAttr(attrs);
2506 return {};
2507}
2508
2509llvm::hash_code XorBoolOp::computePropertiesHash(const Properties &prop) {
2510 using llvm::hash_value;
2511 return llvm::hash_combine();
2512}
2513
2514std::optional<mlir::Attribute> XorBoolOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
2515 return std::nullopt;
2516}
2517
2518void XorBoolOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
2519}
2520
2521void XorBoolOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
2522}
2523
2524::llvm::LogicalResult XorBoolOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
2525 return ::mlir::success();
2526}
2527
2528void XorBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
2529 odsState.addOperands(lhs);
2530 odsState.addOperands(rhs);
2531 odsState.addTypes(result);
2532}
2533
2534XorBoolOp XorBoolOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
2535 ::mlir::OperationState __state__(location, getOperationName());
2536 build(builder, __state__, std::forward<decltype(result)>(result), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
2537 auto __res__ = ::llvm::dyn_cast<XorBoolOp>(builder.create(__state__));
2538 assert(__res__ && "builder didn't return the right type");
2539 return __res__;
2540}
2541
2542XorBoolOp XorBoolOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs) {
2543 return create(builder, builder.getLoc(), std::forward<decltype(result)>(result), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
2544}
2545
2546void XorBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) {
2547 odsState.addOperands(lhs);
2548 odsState.addOperands(rhs);
2549
2550 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
2551 if (::mlir::succeeded(XorBoolOp::inferReturnTypes(odsBuilder.getContext(),
2552 odsState.location, odsState.operands,
2553 odsState.attributes.getDictionary(odsState.getContext()),
2554 odsState.getRawProperties(),
2555 odsState.regions, inferredReturnTypes)))
2556 odsState.addTypes(inferredReturnTypes);
2557 else
2558 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
2559
2560}
2561
2562XorBoolOp XorBoolOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs) {
2563 ::mlir::OperationState __state__(location, getOperationName());
2564 build(builder, __state__, std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
2565 auto __res__ = ::llvm::dyn_cast<XorBoolOp>(builder.create(__state__));
2566 assert(__res__ && "builder didn't return the right type");
2567 return __res__;
2568}
2569
2570XorBoolOp XorBoolOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs) {
2571 return create(builder, builder.getLoc(), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
2572}
2573
2574void XorBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
2575 odsState.addOperands(lhs);
2576 odsState.addOperands(rhs);
2577 assert(resultTypes.size() == 1u && "mismatched number of results");
2578 odsState.addTypes(resultTypes);
2579}
2580
2581XorBoolOp XorBoolOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
2582 ::mlir::OperationState __state__(location, getOperationName());
2583 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
2584 auto __res__ = ::llvm::dyn_cast<XorBoolOp>(builder.create(__state__));
2585 assert(__res__ && "builder didn't return the right type");
2586 return __res__;
2587}
2588
2589XorBoolOp XorBoolOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
2590 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs));
2591}
2592
2593void XorBoolOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2594 assert(operands.size() == 2u && "mismatched number of parameters");
2595 odsState.addOperands(operands);
2596 odsState.addAttributes(attributes);
2597 assert(resultTypes.size() == 1u && "mismatched number of return types");
2598 odsState.addTypes(resultTypes);
2599}
2600
2601XorBoolOp XorBoolOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2602 ::mlir::OperationState __state__(location, getOperationName());
2603 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
2604 auto __res__ = ::llvm::dyn_cast<XorBoolOp>(builder.create(__state__));
2605 assert(__res__ && "builder didn't return the right type");
2606 return __res__;
2607}
2608
2609XorBoolOp XorBoolOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2610 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
2611}
2612
2613void XorBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2614 assert(operands.size() == 2u && "mismatched number of parameters");
2615 odsState.addOperands(operands);
2616 odsState.addAttributes(attributes);
2617
2618 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
2619 if (::mlir::succeeded(XorBoolOp::inferReturnTypes(odsBuilder.getContext(),
2620 odsState.location, operands,
2621 odsState.attributes.getDictionary(odsState.getContext()),
2622 odsState.getRawProperties(),
2623 odsState.regions, inferredReturnTypes))) {
2624 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
2625 odsState.addTypes(inferredReturnTypes);
2626 } else {
2627 ::llvm::report_fatal_error("Failed to infer result type(s).");
2628 }
2629}
2630
2631XorBoolOp XorBoolOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2632 ::mlir::OperationState __state__(location, getOperationName());
2633 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
2634 auto __res__ = ::llvm::dyn_cast<XorBoolOp>(builder.create(__state__));
2635 assert(__res__ && "builder didn't return the right type");
2636 return __res__;
2637}
2638
2639XorBoolOp XorBoolOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2640 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
2641}
2642
2643void XorBoolOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2644 assert(operands.size() == 2u && "mismatched number of parameters");
2645 odsState.addOperands(operands);
2646 odsState.useProperties(const_cast<Properties&>(properties));
2647 odsState.addAttributes(discardableAttributes);
2648 assert(resultTypes.size() == 1u && "mismatched number of return types");
2649 odsState.addTypes(resultTypes);
2650}
2651
2652XorBoolOp XorBoolOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2653 ::mlir::OperationState __state__(location, getOperationName());
2654 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
2655 auto __res__ = ::llvm::dyn_cast<XorBoolOp>(builder.create(__state__));
2656 assert(__res__ && "builder didn't return the right type");
2657 return __res__;
2658}
2659
2660XorBoolOp XorBoolOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2661 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
2662}
2663
2664void XorBoolOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2665 assert(operands.size() == 2u && "mismatched number of parameters");
2666 odsState.addOperands(operands);
2667 odsState.useProperties(const_cast<Properties &>(properties));
2668 odsState.addAttributes(discardableAttributes);
2669
2670 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
2671 if (::mlir::succeeded(XorBoolOp::inferReturnTypes(odsBuilder.getContext(),
2672 odsState.location, operands,
2673 odsState.attributes.getDictionary(odsState.getContext()),
2674 odsState.getRawProperties(),
2675 odsState.regions, inferredReturnTypes))) {
2676 assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
2677 odsState.addTypes(inferredReturnTypes);
2678 } else {
2679 ::llvm::report_fatal_error("Failed to infer result type(s).");
2680 }
2681}
2682
2683XorBoolOp XorBoolOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2684 ::mlir::OperationState __state__(location, getOperationName());
2685 build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
2686 auto __res__ = ::llvm::dyn_cast<XorBoolOp>(builder.create(__state__));
2687 assert(__res__ && "builder didn't return the right type");
2688 return __res__;
2689}
2690
2691XorBoolOp XorBoolOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2692 return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
2693}
2694
2695::llvm::LogicalResult XorBoolOp::verifyInvariantsImpl() {
2696 {
2697 unsigned index = 0; (void)index;
2698 auto valueGroup0 = getODSOperands(0);
2699
2700 for (auto v : valueGroup0) {
2701 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops3(*this, v.getType(), "operand", index++)))
2702 return ::mlir::failure();
2703 }
2704 auto valueGroup1 = getODSOperands(1);
2705
2706 for (auto v : valueGroup1) {
2707 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops3(*this, v.getType(), "operand", index++)))
2708 return ::mlir::failure();
2709 }
2710 }
2711 {
2712 unsigned index = 0; (void)index;
2713 auto valueGroup0 = getODSResults(0);
2714
2715 for (auto v : valueGroup0) {
2716 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
2717 return ::mlir::failure();
2718 }
2719 }
2720 if (!((::llzk::typesUnify((*this->getODSOperands(0).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
2721 return emitOpError("failed to verify that result type matches with lhs type");
2722 if (!((::llzk::typesUnify((*this->getODSOperands(1).begin()).getType(), (*this->getODSResults(0).begin()).getType()))))
2723 return emitOpError("failed to verify that result type matches with rhs type");
2724 return ::mlir::success();
2725}
2726
2727::llvm::LogicalResult XorBoolOp::verifyInvariants() {
2728 return verifyInvariantsImpl();
2729}
2730
2731::llvm::LogicalResult XorBoolOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) {
2732 inferredReturnTypes.resize(1);
2733 ::mlir::Builder odsBuilder(context);
2734 ::mlir::Type odsInferredType0 = odsBuilder.getIntegerType(1);
2735 inferredReturnTypes[0] = odsInferredType0;
2736 return ::mlir::success();
2737}
2738
2739::mlir::ParseResult XorBoolOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
2740 ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{};
2741 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc;
2742 (void)lhsOperandsLoc;
2743 ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{};
2744 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc;
2745 (void)rhsOperandsLoc;
2746 ::mlir::Type lhsRawType{};
2747 ::llvm::ArrayRef<::mlir::Type> lhsTypes(&lhsRawType, 1);
2748 ::mlir::Type rhsRawType{};
2749 ::llvm::ArrayRef<::mlir::Type> rhsTypes(&rhsRawType, 1);
2750
2751 lhsOperandsLoc = parser.getCurrentLocation();
2752 if (parser.parseOperand(lhsRawOperand))
2753 return ::mlir::failure();
2754 if (parser.parseComma())
2755 return ::mlir::failure();
2756
2757 rhsOperandsLoc = parser.getCurrentLocation();
2758 if (parser.parseOperand(rhsRawOperand))
2759 return ::mlir::failure();
2760 {
2761 auto odsResult = parseInferredOrParsedType(parser, lhsRawType, true);
2762 if (odsResult) return ::mlir::failure();
2763 }
2764 {
2765 auto odsResult = parseInferredOrParsedType(parser, rhsRawType, false);
2766 if (odsResult) return ::mlir::failure();
2767 }
2768 {
2769 auto loc = parser.getCurrentLocation();(void)loc;
2770 if (parser.parseOptionalAttrDict(result.attributes))
2771 return ::mlir::failure();
2772 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
2773 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
2774 })))
2775 return ::mlir::failure();
2776 }
2777 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIntegerType(1);
2778 result.addTypes(odsBuildableType0);
2779 if (parser.resolveOperands(lhsOperands, lhsTypes, lhsOperandsLoc, result.operands))
2780 return ::mlir::failure();
2781 if (parser.resolveOperands(rhsOperands, rhsTypes, rhsOperandsLoc, result.operands))
2782 return ::mlir::failure();
2783 return ::mlir::success();
2784}
2785
2786void XorBoolOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
2787 _odsPrinter << ' ';
2788 _odsPrinter << getLhs();
2789 _odsPrinter << ",";
2790 _odsPrinter << ' ';
2791 _odsPrinter << getRhs();
2792 printInferredOrParsedType(_odsPrinter, *this, getLhs().getType(), true);
2793 printInferredOrParsedType(_odsPrinter, *this, getRhs().getType(), false);
2794 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
2795 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
2796}
2797
2798void XorBoolOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
2799}
2800
2801
2802} // namespace llzk::boolean
2803MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::boolean::XorBoolOp)
2804
2805namespace llzk::boolean {
2806
2807
2808//===----------------------------------------------------------------------===//
2809// ::llzk::boolean::YieldOp definitions
2810//===----------------------------------------------------------------------===//
2811
2812namespace detail {
2813
2814YieldOpGenericAdaptorBase::YieldOpGenericAdaptorBase(YieldOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
2815
2816
2817} // namespace detail
2819
2820::llvm::LogicalResult YieldOpAdaptor::verify(::mlir::Location loc) {
2821 return ::mlir::success();
2822}
2823
2824::llvm::LogicalResult YieldOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
2825 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
2826 if (!dict) {
2827 emitError() << "expected DictionaryAttr to set properties";
2828 return ::mlir::failure();
2829 }
2830 return ::mlir::success();
2831}
2832
2833::mlir::Attribute YieldOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
2834 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
2835 ::mlir::Builder odsBuilder{ctx};
2836
2837 if (!attrs.empty())
2838 return odsBuilder.getDictionaryAttr(attrs);
2839 return {};
2840}
2841
2842llvm::hash_code YieldOp::computePropertiesHash(const Properties &prop) {
2843 using llvm::hash_value;
2844 return llvm::hash_combine();
2845}
2846
2847std::optional<mlir::Attribute> YieldOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
2848 return std::nullopt;
2849}
2850
2851void YieldOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
2852}
2853
2854void YieldOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
2855}
2856
2857::llvm::LogicalResult YieldOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
2858 return ::mlir::success();
2859}
2860
2861void YieldOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value value) {
2862 odsState.addOperands(value);
2863}
2864
2865YieldOp YieldOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value value) {
2866 ::mlir::OperationState __state__(location, getOperationName());
2867 build(builder, __state__, std::forward<decltype(value)>(value));
2868 auto __res__ = ::llvm::dyn_cast<YieldOp>(builder.create(__state__));
2869 assert(__res__ && "builder didn't return the right type");
2870 return __res__;
2871}
2872
2873YieldOp YieldOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value value) {
2874 return create(builder, builder.getLoc(), std::forward<decltype(value)>(value));
2875}
2876
2877void YieldOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value value) {
2878 odsState.addOperands(value);
2879 assert(resultTypes.size() == 0u && "mismatched number of results");
2880 odsState.addTypes(resultTypes);
2881}
2882
2883YieldOp YieldOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value value) {
2884 ::mlir::OperationState __state__(location, getOperationName());
2885 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(value)>(value));
2886 auto __res__ = ::llvm::dyn_cast<YieldOp>(builder.create(__state__));
2887 assert(__res__ && "builder didn't return the right type");
2888 return __res__;
2889}
2890
2891YieldOp YieldOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value value) {
2892 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(value)>(value));
2893}
2894
2895void YieldOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2896 assert(operands.size() == 1u && "mismatched number of parameters");
2897 odsState.addOperands(operands);
2898 odsState.addAttributes(attributes);
2899 assert(resultTypes.size() == 0u && "mismatched number of return types");
2900 odsState.addTypes(resultTypes);
2901}
2902
2903YieldOp YieldOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2904 ::mlir::OperationState __state__(location, getOperationName());
2905 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
2906 auto __res__ = ::llvm::dyn_cast<YieldOp>(builder.create(__state__));
2907 assert(__res__ && "builder didn't return the right type");
2908 return __res__;
2909}
2910
2911YieldOp YieldOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2912 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
2913}
2914
2915void YieldOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2916 assert(operands.size() == 1u && "mismatched number of parameters");
2917 odsState.addOperands(operands);
2918 odsState.useProperties(const_cast<Properties&>(properties));
2919 odsState.addAttributes(discardableAttributes);
2920 assert(resultTypes.size() == 0u && "mismatched number of return types");
2921 odsState.addTypes(resultTypes);
2922}
2923
2924YieldOp YieldOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2925 ::mlir::OperationState __state__(location, getOperationName());
2926 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
2927 auto __res__ = ::llvm::dyn_cast<YieldOp>(builder.create(__state__));
2928 assert(__res__ && "builder didn't return the right type");
2929 return __res__;
2930}
2931
2932YieldOp YieldOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2933 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
2934}
2935
2936::llvm::LogicalResult YieldOp::verifyInvariantsImpl() {
2937 {
2938 unsigned index = 0; (void)index;
2939 auto valueGroup0 = getODSOperands(0);
2940
2941 for (auto v : valueGroup0) {
2942 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "operand", index++)))
2943 return ::mlir::failure();
2944 }
2945 }
2946 return ::mlir::success();
2947}
2948
2949::llvm::LogicalResult YieldOp::verifyInvariants() {
2950 return verifyInvariantsImpl();
2951}
2952
2953::mlir::ParseResult YieldOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
2954 ::mlir::OpAsmParser::UnresolvedOperand valueRawOperand{};
2955 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> valueOperands(&valueRawOperand, 1); ::llvm::SMLoc valueOperandsLoc;
2956 (void)valueOperandsLoc;
2957
2958 valueOperandsLoc = parser.getCurrentLocation();
2959 if (parser.parseOperand(valueRawOperand))
2960 return ::mlir::failure();
2961 {
2962 auto loc = parser.getCurrentLocation();(void)loc;
2963 if (parser.parseOptionalAttrDict(result.attributes))
2964 return ::mlir::failure();
2965 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
2966 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
2967 })))
2968 return ::mlir::failure();
2969 }
2970 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIntegerType(1);
2971 if (parser.resolveOperands(valueOperands, odsBuildableType0, valueOperandsLoc, result.operands))
2972 return ::mlir::failure();
2973 return ::mlir::success();
2974}
2975
2976void YieldOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
2977 _odsPrinter << ' ';
2978 _odsPrinter << getValue();
2979 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
2980 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
2981}
2982
2983
2984} // namespace llzk::boolean
2985MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::boolean::YieldOp)
2986
2987
2988#endif // GET_OP_CLASSES
2989
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:728
AndBoolOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:585
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:651
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:755
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:769
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:679
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:1039
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:750
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:968
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:741
static AndBoolOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:775
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1027
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:762
::mlir::TypedValue<::mlir::Type > getLhs()
Definition Ops.h.inc:657
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:765
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:980
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:759
::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location > location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type > &inferredReturnTypes)
Definition Ops.cpp.inc:972
::mlir::TypedValue<::mlir::Type > getRhs()
Definition Ops.h.inc:661
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:732
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:936
FoldAdaptor::Properties Properties
Definition Ops.h.inc:638
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:643
AssertOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:825
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:1066
::mlir::TypedValue<::mlir::IntegerType > getCondition()
Definition Ops.h.inc:901
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1283
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:1125
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value condition, ::mlir::StringAttr msg)
Definition Ops.cpp.inc:1171
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:1097
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:1145
::std::optional< ::llvm::StringRef > getMsg()
Definition Ops.cpp.inc:1158
::mlir::StringAttr getMsgAttr()
Definition Ops.h.inc:929
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:887
void setMsg(::std::optional<::llvm::StringRef > attrValue)
Definition Ops.cpp.inc:1163
static AssertOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value condition, ::mlir::StringAttr msg)
Definition Ops.cpp.inc:1178
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:1113
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:895
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:1152
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1314
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:1132
FoldAdaptor::Properties Properties
Definition Ops.h.inc:873
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1136
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1279
::mlir::StringAttr getMsgAttrName()
Definition Ops.h.inc:879
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1262
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1074
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:1119
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:1352
CmpOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1053
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:1830
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::llzk::boolean::FeltCmpPredicateAttr predicate, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:1453
::mlir::TypedValue<::llzk::felt::FeltType > getLhs()
Definition Ops.h.inc:1134
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:1419
::mlir::StringAttr getPredicateAttrName()
Definition Ops.h.inc:1112
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:1120
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:1156
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1745
::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location > location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type > &inferredReturnTypes)
Definition Ops.cpp.inc:1749
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1757
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:1406
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:1384
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1423
::llzk::boolean::FeltCmpPredicate getPredicate()
Definition Ops.cpp.inc:1444
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1710
static CmpOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::llzk::boolean::FeltCmpPredicateAttr predicate, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:1460
void setPredicate(::llzk::boolean::FeltCmpPredicate attrValue)
Definition Ops.cpp.inc:1449
::llzk::boolean::FeltCmpPredicateAttr getPredicateAttr()
Definition Ops.h.inc:1175
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:1128
FoldAdaptor::Properties Properties
Definition Ops.h.inc:1106
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1814
::mlir::TypedValue<::llzk::felt::FeltType > getRhs()
Definition Ops.h.inc:1138
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:1439
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:1400
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:1412
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:1432
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1361
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:126
ExistsOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:214
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:130
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:267
FoldAdaptor::Properties Properties
Definition Ops.h.inc:262
::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location > location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type > &inferredReturnTypes)
Definition Ops.cpp.inc:377
::llvm::LogicalResult verify()
Definition Ops.cpp:301
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:371
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:153
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:405
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:294
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:342
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:275
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value sort)
Definition Ops.cpp.inc:167
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:148
static ExistsOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value sort)
Definition Ops.cpp.inc:173
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:157
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:163
::llvm::LogicalResult setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:385
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:139
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:160
ForAllOpGenericAdaptor(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:427
FoldAdaptor::Properties Properties
Definition Ops.h.inc:451
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:672
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:440
::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location > location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type > &inferredReturnTypes)
Definition Ops.cpp.inc:678
static ForAllOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value sort)
Definition Ops.cpp.inc:474
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:483
::llvm::LogicalResult setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:686
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:454
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:461
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:458
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value sort)
Definition Ops.cpp.inc:468
::llvm::LogicalResult verify()
Definition Ops.cpp:289
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:643
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:456
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:464
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:449
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:464
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:706
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:431
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:1853
NotBoolOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1312
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:2058
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:1880
::mlir::TypedValue<::mlir::Type > getOperand()
Definition Ops.h.inc:1379
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:2124
static NotBoolOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value operand)
Definition Ops.cpp.inc:1899
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1890
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:2094
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:2082
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:2132
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value operand)
Definition Ops.cpp.inc:1894
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1857
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:1887
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:1365
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:1866
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:1884
FoldAdaptor::Properties Properties
Definition Ops.h.inc:1360
::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location > location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type > &inferredReturnTypes)
Definition Ops.cpp.inc:2086
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:1373
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:1875
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:1392
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:2154
OrBoolOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1514
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:2181
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:2158
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:2362
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:1580
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:2465
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:2453
static OrBoolOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:2201
::mlir::TypedValue<::mlir::Type > getLhs()
Definition Ops.h.inc:1586
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:2185
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:2188
FoldAdaptor::Properties Properties
Definition Ops.h.inc:1567
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:2195
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:2191
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:2394
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:2176
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:2167
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:2406
::mlir::TypedValue<::mlir::Type > getRhs()
Definition Ops.h.inc:1590
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:1608
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:1572
::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location > location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type > &inferredReturnTypes)
Definition Ops.cpp.inc:2398
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:2487
XorBoolOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1730
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:2524
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:2491
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:2518
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:2695
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:2727
::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location > location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type > &inferredReturnTypes)
Definition Ops.cpp.inc:2731
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:2521
static XorBoolOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:2534
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:1796
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:1824
::mlir::TypedValue<::mlir::Type > getLhs()
Definition Ops.h.inc:1802
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:2786
::mlir::TypedValue<::mlir::Type > getRhs()
Definition Ops.h.inc:1806
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:2528
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:2509
FoldAdaptor::Properties Properties
Definition Ops.h.inc:1783
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:2514
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:1788
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:2798
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:2500
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:2739
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:2820
YieldOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1945
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:2824
::mlir::TypedValue<::mlir::IntegerType > getValue()
Definition Ops.h.inc:2014
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:2854
static YieldOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value value)
Definition Ops.cpp.inc:2865
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:2953
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:2008
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:2936
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:2000
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value value)
Definition Ops.cpp.inc:2861
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:2847
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:2833
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:2976
FoldAdaptor::Properties Properties
Definition Ops.h.inc:1993
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:2842
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:2851
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:2949
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:2857
AndBoolOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:557
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:553
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:788
AssertOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:792
::std::optional< ::llvm::StringRef > getMsg()
Definition Ops.cpp.inc:1057
::llzk::boolean::FeltCmpPredicateAttr getPredicateAttr()
Definition Ops.h.inc:1037
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:1015
CmpOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1019
::llzk::boolean::FeltCmpPredicate getPredicate()
Definition Ops.cpp.inc:1343
ExistsOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:179
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:175
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:364
ForAllOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:368
NotBoolOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1285
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:1281
OrBoolOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1486
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:1482
XorBoolOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1702
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:1698
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:1914
YieldOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1918
Common interface for constant parameter-like symbol operations that can be defined within a TemplateO...
bool typesUnify(Type lhs, Type rhs, ArrayRef< StringRef > rhsReversePrefix, UnificationMap *unifications)