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::include {
11
20class IncludeOp;
21
22} // namespace llzk::include
23#ifdef GET_OP_CLASSES
24#undef GET_OP_CLASSES
25
26namespace llzk::include {
27
28
29//===----------------------------------------------------------------------===//
30// ::llzk::include::IncludeOp declarations
31//===----------------------------------------------------------------------===//
32
33namespace detail {
34
36public:
37 struct Properties {
38 using pathTy = ::mlir::StringAttr;
40
41 auto getPath() const {
42 auto &propStorage = this->path;
43 return ::llvm::cast<::mlir::StringAttr>(propStorage);
44 }
45 void setPath(const ::mlir::StringAttr &propValue) {
46 this->path = propValue;
47 }
48 using sym_nameTy = ::mlir::StringAttr;
50
51 auto getSymName() const {
52 auto &propStorage = this->sym_name;
53 return ::llvm::cast<::mlir::StringAttr>(propStorage);
54 }
55 void setSymName(const ::mlir::StringAttr &propValue) {
56 this->sym_name = propValue;
57 }
58 bool operator==(const Properties &rhs) const {
59 return
60 rhs.path == this->path &&
61 rhs.sym_name == this->sym_name &&
62 true;
63 }
64 bool operator!=(const Properties &rhs) const {
65 return !(*this == rhs);
66 }
67 };
68protected:
69 ::mlir::DictionaryAttr odsAttrs;
70 ::std::optional<::mlir::OperationName> odsOpName;
72 ::mlir::RegionRange odsRegions;
73public:
74 IncludeOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
75 odsOpName.emplace("include.from", odsAttrs.getContext());
76 }
77
79
80 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
81 return {index, 1};
82 }
83
85 return properties;
86 }
87
88 ::mlir::DictionaryAttr getAttributes() {
89 return odsAttrs;
90 }
91
92 ::mlir::StringAttr getSymNameAttr() {
93 auto attr = ::llvm::cast<::mlir::StringAttr>(getProperties().sym_name);
94 return attr;
95 }
96
97 ::llvm::StringRef getSymName();
98 ::mlir::StringAttr getPathAttr() {
99 auto attr = ::llvm::cast<::mlir::StringAttr>(getProperties().path);
100 return attr;
101 }
102
103 ::llvm::StringRef getPath();
104};
105
106} // namespace detail
107template <typename RangeT>
109 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
111public:
112 IncludeOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
113
114 IncludeOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : IncludeOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
115
116 IncludeOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : IncludeOpGenericAdaptor(values, attrs, Properties{}, {}) {}
117
118 IncludeOpGenericAdaptor(RangeT values, const IncludeOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {}
119
120 template <typename LateInst = IncludeOp, typename = std::enable_if_t<std::is_same_v<LateInst, IncludeOp>>>
121 IncludeOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
122
123 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
124 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
125 }
126
127 RangeT getODSOperands(unsigned index) {
128 auto valueRange = getODSOperandIndexAndLength(index);
129 return {std::next(odsOperands.begin(), valueRange.first),
130 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
131 }
132
133 RangeT getOperands() {
134 return odsOperands;
135 }
136
137private:
138 RangeT odsOperands;
139};
140class IncludeOpAdaptor : public IncludeOpGenericAdaptor<::mlir::ValueRange> {
141public:
144
145 ::llvm::LogicalResult verify(::mlir::Location loc);
146};
147class IncludeOp : public ::mlir::Op<IncludeOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::ZeroResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::ZeroOperands, ::mlir::OpTrait::HasParent<::mlir::ModuleOp>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::SymbolOpInterface::Trait> {
148public:
149 using Op::Op;
150 using Op::print;
152 template <typename RangeT>
156 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
157 static ::llvm::StringRef attrNames[] = {::llvm::StringRef("path"), ::llvm::StringRef("sym_name")};
158 return ::llvm::ArrayRef(attrNames);
159 }
160
161 ::mlir::StringAttr getPathAttrName() {
162 return getAttributeNameForIndex(0);
163 }
164
165 static ::mlir::StringAttr getPathAttrName(::mlir::OperationName name) {
166 return getAttributeNameForIndex(name, 0);
167 }
168
169 ::mlir::StringAttr getSymNameAttrName() {
170 return getAttributeNameForIndex(1);
171 }
172
173 static ::mlir::StringAttr getSymNameAttrName(::mlir::OperationName name) {
174 return getAttributeNameForIndex(name, 1);
175 }
176
177 static constexpr ::llvm::StringLiteral getOperationName() {
178 return ::llvm::StringLiteral("include.from");
179 }
180
181 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
182 return {index, 1};
183 }
184
185 ::mlir::Operation::operand_range getODSOperands(unsigned index) {
186 auto valueRange = getODSOperandIndexAndLength(index);
187 return {std::next(getOperation()->operand_begin(), valueRange.first),
188 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
189 }
190
191 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) {
192 return {index, 1};
193 }
194
195 ::mlir::Operation::result_range getODSResults(unsigned index) {
196 auto valueRange = getODSResultIndexAndLength(index);
197 return {std::next(getOperation()->result_begin(), valueRange.first),
198 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
199 }
200
201 static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
202 static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
203 static llvm::hash_code computePropertiesHash(const Properties &prop);
204 static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
205 static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
206 static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
207 static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
208 static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
209 void writeProperties(::mlir::DialectBytecodeWriter &writer);
210 ::mlir::StringAttr getSymNameAttr() {
211 return ::llvm::cast<::mlir::StringAttr>(getProperties().sym_name);
212 }
213
214 ::llvm::StringRef getSymName();
215 ::mlir::StringAttr getPathAttr() {
216 return ::llvm::cast<::mlir::StringAttr>(getProperties().path);
217 }
218
219 ::llvm::StringRef getPath();
220 void setSymNameAttr(::mlir::StringAttr attr) {
221 getProperties().sym_name = attr;
222 }
223
224 void setSymName(::llvm::StringRef attrValue);
225 void setPathAttr(::mlir::StringAttr attr) {
226 getProperties().path = attr;
227 }
228
229 void setPath(::llvm::StringRef attrValue);
230 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name, ::mlir::StringAttr path);
231 static IncludeOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::StringAttr sym_name, ::mlir::StringAttr path);
232 static IncludeOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::StringAttr sym_name, ::mlir::StringAttr path);
233 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::StringAttr sym_name, ::mlir::StringAttr path);
234 static IncludeOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::StringAttr sym_name, ::mlir::StringAttr path);
235 static IncludeOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::StringAttr sym_name, ::mlir::StringAttr path);
236 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llvm::StringRef sym_name, ::llvm::StringRef path);
237 static IncludeOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::llvm::StringRef sym_name, ::llvm::StringRef path);
238 static IncludeOp create(::mlir::ImplicitLocOpBuilder &builder, ::llvm::StringRef sym_name, ::llvm::StringRef path);
239 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef sym_name, ::llvm::StringRef path);
240 static IncludeOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::llvm::StringRef sym_name, ::llvm::StringRef path);
241 static IncludeOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::llvm::StringRef sym_name, ::llvm::StringRef path);
242 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
243 static IncludeOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
244 static IncludeOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
245 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {});
246 static IncludeOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {});
247 static IncludeOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {});
248 ::llvm::LogicalResult verifyInvariantsImpl();
249 ::llvm::LogicalResult verifyInvariants();
250 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
251 void print(::mlir::OpAsmPrinter &_odsPrinter);
252private:
253 ::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
254 return getAttributeNameForIndex((*this)->getName(), index);
255 }
256
257 static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
258 assert(index < 2 && "invalid attribute index");
259 assert(name.getStringRef() == getOperationName() && "invalid operation name");
260 assert(name.isRegistered() && "Operation isn't registered, missing a "
261 "dependent dialect loading?");
262 return name.getAttributeNames()[index];
263 }
264
265public:
266 static IncludeOp create(::mlir::Location, ::llvm::StringRef name, ::llvm::StringRef path);
267 static IncludeOp create(::mlir::Location, ::mlir::StringAttr name, ::mlir::StringAttr path);
268
270 ::mlir::FailureOr<mlir::OwningOpRef<mlir::ModuleOp>> openModule();
271
273 ::mlir::FailureOr<mlir::ModuleOp> inlineAndErase();
274};
275
276} // namespace llzk::include
277MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::include::IncludeOp)
279
280
281#endif // GET_OP_CLASSES
282
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:63
IncludeOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:112
IncludeOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr)
Definition Ops.h.inc:116
IncludeOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:114
IncludeOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:112
IncludeOpGenericAdaptor(RangeT values, const IncludeOpGenericAdaptorBase &base)
Definition Ops.h.inc:118
RangeT getODSOperands(unsigned index)
Definition Ops.h.inc:127
IncludeOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:121
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:123
static IncludeOp create(::mlir::Location, ::llvm::StringRef name, ::llvm::StringRef path)
::mlir::StringAttr getPathAttrName()
Definition Ops.h.inc:161
void setPathAttr(::mlir::StringAttr attr)
Definition Ops.h.inc:225
::llvm::StringRef getSymName()
Definition Ops.cpp.inc:202
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:154
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:177
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:343
IncludeOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:153
IncludeOpAdaptor Adaptor
Definition Ops.h.inc:151
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:185
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:181
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:137
FoldAdaptor::Properties Properties
Definition Ops.h.inc:155
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:186
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:144
::mlir::StringAttr getSymNameAttrName(::mlir::OperationName name)
Definition Ops.h.inc:173
void setSymName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:212
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:196
::llvm::StringRef getPath()
Definition Ops.cpp.inc:207
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:361
::mlir::StringAttr getPathAttr()
Definition Ops.h.inc:215
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:387
::mlir::StringAttr getSymNameAttrName()
Definition Ops.h.inc:169
static IncludeOp create(::mlir::Location, ::mlir::StringAttr name, ::mlir::StringAttr path)
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name, ::mlir::StringAttr path)
Definition Ops.cpp.inc:220
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:357
::mlir::FailureOr< mlir::OwningOpRef< mlir::ModuleOp > > openModule()
Opens the module this include references but doesn't insert it into the parent module.
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:114
void setSymNameAttr(::mlir::StringAttr attr)
Definition Ops.h.inc:220
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:195
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.h.inc:191
::mlir::FailureOr< mlir::ModuleOp > inlineAndErase()
Opens the module this include references and replace this include with that module.
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
Definition Ops.h.inc:156
::mlir::StringAttr getSymNameAttr()
Definition Ops.h.inc:210
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:171
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:77
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:153
void setPath(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:216
::mlir::StringAttr getPathAttrName(::mlir::OperationName name)
Definition Ops.h.inc:165
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:165
static IncludeOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::StringAttr sym_name, ::mlir::StringAttr path)
Definition Ops.cpp.inc:225
IncludeOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:74
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.h.inc:80
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:70
void setPath(const ::mlir::StringAttr &propValue)
Definition Ops.h.inc:45
void setSymName(const ::mlir::StringAttr &propValue)
Definition Ops.h.inc:55