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 constrain {
13} // namespace constrain
14} // namespace llzk
15namespace llzk {
16namespace constrain {
17class EmitEqualityOp;
18} // namespace constrain
19} // namespace llzk
20#ifdef GET_OP_CLASSES
21#undef GET_OP_CLASSES
22
23namespace llzk {
24namespace constrain {
25
26//===----------------------------------------------------------------------===//
27// ::llzk::constrain::EmitContainmentOp declarations
28//===----------------------------------------------------------------------===//
29
30namespace detail {
32public:
33protected:
34 ::mlir::DictionaryAttr odsAttrs;
35 ::std::optional<::mlir::OperationName> odsOpName;
36 ::mlir::RegionRange odsRegions;
37public:
38 EmitContainmentOpGenericAdaptorBase(::mlir::DictionaryAttr attrs = {}, const ::mlir::EmptyProperties &properties = {}, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), odsRegions(regions) { if (odsAttrs)
39 odsOpName.emplace("constrain.in", odsAttrs.getContext());
40 }
41
42 EmitContainmentOpGenericAdaptorBase(::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 EmitContainmentOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = {}, const ::mlir::EmptyProperties &properties = {}, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
60
61 EmitContainmentOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : EmitContainmentOpGenericAdaptor(values, attrs, (properties ? *properties.as<::mlir::EmptyProperties *>() : ::mlir::EmptyProperties{}), regions) {}
62
63 EmitContainmentOpGenericAdaptor(RangeT values, const EmitContainmentOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {}
64
65 template <typename LateInst = EmitContainmentOp, typename = std::enable_if_t<std::is_same_v<LateInst, EmitContainmentOp>>>
66 EmitContainmentOpGenericAdaptor(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 getLhs() {
79 return (*getODSOperands(0).begin());
80 }
81
82 ValueT getRhs() {
83 return (*getODSOperands(1).begin());
84 }
85
86 RangeT getOperands() {
87 return odsOperands;
88 }
89
90private:
91 RangeT odsOperands;
92};
94public:
97
98 ::llvm::LogicalResult verify(::mlir::Location loc);
99};
100class EmitContainmentOp : public ::mlir::Op<EmitContainmentOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::ZeroResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::llzk::function::ConstraintGen, ::mlir::OpTrait::OpInvariants, ::llzk::constrain::ConstraintOpInterface::Trait, ::mlir::SymbolUserOpInterface::Trait> {
101public:
102 using Op::Op;
103 using Op::print;
105 template <typename RangeT>
108 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
109 return {};
110 }
111
112 static constexpr ::llvm::StringLiteral getOperationName() {
113 return ::llvm::StringLiteral("constrain.in");
114 }
115
116 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
117 return {index, 1};
118 }
119
120 ::mlir::Operation::operand_range getODSOperands(unsigned index) {
121 auto valueRange = getODSOperandIndexAndLength(index);
122 return {std::next(getOperation()->operand_begin(), valueRange.first),
123 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
124 }
125
126 ::mlir::TypedValue<::llzk::array::ArrayType> getLhs() {
127 return ::llvm::cast<::mlir::TypedValue<::llzk::array::ArrayType>>(*getODSOperands(0).begin());
128 }
129
130 ::mlir::TypedValue<::mlir::Type> getRhs() {
131 return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(*getODSOperands(1).begin());
132 }
133
134 ::mlir::OpOperand &getLhsMutable() {
135 auto range = getODSOperandIndexAndLength(0);
136 return getOperation()->getOpOperand(range.first);
137 }
138
139 ::mlir::OpOperand &getRhsMutable() {
140 auto range = getODSOperandIndexAndLength(1);
141 return getOperation()->getOpOperand(range.first);
142 }
143
144 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) {
145 return {index, 1};
146 }
147
148 ::mlir::Operation::result_range getODSResults(unsigned index) {
149 auto valueRange = getODSResultIndexAndLength(index);
150 return {std::next(getOperation()->result_begin(), valueRange.first),
151 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
152 }
153
154 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs);
155 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs);
156 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
157 ::llvm::LogicalResult verifyInvariantsImpl();
158 ::llvm::LogicalResult verifyInvariants();
159 ::llvm::LogicalResult verify();
160 ::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable);
161 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
162 void print(::mlir::OpAsmPrinter &_odsPrinter);
163public:
164};
165} // namespace constrain
166} // namespace llzk
167MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::constrain::EmitContainmentOp)
168
169namespace llzk {
170namespace constrain {
171
172//===----------------------------------------------------------------------===//
173// ::llzk::constrain::EmitEqualityOp declarations
174//===----------------------------------------------------------------------===//
175
176namespace detail {
178public:
179protected:
180 ::mlir::DictionaryAttr odsAttrs;
181 ::std::optional<::mlir::OperationName> odsOpName;
182 ::mlir::RegionRange odsRegions;
183public:
184 EmitEqualityOpGenericAdaptorBase(::mlir::DictionaryAttr attrs = {}, const ::mlir::EmptyProperties &properties = {}, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), odsRegions(regions) { if (odsAttrs)
185 odsOpName.emplace("constrain.eq", odsAttrs.getContext());
186 }
187
188 EmitEqualityOpGenericAdaptorBase(::mlir::Operation *op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), odsRegions(op->getRegions()) {}
189
190 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
191 return {index, 1};
192 }
193
194 ::mlir::DictionaryAttr getAttributes() {
195 return odsAttrs;
196 }
197
198};
199} // namespace detail
200template <typename RangeT>
202 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
204public:
205 EmitEqualityOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = {}, const ::mlir::EmptyProperties &properties = {}, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
206
207 EmitEqualityOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : EmitEqualityOpGenericAdaptor(values, attrs, (properties ? *properties.as<::mlir::EmptyProperties *>() : ::mlir::EmptyProperties{}), regions) {}
208
209 EmitEqualityOpGenericAdaptor(RangeT values, const EmitEqualityOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {}
210
211 template <typename LateInst = EmitEqualityOp, typename = std::enable_if_t<std::is_same_v<LateInst, EmitEqualityOp>>>
212 EmitEqualityOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
213
214 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
215 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
216 }
217
218 RangeT getODSOperands(unsigned index) {
219 auto valueRange = getODSOperandIndexAndLength(index);
220 return {std::next(odsOperands.begin(), valueRange.first),
221 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
222 }
223
224 ValueT getLhs() {
225 return (*getODSOperands(0).begin());
226 }
227
228 ValueT getRhs() {
229 return (*getODSOperands(1).begin());
230 }
231
232 RangeT getOperands() {
233 return odsOperands;
234 }
235
236private:
237 RangeT odsOperands;
238};
239class EmitEqualityOpAdaptor : public EmitEqualityOpGenericAdaptor<::mlir::ValueRange> {
240public:
243
244 ::llvm::LogicalResult verify(::mlir::Location loc);
245};
246class EmitEqualityOp : public ::mlir::Op<EmitEqualityOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::ZeroResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::llzk::function::ConstraintGen, ::mlir::OpTrait::OpInvariants, ::mlir::OpTrait::IsCommutative, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable, ::llzk::constrain::ConstraintOpInterface::Trait, ::mlir::SymbolUserOpInterface::Trait> {
247public:
248 using Op::Op;
249 using Op::print;
251 template <typename RangeT>
254 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
255 return {};
256 }
257
258 static constexpr ::llvm::StringLiteral getOperationName() {
259 return ::llvm::StringLiteral("constrain.eq");
260 }
261
262 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
263 return {index, 1};
264 }
265
266 ::mlir::Operation::operand_range getODSOperands(unsigned index) {
267 auto valueRange = getODSOperandIndexAndLength(index);
268 return {std::next(getOperation()->operand_begin(), valueRange.first),
269 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
270 }
271
272 ::mlir::TypedValue<::mlir::Type> getLhs() {
273 return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(*getODSOperands(0).begin());
274 }
275
276 ::mlir::TypedValue<::mlir::Type> getRhs() {
277 return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(*getODSOperands(1).begin());
278 }
279
280 ::mlir::OpOperand &getLhsMutable() {
281 auto range = getODSOperandIndexAndLength(0);
282 return getOperation()->getOpOperand(range.first);
283 }
284
285 ::mlir::OpOperand &getRhsMutable() {
286 auto range = getODSOperandIndexAndLength(1);
287 return getOperation()->getOpOperand(range.first);
288 }
289
290 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) {
291 return {index, 1};
292 }
293
294 ::mlir::Operation::result_range getODSResults(unsigned index) {
295 auto valueRange = getODSResultIndexAndLength(index);
296 return {std::next(getOperation()->result_begin(), valueRange.first),
297 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
298 }
299
300 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs);
301 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs);
302 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
303 ::llvm::LogicalResult verifyInvariantsImpl();
304 ::llvm::LogicalResult verifyInvariants();
305 ::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable);
306 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
307 void print(::mlir::OpAsmPrinter &_odsPrinter);
308public:
309 static ::mlir::Type inferRHS(::mlir::Type lhsType);
310
311 static ::mlir::ParseResult parseInferredOrParsedType(::mlir::OpAsmParser &parser,
312 ::mlir::Type &rhsType, ::mlir::Type lhsType
313 ) {
314 if (mlir::succeeded(parser.parseOptionalComma())) {
315 // If there is a comma, parse the `rhsType`
316 mlir::Type type;
317 if (parser.parseCustomTypeWithFallback(type)) {
318 return mlir::failure();
319 }
320 rhsType = type;
321 } else {
322 // Otherwise, infer the `rhsType` from `lhsType`
323 rhsType = inferRHS(lhsType);
324 }
325 return mlir::success();
326 }
327
328 static void printInferredOrParsedType(::mlir::OpAsmPrinter &printer,
329 ::mlir::Operation *op, ::mlir::Type rhsType, ::mlir::Type lhsType
330 ) {
331 printer << ", ";
332 printer.printStrippedAttrOrType(rhsType);
333 }
334};
335} // namespace constrain
336} // namespace llzk
337MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::constrain::EmitEqualityOp)
338
339
340#endif // GET_OP_CLASSES
341
EmitContainmentOpAdaptor(EmitContainmentOp op)
Definition Ops.cpp.inc:68
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:70
EmitContainmentOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:59
EmitContainmentOpGenericAdaptor(RangeT values, const EmitContainmentOpGenericAdaptorBase &base)
Definition Ops.h.inc:63
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:68
EmitContainmentOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:66
EmitContainmentOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:59
EmitContainmentOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:61
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:94
EmitContainmentOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:106
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:113
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:74
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:148
::llvm::LogicalResult verify()
Definition Ops.cpp:50
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:107
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
Definition Ops.h.inc:108
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.h.inc:144
::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable)
Definition Ops.cpp:43
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:112
::mlir::TypedValue<::mlir::Type > getRhs()
Definition Ops.h.inc:130
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:116
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:120
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:170
EmitContainmentOpAdaptor Adaptor
Definition Ops.h.inc:104
::mlir::OpOperand & getRhsMutable()
Definition Ops.h.inc:139
::mlir::TypedValue<::llzk::array::ArrayType > getLhs()
Definition Ops.h.inc:126
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:119
::mlir::OpOperand & getLhsMutable()
Definition Ops.h.inc:134
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:213
EmitEqualityOpAdaptor(EmitEqualityOp op)
Definition Ops.cpp.inc:211
EmitEqualityOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:205
EmitEqualityOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:207
EmitEqualityOpGenericAdaptor(RangeT values, const EmitEqualityOpGenericAdaptorBase &base)
Definition Ops.h.inc:209
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:214
EmitEqualityOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:212
EmitEqualityOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:205
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:262
static void printInferredOrParsedType(::mlir::OpAsmPrinter &printer, ::mlir::Operation *op, ::mlir::Type rhsType, ::mlir::Type lhsType)
Definition Ops.h.inc:328
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:258
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:253
EmitEqualityOpAdaptor Adaptor
Definition Ops.h.inc:250
::mlir::OpOperand & getRhsMutable()
Definition Ops.h.inc:285
::mlir::Type inferRHS(::mlir::Type lhsType)
Definition Ops.cpp:37
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:262
::mlir::TypedValue<::mlir::Type > getLhs()
Definition Ops.h.inc:272
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:266
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:294
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:308
::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable)
Definition Ops.cpp:30
::mlir::ParseResult parseInferredOrParsedType(::mlir::OpAsmParser &parser, ::mlir::Type &rhsType, ::mlir::Type lhsType)
Definition Ops.h.inc:311
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:258
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:217
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:237
::mlir::OpOperand & getLhsMutable()
Definition Ops.h.inc:280
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.h.inc:290
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
Definition Ops.h.inc:254
::mlir::TypedValue<::mlir::Type > getRhs()
Definition Ops.h.inc:276
EmitEqualityOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:252
EmitContainmentOpGenericAdaptorBase(::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:38
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.h.inc:44
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:35
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:181
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.h.inc:190
EmitEqualityOpGenericAdaptorBase(::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:184