LLZK 0.1.0
Veridise's ZK Language IR
Loading...
Searching...
No Matches
Ops.h.inc
Go to the documentation of this file.
1/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2|* *|
3|* Op Declarations *|
4|* *|
5|* Automatically generated file, do not edit! *|
6|* From: Ops.td *|
7|* *|
8\*===----------------------------------------------------------------------===*/
9
10namespace llzk {
11namespace cast {
12class FeltToIndexOp;
13} // namespace cast
14} // namespace llzk
15namespace llzk {
16namespace cast {
17class IntToFeltOp;
18} // namespace cast
19} // namespace llzk
20#ifdef GET_OP_CLASSES
21#undef GET_OP_CLASSES
22
23namespace llzk {
24namespace cast {
25
26//===----------------------------------------------------------------------===//
27// ::llzk::cast::FeltToIndexOp declarations
28//===----------------------------------------------------------------------===//
29
30namespace detail {
32public:
33protected:
34 ::mlir::DictionaryAttr odsAttrs;
35 ::std::optional<::mlir::OperationName> odsOpName;
36 ::mlir::RegionRange odsRegions;
37public:
38 FeltToIndexOpGenericAdaptorBase(::mlir::DictionaryAttr attrs = {}, const ::mlir::EmptyProperties &properties = {}, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), odsRegions(regions) { if (odsAttrs)
39 odsOpName.emplace("cast.toindex", odsAttrs.getContext());
40 }
41
42 FeltToIndexOpGenericAdaptorBase(::mlir::Operation *op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), odsRegions(op->getRegions()) {}
43
44 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
45 return {index, 1};
46 }
47
48 ::mlir::DictionaryAttr getAttributes() {
49 return odsAttrs;
50 }
51
52};
53} // namespace detail
54template <typename RangeT>
56 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
58public:
59 FeltToIndexOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = {}, const ::mlir::EmptyProperties &properties = {}, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
60
61 FeltToIndexOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : FeltToIndexOpGenericAdaptor(values, attrs, (properties ? *properties.as<::mlir::EmptyProperties *>() : ::mlir::EmptyProperties{}), regions) {}
62
63 FeltToIndexOpGenericAdaptor(RangeT values, const FeltToIndexOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {}
64
65 template <typename LateInst = FeltToIndexOp, typename = std::enable_if_t<std::is_same_v<LateInst, FeltToIndexOp>>>
66 FeltToIndexOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
67
68 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
69 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
70 }
71
72 RangeT getODSOperands(unsigned index) {
73 auto valueRange = getODSOperandIndexAndLength(index);
74 return {std::next(odsOperands.begin(), valueRange.first),
75 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
76 }
77
78 ValueT getValue() {
79 return (*getODSOperands(0).begin());
80 }
81
82 RangeT getOperands() {
83 return odsOperands;
84 }
85
86private:
87 RangeT odsOperands;
88};
89class FeltToIndexOpAdaptor : public FeltToIndexOpGenericAdaptor<::mlir::ValueRange> {
90public:
93
94 ::llvm::LogicalResult verify(::mlir::Location loc);
95};
96class FeltToIndexOp : public ::mlir::Op<FeltToIndexOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::IndexType>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait> {
97public:
98 using Op::Op;
99 using Op::print;
101 template <typename RangeT>
104 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
105 return {};
106 }
107
108 static constexpr ::llvm::StringLiteral getOperationName() {
109 return ::llvm::StringLiteral("cast.toindex");
110 }
111
112 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
113 return {index, 1};
114 }
115
116 ::mlir::Operation::operand_range getODSOperands(unsigned index) {
117 auto valueRange = getODSOperandIndexAndLength(index);
118 return {std::next(getOperation()->operand_begin(), valueRange.first),
119 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
120 }
121
122 ::mlir::TypedValue<::llzk::felt::FeltType> getValue() {
123 return ::llvm::cast<::mlir::TypedValue<::llzk::felt::FeltType>>(*getODSOperands(0).begin());
124 }
125
126 ::mlir::OpOperand &getValueMutable() {
127 auto range = getODSOperandIndexAndLength(0);
128 return getOperation()->getOpOperand(range.first);
129 }
130
131 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) {
132 return {index, 1};
133 }
134
135 ::mlir::Operation::result_range getODSResults(unsigned index) {
136 auto valueRange = getODSResultIndexAndLength(index);
137 return {std::next(getOperation()->result_begin(), valueRange.first),
138 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
139 }
140
141 ::mlir::TypedValue<::mlir::IndexType> getResult() {
142 return ::llvm::cast<::mlir::TypedValue<::mlir::IndexType>>(*getODSResults(0).begin());
143 }
144
145 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value value);
146 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value value);
147 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
148 ::llvm::LogicalResult verifyInvariantsImpl();
149 ::llvm::LogicalResult verifyInvariants();
150 ::llvm::LogicalResult verify();
151 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
152 void print(::mlir::OpAsmPrinter &_odsPrinter);
153 void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
154public:
155};
156} // namespace cast
157} // namespace llzk
158MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::cast::FeltToIndexOp)
159
160namespace llzk {
161namespace cast {
162
163//===----------------------------------------------------------------------===//
164// ::llzk::cast::IntToFeltOp declarations
165//===----------------------------------------------------------------------===//
166
167namespace detail {
169public:
170protected:
171 ::mlir::DictionaryAttr odsAttrs;
172 ::std::optional<::mlir::OperationName> odsOpName;
173 ::mlir::RegionRange odsRegions;
174public:
175 IntToFeltOpGenericAdaptorBase(::mlir::DictionaryAttr attrs = {}, const ::mlir::EmptyProperties &properties = {}, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), odsRegions(regions) { if (odsAttrs)
176 odsOpName.emplace("cast.tofelt", odsAttrs.getContext());
177 }
178
179 IntToFeltOpGenericAdaptorBase(::mlir::Operation *op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), odsRegions(op->getRegions()) {}
180
181 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
182 return {index, 1};
183 }
184
185 ::mlir::DictionaryAttr getAttributes() {
186 return odsAttrs;
187 }
188
189};
190} // namespace detail
191template <typename RangeT>
193 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
195public:
196 IntToFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = {}, const ::mlir::EmptyProperties &properties = {}, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
197
198 IntToFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : IntToFeltOpGenericAdaptor(values, attrs, (properties ? *properties.as<::mlir::EmptyProperties *>() : ::mlir::EmptyProperties{}), regions) {}
199
200 IntToFeltOpGenericAdaptor(RangeT values, const IntToFeltOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {}
201
202 template <typename LateInst = IntToFeltOp, typename = std::enable_if_t<std::is_same_v<LateInst, IntToFeltOp>>>
203 IntToFeltOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
204
205 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
206 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
207 }
208
209 RangeT getODSOperands(unsigned index) {
210 auto valueRange = getODSOperandIndexAndLength(index);
211 return {std::next(odsOperands.begin(), valueRange.first),
212 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
213 }
214
215 ValueT getValue() {
216 return (*getODSOperands(0).begin());
217 }
218
219 RangeT getOperands() {
220 return odsOperands;
221 }
222
223private:
224 RangeT odsOperands;
225};
226class IntToFeltOpAdaptor : public IntToFeltOpGenericAdaptor<::mlir::ValueRange> {
227public:
230
231 ::llvm::LogicalResult verify(::mlir::Location loc);
232};
233class IntToFeltOp : public ::mlir::Op<IntToFeltOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::llzk::felt::FeltType>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait> {
234public:
235 using Op::Op;
236 using Op::print;
238 template <typename RangeT>
241 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
242 return {};
243 }
244
245 static constexpr ::llvm::StringLiteral getOperationName() {
246 return ::llvm::StringLiteral("cast.tofelt");
247 }
248
249 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
250 return {index, 1};
251 }
252
253 ::mlir::Operation::operand_range getODSOperands(unsigned index) {
254 auto valueRange = getODSOperandIndexAndLength(index);
255 return {std::next(getOperation()->operand_begin(), valueRange.first),
256 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
257 }
258
259 ::mlir::TypedValue<::mlir::Type> getValue() {
260 return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(*getODSOperands(0).begin());
261 }
262
263 ::mlir::OpOperand &getValueMutable() {
264 auto range = getODSOperandIndexAndLength(0);
265 return getOperation()->getOpOperand(range.first);
266 }
267
268 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) {
269 return {index, 1};
270 }
271
272 ::mlir::Operation::result_range getODSResults(unsigned index) {
273 auto valueRange = getODSResultIndexAndLength(index);
274 return {std::next(getOperation()->result_begin(), valueRange.first),
275 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
276 }
277
278 ::mlir::TypedValue<::llzk::felt::FeltType> getResult() {
279 return ::llvm::cast<::mlir::TypedValue<::llzk::felt::FeltType>>(*getODSResults(0).begin());
280 }
281
282 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value value);
283 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value value);
284 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
285 ::llvm::LogicalResult verifyInvariantsImpl();
286 ::llvm::LogicalResult verifyInvariants();
287 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
288 void print(::mlir::OpAsmPrinter &_odsPrinter);
289 void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
290public:
291};
292} // namespace cast
293} // namespace llzk
294MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::cast::IntToFeltOp)
295
296
297#endif // GET_OP_CLASSES
298
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:70
FeltToIndexOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:59
FeltToIndexOpAdaptor(FeltToIndexOp op)
Definition Ops.cpp.inc:68
FeltToIndexOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:66
FeltToIndexOpGenericAdaptor(RangeT values, const FeltToIndexOpGenericAdaptorBase &base)
Definition Ops.h.inc:63
FeltToIndexOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:59
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:68
FeltToIndexOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:61
RangeT getODSOperands(unsigned index)
Definition Ops.h.inc:72
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:115
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
Definition Ops.h.inc:104
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:149
::llvm::LogicalResult verify()
Definition Ops.cpp:28
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value value)
Definition Ops.cpp.inc:74
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.h.inc:131
::mlir::OpOperand & getValueMutable()
Definition Ops.h.inc:126
::mlir::TypedValue<::llzk::felt::FeltType > getValue()
Definition Ops.h.inc:122
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:112
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:142
::mlir::TypedValue<::mlir::IndexType > getResult()
Definition Ops.h.inc:141
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:135
FeltToIndexOpAdaptor Adaptor
Definition Ops.h.inc:100
FeltToIndexOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:102
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:103
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:121
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:116
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:93
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:108
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:167
IntToFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:196
IntToFeltOpAdaptor(IntToFeltOp op)
Definition Ops.cpp.inc:165
IntToFeltOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:203
IntToFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:196
IntToFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:198
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:205
IntToFeltOpGenericAdaptor(RangeT values, const IntToFeltOpGenericAdaptorBase &base)
Definition Ops.h.inc:200
RangeT getODSOperands(unsigned index)
Definition Ops.h.inc:209
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:240
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:247
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:190
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:245
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:263
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:249
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
Definition Ops.h.inc:241
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.h.inc:268
IntToFeltOpAdaptor Adaptor
Definition Ops.h.inc:237
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:253
::mlir::TypedValue<::llzk::felt::FeltType > getResult()
Definition Ops.h.inc:278
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:216
IntToFeltOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:239
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value value)
Definition Ops.cpp.inc:171
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:272
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:212
::mlir::TypedValue<::mlir::Type > getValue()
Definition Ops.h.inc:259
::mlir::OpOperand & getValueMutable()
Definition Ops.h.inc:263
FeltToIndexOpGenericAdaptorBase(::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:38
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:35
FeltToIndexOpGenericAdaptorBase(::mlir::Operation *op)
Definition Ops.h.inc:42
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.h.inc:44
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:172
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.h.inc:181
IntToFeltOpGenericAdaptorBase(::mlir::Operation *op)
Definition Ops.h.inc:179
IntToFeltOpGenericAdaptorBase(::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:175