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
15#endif // GET_OP_LIST
16
17#ifdef GET_OP_CLASSES
18#undef GET_OP_CLASSES
19
20
21//===----------------------------------------------------------------------===//
22// Local Utility Method Definitions
23//===----------------------------------------------------------------------===//
24
25
26static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops1(
27 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
28 unsigned valueIndex) {
29 if (!((::llvm::isa<::mlir::IndexType>(type)))) {
30 return op->emitOpError(valueKind) << " #" << valueIndex
31 << " must be index, but got " << type;
32 }
33 return ::mlir::success();
34}
35
36static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops2(
37 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
38 unsigned valueIndex) {
39 if (!((::llvm::isa<::llzk::felt::FeltType>(type)))) {
40 return op->emitOpError(valueKind) << " #" << valueIndex
41 << " must be finite field element, but got " << type;
42 }
43 return ::mlir::success();
44}
45namespace llzk::ram {
46
47
48//===----------------------------------------------------------------------===//
49// ::llzk::ram::LoadOp definitions
50//===----------------------------------------------------------------------===//
51
52namespace detail {
53
54LoadOpGenericAdaptorBase::LoadOpGenericAdaptorBase(LoadOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
55
56
57} // namespace detail
59
60::llvm::LogicalResult LoadOpAdaptor::verify(::mlir::Location loc) {
61 return ::mlir::success();
62}
63
64::llvm::LogicalResult LoadOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
65 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
66 if (!dict) {
67 emitError() << "expected DictionaryAttr to set properties";
68 return ::mlir::failure();
69 }
70 return ::mlir::success();
71}
72
73::mlir::Attribute LoadOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
74 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
75 ::mlir::Builder odsBuilder{ctx};
76
77 if (!attrs.empty())
78 return odsBuilder.getDictionaryAttr(attrs);
79 return {};
80}
81
82llvm::hash_code LoadOp::computePropertiesHash(const Properties &prop) {
83 using llvm::hash_value;
84 return llvm::hash_combine();
85}
86
87std::optional<mlir::Attribute> LoadOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
88 return std::nullopt;
89}
90
91void LoadOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
92}
93
94void LoadOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
95}
96
97::llvm::LogicalResult LoadOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
98 return ::mlir::success();
99}
100
101void LoadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type val, ::mlir::Value addr) {
102 odsState.addOperands(addr);
103 odsState.addTypes(val);
104}
105
106LoadOp LoadOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type val, ::mlir::Value addr) {
107 ::mlir::OperationState __state__(location, getOperationName());
108 build(builder, __state__, std::forward<decltype(val)>(val), std::forward<decltype(addr)>(addr));
109 auto __res__ = ::llvm::dyn_cast<LoadOp>(builder.create(__state__));
110 assert(__res__ && "builder didn't return the right type");
111 return __res__;
112}
113
114LoadOp LoadOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type val, ::mlir::Value addr) {
115 return create(builder, builder.getLoc(), std::forward<decltype(val)>(val), std::forward<decltype(addr)>(addr));
116}
117
118void LoadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value addr) {
119 odsState.addOperands(addr);
120 assert(resultTypes.size() == 1u && "mismatched number of results");
121 odsState.addTypes(resultTypes);
122}
123
124LoadOp LoadOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value addr) {
125 ::mlir::OperationState __state__(location, getOperationName());
126 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(addr)>(addr));
127 auto __res__ = ::llvm::dyn_cast<LoadOp>(builder.create(__state__));
128 assert(__res__ && "builder didn't return the right type");
129 return __res__;
130}
131
132LoadOp LoadOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value addr) {
133 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(addr)>(addr));
134}
135
136void LoadOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
137 assert(operands.size() == 1u && "mismatched number of parameters");
138 odsState.addOperands(operands);
139 odsState.addAttributes(attributes);
140 assert(resultTypes.size() == 1u && "mismatched number of return types");
141 odsState.addTypes(resultTypes);
142}
143
144LoadOp LoadOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
145 ::mlir::OperationState __state__(location, getOperationName());
146 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
147 auto __res__ = ::llvm::dyn_cast<LoadOp>(builder.create(__state__));
148 assert(__res__ && "builder didn't return the right type");
149 return __res__;
150}
151
152LoadOp LoadOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
153 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
154}
155
156void LoadOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
157 assert(operands.size() == 1u && "mismatched number of parameters");
158 odsState.addOperands(operands);
159 odsState.useProperties(const_cast<Properties&>(properties));
160 odsState.addAttributes(discardableAttributes);
161 assert(resultTypes.size() == 1u && "mismatched number of return types");
162 odsState.addTypes(resultTypes);
163}
164
165LoadOp LoadOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
166 ::mlir::OperationState __state__(location, getOperationName());
167 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
168 auto __res__ = ::llvm::dyn_cast<LoadOp>(builder.create(__state__));
169 assert(__res__ && "builder didn't return the right type");
170 return __res__;
171}
172
173LoadOp LoadOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
174 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));
175}
176
177::llvm::LogicalResult LoadOp::verifyInvariantsImpl() {
178 {
179 unsigned index = 0; (void)index;
180 auto valueGroup0 = getODSOperands(0);
181
182 for (auto v : valueGroup0) {
183 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
184 return ::mlir::failure();
185 }
186 }
187 {
188 unsigned index = 0; (void)index;
189 auto valueGroup0 = getODSResults(0);
190
191 for (auto v : valueGroup0) {
192 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "result", index++)))
193 return ::mlir::failure();
194 }
195 }
196 return ::mlir::success();
197}
198
199::llvm::LogicalResult LoadOp::verifyInvariants() {
200 return verifyInvariantsImpl();
201}
202
203::mlir::ParseResult LoadOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
204 ::mlir::OpAsmParser::UnresolvedOperand addrRawOperand{};
205 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> addrOperands(&addrRawOperand, 1); ::llvm::SMLoc addrOperandsLoc;
206 (void)addrOperandsLoc;
207 ::mlir::Type valRawType{};
208 ::llvm::ArrayRef<::mlir::Type> valTypes(&valRawType, 1);
209
210 addrOperandsLoc = parser.getCurrentLocation();
211 if (parser.parseOperand(addrRawOperand))
212 return ::mlir::failure();
213 if (parser.parseColon())
214 return ::mlir::failure();
215
216 {
218 if (parser.parseCustomTypeWithFallback(type))
219 return ::mlir::failure();
220 valRawType = type;
221 }
222 {
223 auto loc = parser.getCurrentLocation();(void)loc;
224 if (parser.parseOptionalAttrDict(result.attributes))
225 return ::mlir::failure();
226 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
227 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
228 })))
229 return ::mlir::failure();
230 }
231 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIndexType();
232 result.addTypes(valTypes);
233 if (parser.resolveOperands(addrOperands, odsBuildableType0, addrOperandsLoc, result.operands))
234 return ::mlir::failure();
235 return ::mlir::success();
236}
237
238void LoadOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
239 _odsPrinter << ' ';
240 _odsPrinter << getAddr();
241 _odsPrinter << ' ' << ":";
242 _odsPrinter << ' ';
243 {
244 auto type = getVal().getType();
245 if (auto validType = ::llvm::dyn_cast<::llzk::felt::FeltType>(type))
246 _odsPrinter.printStrippedAttrOrType(validType);
247 else
248 _odsPrinter << type;
249 }
250 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
251 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
252}
253
254void LoadOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
255 effects.emplace_back(::mlir::MemoryEffects::Read::get(), 0, false, ::mlir::SideEffects::DefaultResource::get());
256}
257
258
259} // namespace llzk::ram
260MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::ram::LoadOp)
261
262namespace llzk::ram {
263
264
265//===----------------------------------------------------------------------===//
266// ::llzk::ram::StoreOp definitions
267//===----------------------------------------------------------------------===//
268
269namespace detail {
270
271StoreOpGenericAdaptorBase::StoreOpGenericAdaptorBase(StoreOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
272
273
274} // namespace detail
276
277::llvm::LogicalResult StoreOpAdaptor::verify(::mlir::Location loc) {
278 return ::mlir::success();
279}
280
281::llvm::LogicalResult StoreOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
282 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
283 if (!dict) {
284 emitError() << "expected DictionaryAttr to set properties";
285 return ::mlir::failure();
286 }
287 return ::mlir::success();
288}
289
290::mlir::Attribute StoreOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
291 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
292 ::mlir::Builder odsBuilder{ctx};
293
294 if (!attrs.empty())
295 return odsBuilder.getDictionaryAttr(attrs);
296 return {};
297}
298
299llvm::hash_code StoreOp::computePropertiesHash(const Properties &prop) {
300 using llvm::hash_value;
301 return llvm::hash_combine();
302}
303
304std::optional<mlir::Attribute> StoreOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
305 return std::nullopt;
306}
307
308void StoreOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
309}
310
311void StoreOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
312}
313
314::llvm::LogicalResult StoreOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
315 return ::mlir::success();
316}
317
318void StoreOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value addr, ::mlir::Value val) {
319 odsState.addOperands(addr);
320 odsState.addOperands(val);
321}
322
323StoreOp StoreOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value addr, ::mlir::Value val) {
324 ::mlir::OperationState __state__(location, getOperationName());
325 build(builder, __state__, std::forward<decltype(addr)>(addr), std::forward<decltype(val)>(val));
326 auto __res__ = ::llvm::dyn_cast<StoreOp>(builder.create(__state__));
327 assert(__res__ && "builder didn't return the right type");
328 return __res__;
329}
330
331StoreOp StoreOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value addr, ::mlir::Value val) {
332 return create(builder, builder.getLoc(), std::forward<decltype(addr)>(addr), std::forward<decltype(val)>(val));
333}
334
335void StoreOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value addr, ::mlir::Value val) {
336 odsState.addOperands(addr);
337 odsState.addOperands(val);
338 assert(resultTypes.size() == 0u && "mismatched number of results");
339 odsState.addTypes(resultTypes);
340}
341
342StoreOp StoreOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value addr, ::mlir::Value val) {
343 ::mlir::OperationState __state__(location, getOperationName());
344 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(addr)>(addr), std::forward<decltype(val)>(val));
345 auto __res__ = ::llvm::dyn_cast<StoreOp>(builder.create(__state__));
346 assert(__res__ && "builder didn't return the right type");
347 return __res__;
348}
349
350StoreOp StoreOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value addr, ::mlir::Value val) {
351 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(addr)>(addr), std::forward<decltype(val)>(val));
352}
353
354void StoreOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
355 assert(operands.size() == 2u && "mismatched number of parameters");
356 odsState.addOperands(operands);
357 odsState.addAttributes(attributes);
358 assert(resultTypes.size() == 0u && "mismatched number of return types");
359 odsState.addTypes(resultTypes);
360}
361
362StoreOp StoreOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
363 ::mlir::OperationState __state__(location, getOperationName());
364 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
365 auto __res__ = ::llvm::dyn_cast<StoreOp>(builder.create(__state__));
366 assert(__res__ && "builder didn't return the right type");
367 return __res__;
368}
369
370StoreOp StoreOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
371 return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
372}
373
374void StoreOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
375 assert(operands.size() == 2u && "mismatched number of parameters");
376 odsState.addOperands(operands);
377 odsState.useProperties(const_cast<Properties&>(properties));
378 odsState.addAttributes(discardableAttributes);
379 assert(resultTypes.size() == 0u && "mismatched number of return types");
380 odsState.addTypes(resultTypes);
381}
382
383StoreOp StoreOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
384 ::mlir::OperationState __state__(location, getOperationName());
385 build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
386 auto __res__ = ::llvm::dyn_cast<StoreOp>(builder.create(__state__));
387 assert(__res__ && "builder didn't return the right type");
388 return __res__;
389}
390
391StoreOp StoreOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
392 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));
393}
394
395::llvm::LogicalResult StoreOp::verifyInvariantsImpl() {
396 {
397 unsigned index = 0; (void)index;
398 auto valueGroup0 = getODSOperands(0);
399
400 for (auto v : valueGroup0) {
401 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
402 return ::mlir::failure();
403 }
404 auto valueGroup1 = getODSOperands(1);
405
406 for (auto v : valueGroup1) {
407 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "operand", index++)))
408 return ::mlir::failure();
409 }
410 }
411 return ::mlir::success();
412}
413
414::llvm::LogicalResult StoreOp::verifyInvariants() {
415 return verifyInvariantsImpl();
416}
417
418::mlir::ParseResult StoreOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
419 ::mlir::OpAsmParser::UnresolvedOperand addrRawOperand{};
420 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> addrOperands(&addrRawOperand, 1); ::llvm::SMLoc addrOperandsLoc;
421 (void)addrOperandsLoc;
422 ::mlir::OpAsmParser::UnresolvedOperand valRawOperand{};
423 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> valOperands(&valRawOperand, 1); ::llvm::SMLoc valOperandsLoc;
424 (void)valOperandsLoc;
425 ::mlir::Type valRawType{};
426 ::llvm::ArrayRef<::mlir::Type> valTypes(&valRawType, 1);
427
428 addrOperandsLoc = parser.getCurrentLocation();
429 if (parser.parseOperand(addrRawOperand))
430 return ::mlir::failure();
431 if (parser.parseComma())
432 return ::mlir::failure();
433
434 valOperandsLoc = parser.getCurrentLocation();
435 if (parser.parseOperand(valRawOperand))
436 return ::mlir::failure();
437 if (parser.parseColon())
438 return ::mlir::failure();
439
440 {
442 if (parser.parseCustomTypeWithFallback(type))
443 return ::mlir::failure();
444 valRawType = type;
445 }
446 {
447 auto loc = parser.getCurrentLocation();(void)loc;
448 if (parser.parseOptionalAttrDict(result.attributes))
449 return ::mlir::failure();
450 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
451 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
452 })))
453 return ::mlir::failure();
454 }
455 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIndexType();
456 if (parser.resolveOperands(addrOperands, odsBuildableType0, addrOperandsLoc, result.operands))
457 return ::mlir::failure();
458 if (parser.resolveOperands(valOperands, valTypes, valOperandsLoc, result.operands))
459 return ::mlir::failure();
460 return ::mlir::success();
461}
462
463void StoreOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
464 _odsPrinter << ' ';
465 _odsPrinter << getAddr();
466 _odsPrinter << ",";
467 _odsPrinter << ' ';
468 _odsPrinter << getVal();
469 _odsPrinter << ' ' << ":";
470 _odsPrinter << ' ';
471 {
472 auto type = getVal().getType();
473 if (auto validType = ::llvm::dyn_cast<::llzk::felt::FeltType>(type))
474 _odsPrinter.printStrippedAttrOrType(validType);
475 else
476 _odsPrinter << type;
477 }
478 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
479 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
480}
481
482void StoreOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
483 effects.emplace_back(::mlir::MemoryEffects::Write::get(), 0, false, ::mlir::SideEffects::DefaultResource::get());
484}
485
486
487} // namespace llzk::ram
488MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::ram::StoreOp)
489
490
491#endif // GET_OP_CLASSES
492
LoadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:92
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:60
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:82
static LoadOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type val, ::mlir::Value addr)
Definition Ops.cpp.inc:106
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:199
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:177
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:87
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:254
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:238
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:145
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:172
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:73
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:203
FoldAdaptor::Properties Properties
Definition Ops.h.inc:140
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:94
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:64
::mlir::TypedValue<::llzk::felt::FeltType > getVal()
Definition Ops.h.inc:178
::mlir::TypedValue<::mlir::IndexType > getAddr()
Definition Ops.h.inc:159
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:153
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:91
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type val, ::mlir::Value addr)
Definition Ops.cpp.inc:101
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:97
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:277
StoreOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:258
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value addr, ::mlir::Value val)
Definition Ops.cpp.inc:318
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:281
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:299
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:308
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:314
::mlir::TypedValue<::llzk::felt::FeltType > getVal()
Definition Ops.h.inc:334
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:316
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:304
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:324
static StoreOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value addr, ::mlir::Value val)
Definition Ops.cpp.inc:323
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:463
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:290
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:418
::mlir::TypedValue<::mlir::IndexType > getAddr()
Definition Ops.h.inc:330
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:414
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:482
FoldAdaptor::Properties Properties
Definition Ops.h.inc:311
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:311
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:395
LoadOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:65
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:61
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:226
StoreOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:230
Common interface for constant parameter-like symbol operations that can be defined within a TemplateO...