LLZK 3.0.0
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
SMTInfoOps.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: SMTInfoOps.td *|
7|* *|
8\*===----------------------------------------------------------------------===*/
9
10namespace llzk::smt_info {
11
13class SMTInfoSetOp;
14
15} // namespace llzk::smt_info
16#ifdef GET_OP_CLASSES
17#undef GET_OP_CLASSES
18
19namespace llzk::smt_info {
20
21
22//===----------------------------------------------------------------------===//
23// ::llzk::smt_info::SMTInfoSetOp declarations
24//===----------------------------------------------------------------------===//
25
26namespace detail {
27
29public:
30 struct Properties {
31 using keyTy = ::llzk::smt_info::KeywordAttr;
33
34 auto getKey() const {
35 auto &propStorage = this->key;
36 return ::llvm::cast<::llzk::smt_info::KeywordAttr>(propStorage);
37 }
38 void setKey(const ::llzk::smt_info::KeywordAttr &propValue) {
39 this->key = propValue;
40 }
41 using valueTy = ::mlir::Attribute;
43
44 auto getValue() const {
45 auto &propStorage = this->value;
46 return ::llvm::cast<::mlir::Attribute>(propStorage);
47 }
48 void setValue(const ::mlir::Attribute &propValue) {
49 this->value = propValue;
50 }
51 bool operator==(const Properties &rhs) const {
52 return
53 rhs.key == this->key &&
54 rhs.value == this->value &&
55 true;
56 }
57 bool operator!=(const Properties &rhs) const {
58 return !(*this == rhs);
59 }
60 };
61protected:
62 ::mlir::DictionaryAttr odsAttrs;
63 ::std::optional<::mlir::OperationName> odsOpName;
65 ::mlir::RegionRange odsRegions;
66public:
67 SMTInfoSetOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
68 odsOpName.emplace("smt_info.set", odsAttrs.getContext());
69 }
70
72
73 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
74 return {index, 1};
75 }
76
78 return properties;
79 }
80
81 ::mlir::DictionaryAttr getAttributes() {
82 return odsAttrs;
83 }
84
85 ::llzk::smt_info::KeywordAttr getKeyAttr() {
86 auto attr = ::llvm::cast<::llzk::smt_info::KeywordAttr>(getProperties().key);
87 return attr;
88 }
89
90 ::llzk::smt_info::KeywordAttr getKey();
91 ::mlir::Attribute getValueAttr() {
92 auto attr = ::llvm::cast<::mlir::Attribute>(getProperties().value);
93 return attr;
94 }
95
96 ::mlir::Attribute getValue();
97};
98
99} // namespace detail
100template <typename RangeT>
102 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
104public:
105 SMTInfoSetOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
106
107 SMTInfoSetOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : SMTInfoSetOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
108
109 SMTInfoSetOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : SMTInfoSetOpGenericAdaptor(values, attrs, Properties{}, {}) {}
110
111 SMTInfoSetOpGenericAdaptor(RangeT values, const SMTInfoSetOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {}
112
113 template <typename LateInst = SMTInfoSetOp, typename = std::enable_if_t<std::is_same_v<LateInst, SMTInfoSetOp>>>
114 SMTInfoSetOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
115
116 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
117 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
118 }
119
120 RangeT getODSOperands(unsigned index) {
121 auto valueRange = getODSOperandIndexAndLength(index);
122 return {std::next(odsOperands.begin(), valueRange.first),
123 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
124 }
125
126 RangeT getOperands() {
127 return odsOperands;
128 }
129
130private:
131 RangeT odsOperands;
132};
133class SMTInfoSetOpAdaptor : public SMTInfoSetOpGenericAdaptor<::mlir::ValueRange> {
134public:
137
138 ::llvm::LogicalResult verify(::mlir::Location loc);
139};
140class SMTInfoSetOp : public ::mlir::Op<SMTInfoSetOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::ZeroResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::ZeroOperands, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait> {
141public:
142 using Op::Op;
143 using Op::print;
145 template <typename RangeT>
149 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
150 static ::llvm::StringRef attrNames[] = {::llvm::StringRef("key"), ::llvm::StringRef("value")};
151 return ::llvm::ArrayRef(attrNames);
152 }
153
154 ::mlir::StringAttr getKeyAttrName() {
155 return getAttributeNameForIndex(0);
156 }
157
158 static ::mlir::StringAttr getKeyAttrName(::mlir::OperationName name) {
159 return getAttributeNameForIndex(name, 0);
160 }
161
162 ::mlir::StringAttr getValueAttrName() {
163 return getAttributeNameForIndex(1);
164 }
165
166 static ::mlir::StringAttr getValueAttrName(::mlir::OperationName name) {
167 return getAttributeNameForIndex(name, 1);
168 }
169
170 static constexpr ::llvm::StringLiteral getOperationName() {
171 return ::llvm::StringLiteral("smt_info.set");
172 }
173
174 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
175 return {index, 1};
176 }
177
178 ::mlir::Operation::operand_range getODSOperands(unsigned index) {
179 auto valueRange = getODSOperandIndexAndLength(index);
180 return {std::next(getOperation()->operand_begin(), valueRange.first),
181 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
182 }
183
184 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) {
185 return {index, 1};
186 }
187
188 ::mlir::Operation::result_range getODSResults(unsigned index) {
189 auto valueRange = getODSResultIndexAndLength(index);
190 return {std::next(getOperation()->result_begin(), valueRange.first),
191 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
192 }
193
194 static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
195 static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
196 static llvm::hash_code computePropertiesHash(const Properties &prop);
197 static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
198 static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
199 static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
200 static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
201 static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
202 void writeProperties(::mlir::DialectBytecodeWriter &writer);
203 ::llzk::smt_info::KeywordAttr getKeyAttr() {
204 return ::llvm::cast<::llzk::smt_info::KeywordAttr>(getProperties().key);
205 }
206
207 ::llzk::smt_info::KeywordAttr getKey();
208 ::mlir::Attribute getValueAttr() {
209 return ::llvm::cast<::mlir::Attribute>(getProperties().value);
210 }
211
212 ::mlir::Attribute getValue();
213 void setKeyAttr(::llzk::smt_info::KeywordAttr attr) {
214 getProperties().key = attr;
215 }
216
217 void setValueAttr(::mlir::Attribute attr) {
218 getProperties().value = attr;
219 }
220
221 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llzk::smt_info::KeywordAttr key, ::mlir::Attribute value);
222 static SMTInfoSetOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::llzk::smt_info::KeywordAttr key, ::mlir::Attribute value);
223 static SMTInfoSetOp create(::mlir::ImplicitLocOpBuilder &builder, ::llzk::smt_info::KeywordAttr key, ::mlir::Attribute value);
224 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llzk::smt_info::KeywordAttr key, ::mlir::Attribute value);
225 static SMTInfoSetOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::llzk::smt_info::KeywordAttr key, ::mlir::Attribute value);
226 static SMTInfoSetOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::llzk::smt_info::KeywordAttr key, ::mlir::Attribute value);
227 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
228 static SMTInfoSetOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
229 static SMTInfoSetOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
230 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {});
231 static SMTInfoSetOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {});
232 static SMTInfoSetOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {});
233 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
234 void print(::mlir::OpAsmPrinter &p);
235 ::llvm::LogicalResult verifyInvariantsImpl();
236 ::llvm::LogicalResult verifyInvariants();
237 ::llvm::LogicalResult verify();
238 static ::llvm::LogicalResult setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
239private:
240 ::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
241 return getAttributeNameForIndex((*this)->getName(), index);
242 }
243
244 static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
245 assert(index < 2 && "invalid attribute index");
246 assert(name.getStringRef() == getOperationName() && "invalid operation name");
247 assert(name.isRegistered() && "Operation isn't registered, missing a "
248 "dependent dialect loading?");
249 return name.getAttributeNames()[index];
250 }
251
252public:
253};
254
255} // namespace llzk::smt_info
256MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::smt_info::SMTInfoSetOp)
258
259
260#endif // GET_OP_CLASSES
261
::llvm::LogicalResult verify(::mlir::Location loc)
SMTInfoSetOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
SMTInfoSetOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr)
SMTInfoSetOpGenericAdaptor(RangeT values, const SMTInfoSetOpGenericAdaptorBase &base)
SMTInfoSetOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
SMTInfoSetOpGenericAdaptor(RangeT values, LateInst op)
SMTInfoSetOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions={})
void writeProperties(::mlir::DialectBytecodeWriter &writer)
void setKeyAttr(::llzk::smt_info::KeywordAttr attr)
static SMTInfoSetOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::llzk::smt_info::KeywordAttr key, ::mlir::Attribute value)
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
FoldAdaptor::Properties Properties
void setValueAttr(::mlir::Attribute attr)
::mlir::StringAttr getValueAttrName()
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
::mlir::StringAttr getKeyAttrName(::mlir::OperationName name)
::llvm::LogicalResult setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
::mlir::Attribute getValueAttr()
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
::mlir::Operation::result_range getODSResults(unsigned index)
::llvm::LogicalResult verifyInvariants()
void print(::mlir::OpAsmPrinter &p)
::llvm::LogicalResult verify()
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
::llvm::LogicalResult verifyInvariantsImpl()
static llvm::hash_code computePropertiesHash(const Properties &prop)
static constexpr ::llvm::StringLiteral getOperationName()
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llzk::smt_info::KeywordAttr key, ::mlir::Attribute value)
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
::llzk::smt_info::KeywordAttr getKeyAttr()
SMTInfoSetOpGenericAdaptor< RangeT > GenericAdaptor
::mlir::Operation::operand_range getODSOperands(unsigned index)
SMTInfoSetOpAdaptor Adaptor
::llzk::smt_info::KeywordAttr getKey()
::mlir::StringAttr getValueAttrName(::mlir::OperationName name)
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
::mlir::StringAttr getKeyAttrName()
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
::std::optional<::mlir::OperationName > odsOpName
SMTInfoSetOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
void setKey(const ::llzk::smt_info::KeywordAttr &propValue)