28static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops1(
29 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
30 unsigned valueIndex) {
31 if (!((::llvm::isa<::mlir::IndexType>(type)))) {
32 return op->emitOpError(valueKind) <<
" #" << valueIndex
33 <<
" must be index, but got " << type;
35 return ::mlir::success();
38static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops2(
39 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
40 unsigned valueIndex) {
41 if (!((::llvm::isa<::llzk::felt::FeltType>(type)))) {
42 return op->emitOpError(valueKind) <<
" #" << valueIndex
43 <<
" must be finite field element, but got " << type;
45 return ::mlir::success();
61 return ::mlir::success();
64void LoadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type val, ::mlir::Value addr) {
65 odsState.addOperands(addr);
66 odsState.addTypes(val);
69void LoadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value addr) {
70 odsState.addOperands(addr);
71 assert(resultTypes.size() == 1u &&
"mismatched number of results");
72 odsState.addTypes(resultTypes);
75void LoadOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
76 assert(operands.size() == 1u &&
"mismatched number of parameters");
77 odsState.addOperands(operands);
78 odsState.addAttributes(attributes);
79 assert(resultTypes.size() == 1u &&
"mismatched number of return types");
80 odsState.addTypes(resultTypes);
85 unsigned index = 0; (void)index;
88 for (
auto v : valueGroup0) {
89 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*
this, v.getType(),
"operand", index++)))
90 return ::mlir::failure();
94 unsigned index = 0; (void)index;
97 for (
auto v : valueGroup0) {
98 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*
this, v.getType(),
"result", index++)))
99 return ::mlir::failure();
102 return ::mlir::success();
109::mlir::ParseResult
LoadOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
110 ::mlir::OpAsmParser::UnresolvedOperand addrRawOperand{};
111 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> addrOperands(&addrRawOperand, 1); ::llvm::SMLoc addrOperandsLoc;
112 (void)addrOperandsLoc;
113 ::mlir::Type valRawType{};
114 ::llvm::ArrayRef<::mlir::Type> valTypes(&valRawType, 1);
116 addrOperandsLoc = parser.getCurrentLocation();
117 if (parser.parseOperand(addrRawOperand))
118 return ::mlir::failure();
119 if (parser.parseColon())
120 return ::mlir::failure();
124 if (parser.parseCustomTypeWithFallback(type))
125 return ::mlir::failure();
129 auto loc = parser.getCurrentLocation();(void)loc;
130 if (parser.parseOptionalAttrDict(result.attributes))
131 return ::mlir::failure();
133 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIndexType();
134 result.addTypes(valTypes);
135 if (parser.resolveOperands(addrOperands, odsBuildableType0, addrOperandsLoc, result.operands))
136 return ::mlir::failure();
137 return ::mlir::success();
143 _odsPrinter <<
' ' <<
":";
146 auto type =
getVal().getType();
147 if (
auto validType = ::llvm::dyn_cast<::llzk::felt::FeltType>(type))
148 _odsPrinter.printStrippedAttrOrType(validType);
152 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
153 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
156void LoadOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
157 effects.emplace_back(::mlir::MemoryEffects::Read::get(), 0,
false, ::mlir::SideEffects::DefaultResource::get());
176 return ::mlir::success();
179void StoreOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value addr, ::mlir::Value val) {
180 odsState.addOperands(addr);
181 odsState.addOperands(val);
184void StoreOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value addr, ::mlir::Value val) {
185 odsState.addOperands(addr);
186 odsState.addOperands(val);
187 assert(resultTypes.size() == 0u &&
"mismatched number of results");
188 odsState.addTypes(resultTypes);
191void StoreOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
192 assert(operands.size() == 2u &&
"mismatched number of parameters");
193 odsState.addOperands(operands);
194 odsState.addAttributes(attributes);
195 assert(resultTypes.size() == 0u &&
"mismatched number of return types");
196 odsState.addTypes(resultTypes);
201 unsigned index = 0; (void)index;
204 for (
auto v : valueGroup0) {
205 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*
this, v.getType(),
"operand", index++)))
206 return ::mlir::failure();
210 for (
auto v : valueGroup1) {
211 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*
this, v.getType(),
"operand", index++)))
212 return ::mlir::failure();
215 return ::mlir::success();
222::mlir::ParseResult
StoreOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
223 ::mlir::OpAsmParser::UnresolvedOperand addrRawOperand{};
224 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> addrOperands(&addrRawOperand, 1); ::llvm::SMLoc addrOperandsLoc;
225 (void)addrOperandsLoc;
226 ::mlir::OpAsmParser::UnresolvedOperand valRawOperand{};
227 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> valOperands(&valRawOperand, 1); ::llvm::SMLoc valOperandsLoc;
228 (void)valOperandsLoc;
229 ::mlir::Type valRawType{};
230 ::llvm::ArrayRef<::mlir::Type> valTypes(&valRawType, 1);
232 addrOperandsLoc = parser.getCurrentLocation();
233 if (parser.parseOperand(addrRawOperand))
234 return ::mlir::failure();
235 if (parser.parseComma())
236 return ::mlir::failure();
238 valOperandsLoc = parser.getCurrentLocation();
239 if (parser.parseOperand(valRawOperand))
240 return ::mlir::failure();
241 if (parser.parseColon())
242 return ::mlir::failure();
246 if (parser.parseCustomTypeWithFallback(type))
247 return ::mlir::failure();
251 auto loc = parser.getCurrentLocation();(void)loc;
252 if (parser.parseOptionalAttrDict(result.attributes))
253 return ::mlir::failure();
255 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIndexType();
256 if (parser.resolveOperands(addrOperands, odsBuildableType0, addrOperandsLoc, result.operands))
257 return ::mlir::failure();
258 if (parser.resolveOperands(valOperands, valTypes, valOperandsLoc, result.operands))
259 return ::mlir::failure();
260 return ::mlir::success();
269 _odsPrinter <<
' ' <<
":";
272 auto type =
getVal().getType();
273 if (
auto validType = ::llvm::dyn_cast<::llzk::felt::FeltType>(type))
274 _odsPrinter.printStrippedAttrOrType(validType);
278 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
279 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
282void StoreOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
283 effects.emplace_back(::mlir::MemoryEffects::Write::get(), 0,
false, ::mlir::SideEffects::DefaultResource::get());
::llvm::LogicalResult verify(::mlir::Location loc)
LoadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
::mlir::ValueRange getOperands()
::llvm::LogicalResult verifyInvariants()
::llvm::LogicalResult verifyInvariantsImpl()
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
void print(::mlir::OpAsmPrinter &_odsPrinter)
::mlir::Operation::result_range getODSResults(unsigned index)
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
::mlir::TypedValue<::llzk::felt::FeltType > getVal()
::mlir::TypedValue<::mlir::IndexType > getAddr()
::mlir::Operation::operand_range getODSOperands(unsigned index)
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type val, ::mlir::Value addr)
StoreOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
::llvm::LogicalResult verify(::mlir::Location loc)
StoreOpAdaptor(StoreOp op)
::mlir::ValueRange getOperands()
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value addr, ::mlir::Value val)
::mlir::TypedValue<::llzk::felt::FeltType > getVal()
::mlir::Operation::operand_range getODSOperands(unsigned index)
void print(::mlir::OpAsmPrinter &_odsPrinter)
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
::mlir::TypedValue<::mlir::IndexType > getAddr()
::llvm::LogicalResult verifyInvariants()
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
::llvm::LogicalResult verifyInvariantsImpl()