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 constrain {
15} // namespace constrain
16} // namespace llzk
17namespace llzk {
18namespace constrain {
19class EmitEqualityOp;
20} // namespace constrain
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 constrain {
34
35//===----------------------------------------------------------------------===//
36// ::llzk::constrain::EmitContainmentOp declarations
37//===----------------------------------------------------------------------===//
38
39namespace detail {
41public:
42protected:
43 ::mlir::DictionaryAttr odsAttrs;
44 ::std::optional<::mlir::OperationName> odsOpName;
45 ::mlir::RegionRange odsRegions;
46public:
47 EmitContainmentOpGenericAdaptorBase(::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 EmitContainmentOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr, const ::mlir::EmptyProperties &properties = {}, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
61
62 EmitContainmentOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : EmitContainmentOpGenericAdaptor(values, attrs, (properties ? *properties.as<::mlir::EmptyProperties *>() : ::mlir::EmptyProperties{}), regions) {}
63
64 template <typename LateInst = EmitContainmentOp, typename = std::enable_if_t<std::is_same_v<LateInst, EmitContainmentOp>>>
65 EmitContainmentOpGenericAdaptor(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 getLhs() {
78 return (*getODSOperands(0).begin());
79 }
80
81 ValueT getRhs() {
82 return (*getODSOperands(1).begin());
83 }
84
85 RangeT getOperands() {
86 return odsOperands;
87 }
88
89private:
90 RangeT odsOperands;
91};
93public:
96
97 ::mlir::LogicalResult verify(::mlir::Location loc);
98};
99class 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> {
100public:
101 using Op::Op;
102 using Op::print;
104 template <typename RangeT>
107 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
108 return {};
109 }
110
111 static constexpr ::llvm::StringLiteral getOperationName() {
112 return ::llvm::StringLiteral("constrain.in");
113 }
114
115 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
116 ::mlir::Operation::operand_range getODSOperands(unsigned index);
117 ::mlir::TypedValue<::llzk::array::ArrayType> getLhs();
118 ::mlir::Value getRhs();
119 ::mlir::OpOperand &getLhsMutable();
120 ::mlir::OpOperand &getRhsMutable();
121 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
122 ::mlir::Operation::result_range getODSResults(unsigned index);
123 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs);
124 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs);
125 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
126 ::mlir::LogicalResult verifyInvariantsImpl();
127 ::mlir::LogicalResult verifyInvariants();
128 ::mlir::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable);
129 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
130 void print(::mlir::OpAsmPrinter &_odsPrinter);
131public:
132 static ::mlir::Type inferRHS(::mlir::Type lhsType);
133
134 static ::mlir::ParseResult parseInferredOrParsedType(::mlir::OpAsmParser &parser,
135 ::mlir::Type &rhsType, ::mlir::Type lhsType
136 ) {
137 if (mlir::succeeded(parser.parseOptionalComma())) {
138 // If there is a comma, parse the `rhsType`
139 mlir::Type type;
140 if (parser.parseCustomTypeWithFallback(type)) {
141 return mlir::failure();
142 }
143 rhsType = type;
144 } else {
145 // Otherwise, infer the `rhsType` from `lhsType`
146 rhsType = inferRHS(lhsType);
147 }
148 return mlir::success();
149 }
150
151 static void printInferredOrParsedType(::mlir::OpAsmPrinter &printer,
152 ::mlir::Operation *op, ::mlir::Type rhsType, ::mlir::Type lhsType
153 ) {
154 printer << ", ";
155 printer.printStrippedAttrOrType(rhsType);
156 }
157};
158} // namespace constrain
159} // namespace llzk
160MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::constrain::EmitContainmentOp)
161
162namespace llzk {
163namespace constrain {
164
165//===----------------------------------------------------------------------===//
166// ::llzk::constrain::EmitEqualityOp declarations
167//===----------------------------------------------------------------------===//
168
169namespace detail {
171public:
172protected:
173 ::mlir::DictionaryAttr odsAttrs;
174 ::std::optional<::mlir::OperationName> odsOpName;
175 ::mlir::RegionRange odsRegions;
176public:
177 EmitEqualityOpGenericAdaptorBase(::mlir::DictionaryAttr attrs = nullptr, const ::mlir::EmptyProperties &properties = {}, ::mlir::RegionRange regions = {});
178
180
181 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
182 ::mlir::DictionaryAttr getAttributes();
183};
184} // namespace detail
185template <typename RangeT>
187 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
189public:
190 EmitEqualityOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr, const ::mlir::EmptyProperties &properties = {}, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
191
192 EmitEqualityOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : EmitEqualityOpGenericAdaptor(values, attrs, (properties ? *properties.as<::mlir::EmptyProperties *>() : ::mlir::EmptyProperties{}), regions) {}
193
194 template <typename LateInst = EmitEqualityOp, typename = std::enable_if_t<std::is_same_v<LateInst, EmitEqualityOp>>>
195 EmitEqualityOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
196
197 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
198 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
199 }
200
201 RangeT getODSOperands(unsigned index) {
202 auto valueRange = getODSOperandIndexAndLength(index);
203 return {std::next(odsOperands.begin(), valueRange.first),
204 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
205 }
206
207 ValueT getLhs() {
208 return (*getODSOperands(0).begin());
209 }
210
211 ValueT getRhs() {
212 return (*getODSOperands(1).begin());
213 }
214
215 RangeT getOperands() {
216 return odsOperands;
217 }
218
219private:
220 RangeT odsOperands;
221};
222class EmitEqualityOpAdaptor : public EmitEqualityOpGenericAdaptor<::mlir::ValueRange> {
223public:
226
227 ::mlir::LogicalResult verify(::mlir::Location loc);
228};
229class 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> {
230public:
231 using Op::Op;
232 using Op::print;
234 template <typename RangeT>
237 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
238 return {};
239 }
240
241 static constexpr ::llvm::StringLiteral getOperationName() {
242 return ::llvm::StringLiteral("constrain.eq");
243 }
244
245 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
246 ::mlir::Operation::operand_range getODSOperands(unsigned index);
247 ::mlir::Value getLhs();
248 ::mlir::Value getRhs();
249 ::mlir::OpOperand &getLhsMutable();
250 ::mlir::OpOperand &getRhsMutable();
251 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
252 ::mlir::Operation::result_range getODSResults(unsigned index);
253 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs);
254 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs);
255 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
256 ::mlir::LogicalResult verifyInvariantsImpl();
257 ::mlir::LogicalResult verifyInvariants();
258 ::mlir::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable);
259 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
260 void print(::mlir::OpAsmPrinter &_odsPrinter);
261public:
262 static ::mlir::Type inferRHS(::mlir::Type lhsType);
263
264 static ::mlir::ParseResult parseInferredOrParsedType(::mlir::OpAsmParser &parser,
265 ::mlir::Type &rhsType, ::mlir::Type lhsType
266 ) {
267 if (mlir::succeeded(parser.parseOptionalComma())) {
268 // If there is a comma, parse the `rhsType`
269 mlir::Type type;
270 if (parser.parseCustomTypeWithFallback(type)) {
271 return mlir::failure();
272 }
273 rhsType = type;
274 } else {
275 // Otherwise, infer the `rhsType` from `lhsType`
276 rhsType = inferRHS(lhsType);
277 }
278 return mlir::success();
279 }
280
281 static void printInferredOrParsedType(::mlir::OpAsmPrinter &printer,
282 ::mlir::Operation *op, ::mlir::Type rhsType, ::mlir::Type lhsType
283 ) {
284 printer << ", ";
285 printer.printStrippedAttrOrType(rhsType);
286 }
287};
288} // namespace constrain
289} // namespace llzk
290MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::constrain::EmitEqualityOp)
291
292
293#endif // GET_OP_CLASSES
294
EmitContainmentOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:60
EmitContainmentOpAdaptor(EmitContainmentOp op)
Definition Ops.cpp.inc:82
::mlir::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:84
EmitContainmentOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:60
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:67
EmitContainmentOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:65
EmitContainmentOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:62
EmitContainmentOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:105
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:126
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:106
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
Definition Ops.h.inc:107
::mlir::Type inferRHS(::mlir::Type lhsType)
Definition Ops.cpp:49
::mlir::OpOperand & getRhsMutable()
Definition Ops.cpp.inc:111
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.cpp.inc:116
::mlir::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable)
Definition Ops.cpp:42
static void printInferredOrParsedType(::mlir::OpAsmPrinter &printer, ::mlir::Operation *op, ::mlir::Type rhsType, ::mlir::Type lhsType)
Definition Ops.h.inc:151
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.cpp.inc:92
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:111
::mlir::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:167
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.cpp.inc:88
::mlir::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:146
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:217
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.cpp.inc:120
::mlir::ParseResult parseInferredOrParsedType(::mlir::OpAsmParser &parser, ::mlir::Type &rhsType, ::mlir::Type lhsType)
Definition Ops.h.inc:134
::mlir::OpOperand & getLhsMutable()
Definition Ops.cpp.inc:106
EmitContainmentOpAdaptor Adaptor
Definition Ops.h.inc:103
::mlir::TypedValue<::llzk::array::ArrayType > getLhs()
Definition Ops.cpp.inc:98
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:171
::mlir::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:266
EmitEqualityOpAdaptor(EmitEqualityOp op)
Definition Ops.cpp.inc:264
EmitEqualityOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:190
EmitEqualityOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:192
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:197
EmitEqualityOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:190
EmitEqualityOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:195
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.cpp.inc:270
::mlir::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:328
::mlir::OpOperand & getRhsMutable()
Definition Ops.cpp.inc:293
static void printInferredOrParsedType(::mlir::OpAsmPrinter &printer, ::mlir::Operation *op, ::mlir::Type rhsType, ::mlir::Type lhsType)
Definition Ops.h.inc:281
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:241
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.cpp.inc:274
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:236
EmitEqualityOpAdaptor Adaptor
Definition Ops.h.inc:233
::mlir::Type inferRHS(::mlir::Type lhsType)
Definition Ops.cpp:36
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:353
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.cpp.inc:302
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:399
::mlir::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable)
Definition Ops.cpp:29
::mlir::OpOperand & getLhsMutable()
Definition Ops.cpp.inc:288
::mlir::ParseResult parseInferredOrParsedType(::mlir::OpAsmParser &parser, ::mlir::Type &rhsType, ::mlir::Type lhsType)
Definition Ops.h.inc:264
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs)
Definition Ops.cpp.inc:308
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.cpp.inc:298
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
Definition Ops.h.inc:237
::mlir::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:349
EmitEqualityOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:235
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.cpp.inc:73
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:44
EmitContainmentOpGenericAdaptorBase(::mlir::DictionaryAttr attrs=nullptr, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.cpp.inc:67
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:174
EmitEqualityOpGenericAdaptorBase(::mlir::DictionaryAttr attrs=nullptr, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.cpp.inc:249
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.cpp.inc:255