LLZK 3.0.0
An open-source IR for Zero Knowledge (ZK) circuits
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 {
11
61class NonDetOp;
62
63} // namespace llzk
64#ifdef GET_OP_CLASSES
65#undef GET_OP_CLASSES
66
67namespace llzk {
68
69
70//===----------------------------------------------------------------------===//
71// ::llzk::NonDetOp declarations
72//===----------------------------------------------------------------------===//
73
74namespace detail {
75
77public:
78 using Properties = ::mlir::EmptyProperties;
79protected:
80 ::mlir::DictionaryAttr odsAttrs;
81 ::std::optional<::mlir::OperationName> odsOpName;
83 ::mlir::RegionRange odsRegions;
84public:
85 NonDetOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
86 odsOpName.emplace("llzk.nondet", odsAttrs.getContext());
87 }
88
90
91 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
92 return {index, 1};
93 }
94
96 return properties;
97 }
98
99 ::mlir::DictionaryAttr getAttributes() {
100 return odsAttrs;
101 }
102
103};
104
105} // namespace detail
106template <typename RangeT>
108 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
110public:
111 NonDetOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
112
113 NonDetOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : NonDetOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
114
115 NonDetOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : NonDetOpGenericAdaptor(values, attrs, Properties{}, {}) {}
116
117 NonDetOpGenericAdaptor(RangeT values, const NonDetOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {}
118
119 template <typename LateInst = NonDetOp, typename = std::enable_if_t<std::is_same_v<LateInst, NonDetOp>>>
120 NonDetOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
121
122 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
123 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
124 }
125
126 RangeT getODSOperands(unsigned index) {
127 auto valueRange = getODSOperandIndexAndLength(index);
128 return {std::next(odsOperands.begin(), valueRange.first),
129 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
130 }
131
132 RangeT getOperands() {
133 return odsOperands;
134 }
135
136private:
137 RangeT odsOperands;
138};
139class NonDetOpAdaptor : public NonDetOpGenericAdaptor<::mlir::ValueRange> {
140public:
143
144 ::llvm::LogicalResult verify(::mlir::Location loc);
145};
146class NonDetOp : public ::mlir::Op<NonDetOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::ZeroOperands, ::mlir::OpTrait::OpInvariants, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::OpAsmOpInterface::Trait> {
147public:
148 using Op::Op;
149 using Op::print;
151 template <typename RangeT>
155 using ::mlir::OpAsmOpInterface::Trait<NonDetOp>::getAsmBlockArgumentNames;
156 using ::mlir::OpAsmOpInterface::Trait<NonDetOp>::getAsmBlockNames;
157 using ::mlir::OpAsmOpInterface::Trait<NonDetOp>::getDefaultDialect;
158 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
159 return {};
160 }
161
162 static constexpr ::llvm::StringLiteral getOperationName() {
163 return ::llvm::StringLiteral("llzk.nondet");
164 }
165
166 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
167 return {index, 1};
168 }
169
170 ::mlir::Operation::operand_range getODSOperands(unsigned index) {
171 auto valueRange = getODSOperandIndexAndLength(index);
172 return {std::next(getOperation()->operand_begin(), valueRange.first),
173 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
174 }
175
176 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) {
177 return {index, 1};
178 }
179
180 ::mlir::Operation::result_range getODSResults(unsigned index) {
181 auto valueRange = getODSResultIndexAndLength(index);
182 return {std::next(getOperation()->result_begin(), valueRange.first),
183 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
184 }
185
186 ::mlir::TypedValue<::mlir::Type> getRes() {
187 return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(*getODSResults(0).begin());
188 }
189
190 static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
191 static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
192 static llvm::hash_code computePropertiesHash(const Properties &prop);
193 static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
194 static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
195 static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
196 static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
197 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res);
198 static NonDetOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res);
199 static NonDetOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res);
200 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes);
201 static NonDetOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes);
202 static NonDetOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes);
203 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
204 static NonDetOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
205 static NonDetOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
206 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {});
207 static NonDetOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {});
208 static NonDetOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {});
209 ::llvm::LogicalResult verifyInvariantsImpl();
210 ::llvm::LogicalResult verifyInvariants();
211 static void getCanonicalizationPatterns(::mlir::RewritePatternSet &results, ::mlir::MLIRContext *context);
212 void getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn);
213 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
214 void print(::mlir::OpAsmPrinter &_odsPrinter);
215public:
216};
217
218} // namespace llzk
219MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::NonDetOp)
220
221
222#endif // GET_OP_CLASSES
223
NonDetOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:111
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:49
NonDetOpAdaptor(NonDetOp op)
Definition Ops.cpp.inc:47
NonDetOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:111
NonDetOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr)
Definition Ops.h.inc:115
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:122
NonDetOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:113
NonDetOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:120
RangeT getODSOperands(unsigned index)
Definition Ops.h.inc:126
NonDetOpGenericAdaptor(RangeT values, const NonDetOpGenericAdaptorBase &base)
Definition Ops.h.inc:117
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:53
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:170
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:180
::mlir::TypedValue<::mlir::Type > getRes()
Definition Ops.h.inc:186
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:86
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:164
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:71
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:166
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:62
static void getCanonicalizationPatterns(::mlir::RewritePatternSet &results, ::mlir::MLIRContext *context)
Definition Ops.cpp:48
static NonDetOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res)
Definition Ops.cpp.inc:94
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:206
NonDetOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:152
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.h.inc:176
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:83
FoldAdaptor::Properties Properties
Definition Ops.h.inc:154
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:76
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:162
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res)
Definition Ops.cpp.inc:90
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:177
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:80
NonDetOpAdaptor Adaptor
Definition Ops.h.inc:150
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:181
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:153
void getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn)
Definition Ops.cpp:44
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
Definition Ops.h.inc:158
::mlir::EmptyProperties Properties
Definition Ops.h.inc:78
::mlir::DictionaryAttr getAttributes()
Definition Ops.h.inc:99
::mlir::DictionaryAttr odsAttrs
Definition Ops.h.inc:80
NonDetOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:85
const Properties & getProperties()
Definition Ops.h.inc:95
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:81
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.h.inc:91
Provides the necessary information to the RemoveUnusedDiscardableAllocations pass about operations th...
Definition Ops.cpp.inc:41