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 polymorphic {
12class ApplyMapOp;
13} // namespace polymorphic
14} // namespace llzk
15namespace llzk {
16namespace polymorphic {
17class ConstReadOp;
18} // namespace polymorphic
19} // namespace llzk
20namespace llzk {
21namespace polymorphic {
22class UnifiableCastOp;
23} // namespace polymorphic
24} // namespace llzk
25#ifdef GET_OP_CLASSES
26#undef GET_OP_CLASSES
27
28namespace llzk {
29namespace polymorphic {
30
31//===----------------------------------------------------------------------===//
32// ::llzk::polymorphic::ApplyMapOp declarations
33//===----------------------------------------------------------------------===//
34
35namespace detail {
37public:
38 struct Properties {
39 using mapTy = ::mlir::AffineMapAttr;
41
42 auto getMap() {
43 auto &propStorage = this->map;
44 return ::llvm::cast<::mlir::AffineMapAttr>(propStorage);
45 }
46 void setMap(const ::mlir::AffineMapAttr &propValue) {
47 this->map = propValue;
48 }
49 using numDimsTy = ::mlir::IntegerAttr;
51
52 auto getNumDims() {
53 auto &propStorage = this->numDims;
54 return ::llvm::cast<::mlir::IntegerAttr>(propStorage);
55 }
56 void setNumDims(const ::mlir::IntegerAttr &propValue) {
57 this->numDims = propValue;
58 }
59 bool operator==(const Properties &rhs) const {
60 return
61 rhs.map == this->map &&
62 rhs.numDims == this->numDims &&
63 true;
64 }
65 bool operator!=(const Properties &rhs) const {
66 return !(*this == rhs);
67 }
68 };
69protected:
70 ::mlir::DictionaryAttr odsAttrs;
71 ::std::optional<::mlir::OperationName> odsOpName;
73 ::mlir::RegionRange odsRegions;
74public:
75 ApplyMapOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
76 odsOpName.emplace("poly.applymap", odsAttrs.getContext());
77 }
78
80
81 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
83 return properties;
84 }
85
86 ::mlir::DictionaryAttr getAttributes() {
87 return odsAttrs;
88 }
89
90 ::mlir::AffineMapAttr getMapAttr() {
91 auto attr = ::llvm::cast<::mlir::AffineMapAttr>(getProperties().map);
92 return attr;
93 }
94
95 ::mlir::AffineMap getMap();
96 ::mlir::IntegerAttr getNumDimsAttr() {
97 auto attr = ::llvm::cast<::mlir::IntegerAttr>(getProperties().numDims);
98 return attr;
99 }
100
101 ::llvm::APInt getNumDims();
102};
103} // namespace detail
104template <typename RangeT>
106 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
108public:
109 ApplyMapOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
110
111 ApplyMapOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : ApplyMapOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
112
113 ApplyMapOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : ApplyMapOpGenericAdaptor(values, attrs, Properties{}, {}) {}
114
115 ApplyMapOpGenericAdaptor(RangeT values, const ApplyMapOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {}
116
117 template <typename LateInst = ApplyMapOp, typename = std::enable_if_t<std::is_same_v<LateInst, ApplyMapOp>>>
118 ApplyMapOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
119
120 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
121 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
122 }
123
124 RangeT getODSOperands(unsigned index) {
125 auto valueRange = getODSOperandIndexAndLength(index);
126 return {std::next(odsOperands.begin(), valueRange.first),
127 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
128 }
129
130 RangeT getMapOperands() {
131 return getODSOperands(0);
132 }
133
134 RangeT getOperands() {
135 return odsOperands;
136 }
137
138private:
139 RangeT odsOperands;
140};
141class ApplyMapOpAdaptor : public ApplyMapOpGenericAdaptor<::mlir::ValueRange> {
142public:
145
146 ::llvm::LogicalResult verify(::mlir::Location loc);
147};
148class ApplyMapOp : public ::mlir::Op<ApplyMapOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::IndexType>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait> {
149public:
150 using Op::Op;
151 using Op::print;
153 template <typename RangeT>
157 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
158 static ::llvm::StringRef attrNames[] = {::llvm::StringRef("map"), ::llvm::StringRef("numDims")};
159 return ::llvm::ArrayRef(attrNames);
160 }
161
162 ::mlir::StringAttr getMapAttrName() {
163 return getAttributeNameForIndex(0);
164 }
165
166 static ::mlir::StringAttr getMapAttrName(::mlir::OperationName name) {
167 return getAttributeNameForIndex(name, 0);
168 }
169
170 ::mlir::StringAttr getNumDimsAttrName() {
171 return getAttributeNameForIndex(1);
172 }
173
174 static ::mlir::StringAttr getNumDimsAttrName(::mlir::OperationName name) {
175 return getAttributeNameForIndex(name, 1);
176 }
177
178 static constexpr ::llvm::StringLiteral getOperationName() {
179 return ::llvm::StringLiteral("poly.applymap");
180 }
181
182 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
183 ::mlir::Operation::operand_range getODSOperands(unsigned index) {
184 auto valueRange = getODSOperandIndexAndLength(index);
185 return {std::next(getOperation()->operand_begin(), valueRange.first),
186 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
187 }
188
189 ::mlir::Operation::operand_range getMapOperands() {
190 return getODSOperands(0);
191 }
192
193 ::mlir::MutableOperandRange getMapOperandsMutable();
194 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) {
195 return {index, 1};
196 }
197
198 ::mlir::Operation::result_range getODSResults(unsigned index) {
199 auto valueRange = getODSResultIndexAndLength(index);
200 return {std::next(getOperation()->result_begin(), valueRange.first),
201 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
202 }
203
204 static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
205 static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
206 static llvm::hash_code computePropertiesHash(const Properties &prop);
207 static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
208 static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
209 static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
210 static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
211 static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
212 void writeProperties(::mlir::DialectBytecodeWriter &writer);
213 ::mlir::AffineMapAttr getMapAttr() {
214 return ::llvm::cast<::mlir::AffineMapAttr>(getProperties().map);
215 }
216
217 ::mlir::AffineMap getMap();
218 ::mlir::IntegerAttr getNumDimsAttr() {
219 return ::llvm::cast<::mlir::IntegerAttr>(getProperties().numDims);
220 }
221
222 ::llvm::APInt getNumDims();
223 void setMapAttr(::mlir::AffineMapAttr attr) {
224 getProperties().map = attr;
225 }
226
227 void setMap(::mlir::AffineMap attrValue);
228 void setNumDimsAttr(::mlir::IntegerAttr attr) {
229 getProperties().numDims = attr;
230 }
231
232 void setNumDims(::llvm::APInt attrValue);
233 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::AffineMapAttr map, ::mlir::ValueRange mapOperands = {});
234 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::AffineMap map, ::mlir::ValueRange mapOperands = {});
235 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::AffineExpr expr, ::mlir::ValueRange mapOperands = {});
236 ::llvm::LogicalResult verifyInvariantsImpl();
237 ::llvm::LogicalResult verifyInvariants();
238 ::llvm::LogicalResult verify();
239 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
240 void print(::mlir::OpAsmPrinter &_odsPrinter);
241 void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
242private:
243 ::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
244 return getAttributeNameForIndex((*this)->getName(), index);
245 }
246
247 static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
248 assert(index < 2 && "invalid attribute index");
249 assert(name.getStringRef() == getOperationName() && "invalid operation name");
250 assert(name.isRegistered() && "Operation isn't registered, missing a "
251 "dependent dialect loading?");
252 return name.getAttributeNames()[index];
253 }
254
255public:
257 ::mlir::AffineMap inline getAffineMap() { return getMap(); }
258
260 ::mlir::affine::AffineValueMap getAffineValueMap() {
261 return ::mlir::affine::AffineValueMap(getAffineMap(), getOperands(), getResult());
262 }
263
265 ::mlir::ValueRange getDimOperands() {
266 return ::mlir::OperandRange{
267 getOperands().begin(),
268 getOperands().begin() + getMap().getNumDims()};
269 }
270
272 ::mlir::ValueRange getSymbolOperands() {
273 return ::mlir::OperandRange{
274 getOperands().begin() + getMap().getNumDims(),
275 getOperands().end()};
276 }
277};
278} // namespace polymorphic
279} // namespace llzk
280MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::polymorphic::ApplyMapOp)
281
282namespace llzk {
283namespace polymorphic {
284
285//===----------------------------------------------------------------------===//
286// ::llzk::polymorphic::ConstReadOp declarations
287//===----------------------------------------------------------------------===//
288
289namespace detail {
291public:
292 struct Properties {
293 using const_nameTy = ::mlir::FlatSymbolRefAttr;
295
297 auto &propStorage = this->const_name;
298 return ::llvm::cast<::mlir::FlatSymbolRefAttr>(propStorage);
299 }
300 void setConstName(const ::mlir::FlatSymbolRefAttr &propValue) {
301 this->const_name = propValue;
302 }
303 bool operator==(const Properties &rhs) const {
304 return
305 rhs.const_name == this->const_name &&
306 true;
307 }
308 bool operator!=(const Properties &rhs) const {
309 return !(*this == rhs);
310 }
311 };
312protected:
313 ::mlir::DictionaryAttr odsAttrs;
314 ::std::optional<::mlir::OperationName> odsOpName;
316 ::mlir::RegionRange odsRegions;
317public:
318 ConstReadOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
319 odsOpName.emplace("poly.read_const", odsAttrs.getContext());
320 }
321
323
324 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
325 return {index, 1};
326 }
327
329 return properties;
330 }
331
332 ::mlir::DictionaryAttr getAttributes() {
333 return odsAttrs;
334 }
335
336 ::mlir::FlatSymbolRefAttr getConstNameAttr() {
337 auto attr = ::llvm::cast<::mlir::FlatSymbolRefAttr>(getProperties().const_name);
338 return attr;
339 }
340
341 ::llvm::StringRef getConstName();
342};
343} // namespace detail
344template <typename RangeT>
346 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
348public:
349 ConstReadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
350
351 ConstReadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : ConstReadOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
352
353 ConstReadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : ConstReadOpGenericAdaptor(values, attrs, Properties{}, {}) {}
354
355 ConstReadOpGenericAdaptor(RangeT values, const ConstReadOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {}
356
357 template <typename LateInst = ConstReadOp, typename = std::enable_if_t<std::is_same_v<LateInst, ConstReadOp>>>
358 ConstReadOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
359
360 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
361 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
362 }
363
364 RangeT getODSOperands(unsigned index) {
365 auto valueRange = getODSOperandIndexAndLength(index);
366 return {std::next(odsOperands.begin(), valueRange.first),
367 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
368 }
369
370 RangeT getOperands() {
371 return odsOperands;
372 }
373
374private:
375 RangeT odsOperands;
376};
377class ConstReadOpAdaptor : public ConstReadOpGenericAdaptor<::mlir::ValueRange> {
378public:
381
382 ::llvm::LogicalResult verify(::mlir::Location loc);
383};
384class ConstReadOp : public ::mlir::Op<ConstReadOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::ZeroOperands, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::SymbolUserOpInterface::Trait> {
385public:
386 using Op::Op;
387 using Op::print;
389 template <typename RangeT>
393 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
394 static ::llvm::StringRef attrNames[] = {::llvm::StringRef("const_name")};
395 return ::llvm::ArrayRef(attrNames);
396 }
397
398 ::mlir::StringAttr getConstNameAttrName() {
399 return getAttributeNameForIndex(0);
400 }
401
402 static ::mlir::StringAttr getConstNameAttrName(::mlir::OperationName name) {
403 return getAttributeNameForIndex(name, 0);
404 }
405
406 static constexpr ::llvm::StringLiteral getOperationName() {
407 return ::llvm::StringLiteral("poly.read_const");
408 }
409
410 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
411 return {index, 1};
412 }
413
414 ::mlir::Operation::operand_range getODSOperands(unsigned index) {
415 auto valueRange = getODSOperandIndexAndLength(index);
416 return {std::next(getOperation()->operand_begin(), valueRange.first),
417 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
418 }
419
420 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) {
421 return {index, 1};
422 }
423
424 ::mlir::Operation::result_range getODSResults(unsigned index) {
425 auto valueRange = getODSResultIndexAndLength(index);
426 return {std::next(getOperation()->result_begin(), valueRange.first),
427 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
428 }
429
430 ::mlir::TypedValue<::mlir::Type> getVal() {
431 return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(*getODSResults(0).begin());
432 }
433
434 static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
435 static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
436 static llvm::hash_code computePropertiesHash(const Properties &prop);
437 static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
438 static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
439 static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
440 static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
441 static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
442 void writeProperties(::mlir::DialectBytecodeWriter &writer);
443 ::mlir::FlatSymbolRefAttr getConstNameAttr() {
444 return ::llvm::cast<::mlir::FlatSymbolRefAttr>(getProperties().const_name);
445 }
446
447 ::llvm::StringRef getConstName();
448 void setConstNameAttr(::mlir::FlatSymbolRefAttr attr) {
449 getProperties().const_name = attr;
450 }
451
452 void setConstName(::llvm::StringRef attrValue);
453 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type val, ::mlir::FlatSymbolRefAttr const_name);
454 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::FlatSymbolRefAttr const_name);
455 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type val, ::llvm::StringRef const_name);
456 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef const_name);
457 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
458 ::llvm::LogicalResult verifyInvariantsImpl();
459 ::llvm::LogicalResult verifyInvariants();
460 ::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable);
461 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
462 void print(::mlir::OpAsmPrinter &_odsPrinter);
463private:
464 ::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
465 return getAttributeNameForIndex((*this)->getName(), index);
466 }
467
468 static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
469 assert(index < 1 && "invalid attribute index");
470 assert(name.getStringRef() == getOperationName() && "invalid operation name");
471 assert(name.isRegistered() && "Operation isn't registered, missing a "
472 "dependent dialect loading?");
473 return name.getAttributeNames()[index];
474 }
475
476public:
477};
478} // namespace polymorphic
479} // namespace llzk
480MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::polymorphic::ConstReadOp)
481
482namespace llzk {
483namespace polymorphic {
484
485//===----------------------------------------------------------------------===//
486// ::llzk::polymorphic::UnifiableCastOp declarations
487//===----------------------------------------------------------------------===//
488
489namespace detail {
491public:
492protected:
493 ::mlir::DictionaryAttr odsAttrs;
494 ::std::optional<::mlir::OperationName> odsOpName;
495 ::mlir::RegionRange odsRegions;
496public:
497 UnifiableCastOpGenericAdaptorBase(::mlir::DictionaryAttr attrs = {}, const ::mlir::EmptyProperties &properties = {}, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), odsRegions(regions) { if (odsAttrs)
498 odsOpName.emplace("poly.unifiable_cast", odsAttrs.getContext());
499 }
500
501 UnifiableCastOpGenericAdaptorBase(::mlir::Operation *op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), odsRegions(op->getRegions()) {}
502
503 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
504 return {index, 1};
505 }
506
507 ::mlir::DictionaryAttr getAttributes() {
508 return odsAttrs;
509 }
510
511};
512} // namespace detail
513template <typename RangeT>
515 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
517public:
518 UnifiableCastOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = {}, const ::mlir::EmptyProperties &properties = {}, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
519
520 UnifiableCastOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : UnifiableCastOpGenericAdaptor(values, attrs, (properties ? *properties.as<::mlir::EmptyProperties *>() : ::mlir::EmptyProperties{}), regions) {}
521
522 UnifiableCastOpGenericAdaptor(RangeT values, const UnifiableCastOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {}
523
524 template <typename LateInst = UnifiableCastOp, typename = std::enable_if_t<std::is_same_v<LateInst, UnifiableCastOp>>>
525 UnifiableCastOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
526
527 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
528 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
529 }
530
531 RangeT getODSOperands(unsigned index) {
532 auto valueRange = getODSOperandIndexAndLength(index);
533 return {std::next(odsOperands.begin(), valueRange.first),
534 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
535 }
536
537 ValueT getInput() {
538 return (*getODSOperands(0).begin());
539 }
540
541 RangeT getOperands() {
542 return odsOperands;
543 }
544
545private:
546 RangeT odsOperands;
547};
548class UnifiableCastOpAdaptor : public UnifiableCastOpGenericAdaptor<::mlir::ValueRange> {
549public:
552
553 ::llvm::LogicalResult verify(::mlir::Location loc);
554};
555class UnifiableCastOp : public ::mlir::Op<UnifiableCastOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait> {
556public:
557 using Op::Op;
558 using Op::print;
560 template <typename RangeT>
563 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
564 return {};
565 }
566
567 static constexpr ::llvm::StringLiteral getOperationName() {
568 return ::llvm::StringLiteral("poly.unifiable_cast");
569 }
570
571 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
572 return {index, 1};
573 }
574
575 ::mlir::Operation::operand_range getODSOperands(unsigned index) {
576 auto valueRange = getODSOperandIndexAndLength(index);
577 return {std::next(getOperation()->operand_begin(), valueRange.first),
578 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
579 }
580
581 ::mlir::TypedValue<::mlir::Type> getInput() {
582 return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(*getODSOperands(0).begin());
583 }
584
585 ::mlir::OpOperand &getInputMutable() {
586 auto range = getODSOperandIndexAndLength(0);
587 return getOperation()->getOpOperand(range.first);
588 }
589
590 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) {
591 return {index, 1};
592 }
593
594 ::mlir::Operation::result_range getODSResults(unsigned index) {
595 auto valueRange = getODSResultIndexAndLength(index);
596 return {std::next(getOperation()->result_begin(), valueRange.first),
597 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
598 }
599
600 ::mlir::TypedValue<::mlir::Type> getResult() {
601 return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(*getODSResults(0).begin());
602 }
603
604 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value input);
605 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value input);
606 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
607 ::llvm::LogicalResult verifyInvariantsImpl();
608 ::llvm::LogicalResult verifyInvariants();
609 ::llvm::LogicalResult verify();
610 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
611 void print(::mlir::OpAsmPrinter &_odsPrinter);
612 void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
613public:
614};
615} // namespace polymorphic
616} // namespace llzk
617MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::polymorphic::UnifiableCastOp)
618
619
620#endif // GET_OP_CLASSES
621
MlirStringRef name
Definition Poly.cpp:48
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:153
ApplyMapOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:109
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:120
ApplyMapOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr)
Definition Ops.h.inc:113
ApplyMapOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:111
RangeT getODSOperands(unsigned index)
Definition Ops.h.inc:124
ApplyMapOpGenericAdaptor(RangeT values, const ApplyMapOpGenericAdaptorBase &base)
Definition Ops.h.inc:115
ApplyMapOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:118
ApplyMapOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:109
::mlir::ValueRange getSymbolOperands()
Returns all symbol operands.
Definition Ops.h.inc:272
::mlir::AffineMapAttr getMapAttr()
Definition Ops.h.inc:213
::mlir::IntegerAttr getNumDimsAttr()
Definition Ops.h.inc:218
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.cpp.inc:167
::mlir::ValueRange getDimOperands()
Returns all dimension operands.
Definition Ops.h.inc:265
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:198
::mlir::affine::AffineValueMap getAffineValueMap()
Returns the affine value map computed from this operation.
Definition Ops.h.inc:260
::mlir::Operation::operand_range getMapOperands()
Definition Ops.h.inc:189
::mlir::StringAttr getNumDimsAttrName(::mlir::OperationName name)
Definition Ops.h.inc:174
::llvm::LogicalResult verify()
Definition Ops.cpp:48
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:425
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:155
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:178
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:392
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:386
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:251
FoldAdaptor::Properties Properties
Definition Ops.h.inc:156
::mlir::StringAttr getMapAttrName(::mlir::OperationName name)
Definition Ops.h.inc:166
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:183
ApplyMapOpAdaptor Adaptor
Definition Ops.h.inc:152
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::AffineMapAttr map, ::mlir::ValueRange mapOperands={})
Definition Ops.cpp.inc:333
::mlir::StringAttr getMapAttrName()
Definition Ops.h.inc:162
::mlir::AffineMap getMap()
Definition Ops.cpp.inc:315
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
Definition Ops.h.inc:157
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:278
ApplyMapOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:154
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:309
void setMap(::mlir::AffineMap attrValue)
Definition Ops.cpp.inc:325
void setNumDimsAttr(::mlir::IntegerAttr attr)
Definition Ops.h.inc:228
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:228
::mlir::StringAttr getNumDimsAttrName()
Definition Ops.h.inc:170
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:284
::mlir::MutableOperandRange getMapOperandsMutable()
Definition Ops.cpp.inc:185
::mlir::AffineMap getAffineMap()
Returns the affine map to be applied by this operation.
Definition Ops.h.inc:257
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:354
void setMapAttr(::mlir::AffineMapAttr attr)
Definition Ops.h.inc:223
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:266
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:299
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:191
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:436
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:257
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.h.inc:194
void setNumDims(::llvm::APInt attrValue)
Definition Ops.cpp.inc:329
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:461
ConstReadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:349
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:360
ConstReadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:351
ConstReadOpGenericAdaptor(RangeT values, const ConstReadOpGenericAdaptorBase &base)
Definition Ops.h.inc:355
ConstReadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:349
ConstReadOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:358
ConstReadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr)
Definition Ops.h.inc:353
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:547
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:410
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:414
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:623
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:406
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
Definition Ops.h.inc:393
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:654
FoldAdaptor::Properties Properties
Definition Ops.h.inc:392
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:531
::mlir::TypedValue<::mlir::Type > getVal()
Definition Ops.h.inc:430
::mlir::StringAttr getConstNameAttrName()
Definition Ops.h.inc:398
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:493
ConstReadOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:390
::mlir::StringAttr getConstNameAttrName(::mlir::OperationName name)
Definition Ops.h.inc:402
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:520
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:424
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:470
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:509
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.h.inc:420
void setConstName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:557
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:601
void setConstNameAttr(::mlir::FlatSymbolRefAttr attr)
Definition Ops.h.inc:448
::mlir::FlatSymbolRefAttr getConstNameAttr()
Definition Ops.h.inc:443
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type val, ::mlir::FlatSymbolRefAttr const_name)
Definition Ops.cpp.inc:561
ConstReadOpAdaptor Adaptor
Definition Ops.h.inc:388
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:514
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:527
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:540
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:619
::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable)
Definition Ops.cpp:28
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:391
::llvm::StringRef getConstName()
Definition Ops.cpp.inc:552
UnifiableCastOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:518
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:686
UnifiableCastOpGenericAdaptor(RangeT values, const UnifiableCastOpGenericAdaptorBase &base)
Definition Ops.h.inc:522
UnifiableCastOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:518
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:527
UnifiableCastOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:525
UnifiableCastOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:520
::llvm::LogicalResult verify()
Definition Ops.cpp:72
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.h.inc:590
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value input)
Definition Ops.cpp.inc:690
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:776
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:562
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:575
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:567
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
Definition Ops.h.inc:563
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:571
::mlir::OpOperand & getInputMutable()
Definition Ops.h.inc:585
UnifiableCastOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:561
::mlir::TypedValue<::mlir::Type > getInput()
Definition Ops.h.inc:581
::mlir::TypedValue<::mlir::Type > getResult()
Definition Ops.h.inc:600
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:709
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:731
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:594
UnifiableCastOpAdaptor Adaptor
Definition Ops.h.inc:559
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:737
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:766
ApplyMapOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:75
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.cpp.inc:122
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:71
ConstReadOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:318
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.h.inc:324
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:314
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:494
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.h.inc:503
UnifiableCastOpGenericAdaptorBase(::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:497
void setMap(const ::mlir::AffineMapAttr &propValue)
Definition Ops.h.inc:46
void setNumDims(const ::mlir::IntegerAttr &propValue)
Definition Ops.h.inc:56
void setConstName(const ::mlir::FlatSymbolRefAttr &propValue)
Definition Ops.h.inc:300