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
10#if defined(GET_OP_CLASSES) || defined(GET_OP_FWD_DEFINES)
11#undef GET_OP_FWD_DEFINES
12namespace llzk {
13namespace cast {
14class FeltToIndexOp;
15} // namespace cast
16} // namespace llzk
17namespace llzk {
18namespace cast {
19class IntToFeltOp;
20} // namespace cast
21} // namespace llzk
22#endif
23
24#ifdef GET_OP_CLASSES
25#undef GET_OP_CLASSES
26
27
28//===----------------------------------------------------------------------===//
29// Local Utility Method Definitions
30//===----------------------------------------------------------------------===//
31
32namespace llzk {
33namespace cast {
34
35//===----------------------------------------------------------------------===//
36// ::llzk::cast::FeltToIndexOp declarations
37//===----------------------------------------------------------------------===//
38
39namespace detail {
41public:
42protected:
43 ::mlir::DictionaryAttr odsAttrs;
44 ::std::optional<::mlir::OperationName> odsOpName;
45 ::mlir::RegionRange odsRegions;
46public:
47 FeltToIndexOpGenericAdaptorBase(::mlir::DictionaryAttr attrs = nullptr, const ::mlir::EmptyProperties &properties = {}, ::mlir::RegionRange regions = {});
48
50
51 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
52 ::mlir::DictionaryAttr getAttributes();
53};
54} // namespace detail
55template <typename RangeT>
57 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
59public:
60 FeltToIndexOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr, const ::mlir::EmptyProperties &properties = {}, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
61
62 FeltToIndexOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : FeltToIndexOpGenericAdaptor(values, attrs, (properties ? *properties.as<::mlir::EmptyProperties *>() : ::mlir::EmptyProperties{}), regions) {}
63
64 template <typename LateInst = FeltToIndexOp, typename = std::enable_if_t<std::is_same_v<LateInst, FeltToIndexOp>>>
65 FeltToIndexOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
66
67 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
68 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
69 }
70
71 RangeT getODSOperands(unsigned index) {
72 auto valueRange = getODSOperandIndexAndLength(index);
73 return {std::next(odsOperands.begin(), valueRange.first),
74 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
75 }
76
77 ValueT getValue() {
78 return (*getODSOperands(0).begin());
79 }
80
81 RangeT getOperands() {
82 return odsOperands;
83 }
84
85private:
86 RangeT odsOperands;
87};
88class FeltToIndexOpAdaptor : public FeltToIndexOpGenericAdaptor<::mlir::ValueRange> {
89public:
92
93 ::mlir::LogicalResult verify(::mlir::Location loc);
94};
95class 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> {
96public:
97 using Op::Op;
98 using Op::print;
100 template <typename RangeT>
103 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
104 return {};
105 }
106
107 static constexpr ::llvm::StringLiteral getOperationName() {
108 return ::llvm::StringLiteral("cast.toindex");
109 }
110
111 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
112 ::mlir::Operation::operand_range getODSOperands(unsigned index);
113 ::mlir::TypedValue<::llzk::felt::FeltType> getValue();
114 ::mlir::OpOperand &getValueMutable();
115 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
116 ::mlir::Operation::result_range getODSResults(unsigned index);
117 ::mlir::TypedValue<::mlir::IndexType> getResult();
118 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value value);
119 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value value);
120 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
121 ::mlir::LogicalResult verifyInvariantsImpl();
122 ::mlir::LogicalResult verifyInvariants();
123 ::mlir::LogicalResult verify();
124 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
125 void print(::mlir::OpAsmPrinter &_odsPrinter);
126 void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
127public:
128};
129} // namespace cast
130} // namespace llzk
131MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::cast::FeltToIndexOp)
132
133namespace llzk {
134namespace cast {
135
136//===----------------------------------------------------------------------===//
137// ::llzk::cast::IntToFeltOp declarations
138//===----------------------------------------------------------------------===//
139
140namespace detail {
142public:
143protected:
144 ::mlir::DictionaryAttr odsAttrs;
145 ::std::optional<::mlir::OperationName> odsOpName;
146 ::mlir::RegionRange odsRegions;
147public:
148 IntToFeltOpGenericAdaptorBase(::mlir::DictionaryAttr attrs = nullptr, const ::mlir::EmptyProperties &properties = {}, ::mlir::RegionRange regions = {});
149
151
152 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
153 ::mlir::DictionaryAttr getAttributes();
154};
155} // namespace detail
156template <typename RangeT>
158 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
160public:
161 IntToFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr, const ::mlir::EmptyProperties &properties = {}, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
162
163 IntToFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : IntToFeltOpGenericAdaptor(values, attrs, (properties ? *properties.as<::mlir::EmptyProperties *>() : ::mlir::EmptyProperties{}), regions) {}
164
165 template <typename LateInst = IntToFeltOp, typename = std::enable_if_t<std::is_same_v<LateInst, IntToFeltOp>>>
166 IntToFeltOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
167
168 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
169 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
170 }
171
172 RangeT getODSOperands(unsigned index) {
173 auto valueRange = getODSOperandIndexAndLength(index);
174 return {std::next(odsOperands.begin(), valueRange.first),
175 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
176 }
177
178 ValueT getValue() {
179 return (*getODSOperands(0).begin());
180 }
181
182 RangeT getOperands() {
183 return odsOperands;
184 }
185
186private:
187 RangeT odsOperands;
188};
189class IntToFeltOpAdaptor : public IntToFeltOpGenericAdaptor<::mlir::ValueRange> {
190public:
193
194 ::mlir::LogicalResult verify(::mlir::Location loc);
195};
196class 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> {
197public:
198 using Op::Op;
199 using Op::print;
201 template <typename RangeT>
204 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
205 return {};
206 }
207
208 static constexpr ::llvm::StringLiteral getOperationName() {
209 return ::llvm::StringLiteral("cast.tofelt");
210 }
211
212 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
213 ::mlir::Operation::operand_range getODSOperands(unsigned index);
214 ::mlir::Value getValue();
215 ::mlir::OpOperand &getValueMutable();
216 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
217 ::mlir::Operation::result_range getODSResults(unsigned index);
218 ::mlir::TypedValue<::llzk::felt::FeltType> getResult();
219 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value value);
220 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value value);
221 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
222 ::mlir::LogicalResult verifyInvariantsImpl();
223 ::mlir::LogicalResult verifyInvariants();
224 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
225 void print(::mlir::OpAsmPrinter &_odsPrinter);
226 void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
227public:
228};
229} // namespace cast
230} // namespace llzk
231MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::cast::IntToFeltOp)
232
233
234#endif // GET_OP_CLASSES
235
::mlir::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:84
FeltToIndexOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:60
FeltToIndexOpAdaptor(FeltToIndexOp op)
Definition Ops.cpp.inc:82
FeltToIndexOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:65
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:67
FeltToIndexOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:62
FeltToIndexOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:60
RangeT getODSOperands(unsigned index)
Definition Ops.h.inc:71
::mlir::OpOperand & getValueMutable()
Definition Ops.cpp.inc:102
::mlir::TypedValue<::mlir::IndexType > getResult()
Definition Ops.cpp.inc:117
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.cpp.inc:92
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.cpp.inc:111
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
Definition Ops.h.inc:103
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:196
::mlir::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:121
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.cpp.inc:107
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.cpp.inc:88
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:189
::mlir::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:162
::mlir::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:140
::mlir::TypedValue<::llzk::felt::FeltType > getValue()
Definition Ops.cpp.inc:98
FeltToIndexOpAdaptor Adaptor
Definition Ops.h.inc:99
FeltToIndexOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:101
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:102
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:168
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:107
IntToFeltOpAdaptor(IntToFeltOp op)
Definition Ops.cpp.inc:226
IntToFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:161
::mlir::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:228
IntToFeltOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:166
IntToFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:163
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:168
IntToFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:161
RangeT getODSOperands(unsigned index)
Definition Ops.h.inc:172
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:203
::mlir::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:284
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:341
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.cpp.inc:236
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:208
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:357
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.cpp.inc:232
::mlir::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:306
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
Definition Ops.h.inc:204
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.cpp.inc:251
IntToFeltOpAdaptor Adaptor
Definition Ops.h.inc:200
::mlir::TypedValue<::llzk::felt::FeltType > getResult()
Definition Ops.cpp.inc:261
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:310
IntToFeltOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:202
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value value)
Definition Ops.cpp.inc:265
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.cpp.inc:255
::mlir::OpOperand & getValueMutable()
Definition Ops.cpp.inc:246
::mlir::Value getValue()
Definition Ops.cpp.inc:242
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:44
FeltToIndexOpGenericAdaptorBase(::mlir::DictionaryAttr attrs=nullptr, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.cpp.inc:67
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.cpp.inc:73
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:145
IntToFeltOpGenericAdaptorBase(::mlir::DictionaryAttr attrs=nullptr, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.cpp.inc:211
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.cpp.inc:217