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 {
11namespace pod {
12class NewPodOp;
13} // namespace pod
14} // namespace llzk
15namespace llzk {
16namespace pod {
17class ReadPodOp;
18} // namespace pod
19} // namespace llzk
20namespace llzk {
21namespace pod {
22class WritePodOp;
23} // namespace pod
24} // namespace llzk
25#ifdef GET_OP_CLASSES
26#undef GET_OP_CLASSES
27
28namespace llzk {
29namespace pod {
30
31//===----------------------------------------------------------------------===//
32// ::llzk::pod::NewPodOp declarations
33//===----------------------------------------------------------------------===//
34
35namespace detail {
37public:
38 struct Properties {
39 using initializedRecordsTy = ::mlir::ArrayAttr;
41
43 auto &propStorage = this->initializedRecords;
44 return ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(propStorage);
45 }
46 void setInitializedRecords(const ::mlir::ArrayAttr &propValue) {
47 this->initializedRecords = propValue;
48 }
49 using mapOpGroupSizesTy = ::mlir::DenseI32ArrayAttr;
51
53 auto &propStorage = this->mapOpGroupSizes;
54 return ::llvm::cast<::mlir::DenseI32ArrayAttr>(propStorage);
55 }
56 void setMapOpGroupSizes(const ::mlir::DenseI32ArrayAttr &propValue) {
57 this->mapOpGroupSizes = propValue;
58 }
59 using numDimsPerMapTy = ::mlir::DenseI32ArrayAttr;
61
63 auto &propStorage = this->numDimsPerMap;
64 return ::llvm::dyn_cast_or_null<::mlir::DenseI32ArrayAttr>(propStorage);
65 }
66 void setNumDimsPerMap(const ::mlir::DenseI32ArrayAttr &propValue) {
67 this->numDimsPerMap = propValue;
68 }
69 using operandSegmentSizesTy = std::array<int32_t, 2>;
71 ::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
72 auto &propStorage = this->operandSegmentSizes;
73 return propStorage;
74 }
75 void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
76 auto &propStorage = this->operandSegmentSizes;
77 ::llvm::copy(propValue, propStorage.begin());
78 }
79 bool operator==(const Properties &rhs) const {
80 return
81 rhs.initializedRecords == this->initializedRecords &&
82 rhs.mapOpGroupSizes == this->mapOpGroupSizes &&
83 rhs.numDimsPerMap == this->numDimsPerMap &&
84 rhs.operandSegmentSizes == this->operandSegmentSizes &&
85 true;
86 }
87 bool operator!=(const Properties &rhs) const {
88 return !(*this == rhs);
89 }
90 };
91protected:
92 ::mlir::DictionaryAttr odsAttrs;
93 ::std::optional<::mlir::OperationName> odsOpName;
95 ::mlir::RegionRange odsRegions;
96public:
97 NewPodOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
98 odsOpName.emplace("pod.new", odsAttrs.getContext());
99 }
100
102
103 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
105 return properties;
106 }
107
108 ::mlir::DictionaryAttr getAttributes() {
109 return odsAttrs;
110 }
111
112 ::mlir::ArrayAttr getInitializedRecordsAttr();
113 ::mlir::ArrayAttr getInitializedRecords();
114 ::mlir::DenseI32ArrayAttr getNumDimsPerMapAttr();
115 ::llvm::ArrayRef<int32_t> getNumDimsPerMap();
116 ::mlir::DenseI32ArrayAttr getMapOpGroupSizesAttr() {
117 auto attr = ::llvm::cast<::mlir::DenseI32ArrayAttr>(getProperties().mapOpGroupSizes);
118 return attr;
119 }
120
121 ::llvm::ArrayRef<int32_t> getMapOpGroupSizes();
122};
123} // namespace detail
124template <typename RangeT>
126 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
128public:
129 NewPodOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
130
131 NewPodOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : NewPodOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
132
133 NewPodOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : NewPodOpGenericAdaptor(values, attrs, Properties{}, {}) {}
134
135 NewPodOpGenericAdaptor(RangeT values, const NewPodOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {}
136
137 template <typename LateInst = NewPodOp, typename = std::enable_if_t<std::is_same_v<LateInst, NewPodOp>>>
138 NewPodOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
139
140 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
141 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
142 }
143
144 RangeT getODSOperands(unsigned index) {
145 auto valueRange = getODSOperandIndexAndLength(index);
146 return {std::next(odsOperands.begin(), valueRange.first),
147 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
148 }
149
151 return getODSOperands(0);
152 }
153
154 ::llvm::SmallVector<RangeT> getMapOperands() {
155 auto tblgenTmpOperands = getODSOperands(1);
156 auto sizes = getMapOpGroupSizes();
157
158 ::llvm::SmallVector<RangeT> tblgenTmpOperandGroups;
159 for (int i = 0, e = sizes.size(); i < e; ++i) {
160 tblgenTmpOperandGroups.push_back(tblgenTmpOperands.take_front(sizes[i]));
161 tblgenTmpOperands = tblgenTmpOperands.drop_front(sizes[i]);
162 }
163 return tblgenTmpOperandGroups;
164 }
165
166 RangeT getOperands() {
167 return odsOperands;
168 }
169
170private:
171 RangeT odsOperands;
172};
173class NewPodOpAdaptor : public NewPodOpGenericAdaptor<::mlir::ValueRange> {
174public:
177
178 ::llvm::LogicalResult verify(::mlir::Location loc);
179};
180class NewPodOp : public ::mlir::Op<NewPodOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::llzk::pod::PodType>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::AttrSizedOperandSegments, ::llzk::VerifySizesForMultiAffineOps<1>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::PromotableAllocationOpInterface::Trait, ::mlir::DestructurableAllocationOpInterface::Trait, ::mlir::OpAsmOpInterface::Trait> {
181public:
182 using Op::Op;
183 using Op::print;
185 template <typename RangeT>
189 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
190 static ::llvm::StringRef attrNames[] = {::llvm::StringRef("initializedRecords"), ::llvm::StringRef("mapOpGroupSizes"), ::llvm::StringRef("numDimsPerMap"), ::llvm::StringRef("operandSegmentSizes")};
191 return ::llvm::ArrayRef(attrNames);
192 }
193
194 ::mlir::StringAttr getInitializedRecordsAttrName() {
195 return getAttributeNameForIndex(0);
196 }
197
198 static ::mlir::StringAttr getInitializedRecordsAttrName(::mlir::OperationName name) {
199 return getAttributeNameForIndex(name, 0);
200 }
201
202 ::mlir::StringAttr getMapOpGroupSizesAttrName() {
203 return getAttributeNameForIndex(1);
204 }
205
206 static ::mlir::StringAttr getMapOpGroupSizesAttrName(::mlir::OperationName name) {
207 return getAttributeNameForIndex(name, 1);
208 }
209
210 ::mlir::StringAttr getNumDimsPerMapAttrName() {
211 return getAttributeNameForIndex(2);
212 }
213
214 static ::mlir::StringAttr getNumDimsPerMapAttrName(::mlir::OperationName name) {
215 return getAttributeNameForIndex(name, 2);
216 }
217
218 ::mlir::StringAttr getOperandSegmentSizesAttrName() {
219 return (*this)->getName().getAttributeNames().back();
220 }
221
222 static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
223 return name.getAttributeNames().back();
224 }
225
226 static constexpr ::llvm::StringLiteral getOperationName() {
227 return ::llvm::StringLiteral("pod.new");
228 }
229
230 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
231 ::mlir::Operation::operand_range getODSOperands(unsigned index) {
232 auto valueRange = getODSOperandIndexAndLength(index);
233 return {std::next(getOperation()->operand_begin(), valueRange.first),
234 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
235 }
236
237 ::mlir::Operation::operand_range getInitialValues() {
238 return getODSOperands(0);
239 }
240
241 ::mlir::OperandRangeRange getMapOperands() {
242 return getODSOperands(1).split(getMapOpGroupSizesAttr());
243 }
244
245 ::mlir::MutableOperandRange getInitialValuesMutable();
246 ::mlir::MutableOperandRangeRange getMapOperandsMutable();
247 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) {
248 return {index, 1};
249 }
250
251 ::mlir::Operation::result_range getODSResults(unsigned index) {
252 auto valueRange = getODSResultIndexAndLength(index);
253 return {std::next(getOperation()->result_begin(), valueRange.first),
254 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
255 }
256
257 ::mlir::TypedValue<::llzk::pod::PodType> getResult() {
258 return ::llvm::cast<::mlir::TypedValue<::llzk::pod::PodType>>(*getODSResults(0).begin());
259 }
260
261 static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
262 static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
263 static llvm::hash_code computePropertiesHash(const Properties &prop);
264 static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
265 static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
266 static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
267 static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
268 static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
269 void writeProperties(::mlir::DialectBytecodeWriter &writer);
270 ::mlir::ArrayAttr getInitializedRecordsAttr() {
271 return ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(getProperties().initializedRecords);
272 }
273
274 ::mlir::ArrayAttr getInitializedRecords();
275 ::mlir::DenseI32ArrayAttr getNumDimsPerMapAttr() {
276 return ::llvm::dyn_cast_or_null<::mlir::DenseI32ArrayAttr>(getProperties().numDimsPerMap);
277 }
278
279 ::llvm::ArrayRef<int32_t> getNumDimsPerMap();
280 ::mlir::DenseI32ArrayAttr getMapOpGroupSizesAttr() {
281 return ::llvm::cast<::mlir::DenseI32ArrayAttr>(getProperties().mapOpGroupSizes);
282 }
283
284 ::llvm::ArrayRef<int32_t> getMapOpGroupSizes();
285 void setInitializedRecordsAttr(::mlir::ArrayAttr attr) {
286 getProperties().initializedRecords = attr;
287 }
288
289 void setNumDimsPerMapAttr(::mlir::DenseI32ArrayAttr attr) {
290 getProperties().numDimsPerMap = attr;
291 }
292
293 void setNumDimsPerMap(::llvm::ArrayRef<int32_t> attrValue);
294 void setMapOpGroupSizesAttr(::mlir::DenseI32ArrayAttr attr) {
295 getProperties().mapOpGroupSizes = attr;
296 }
297
298 void setMapOpGroupSizes(::llvm::ArrayRef<int32_t> attrValue);
299 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llzk::pod::InitializedRecords initialValues = {});
300 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llzk::pod::PodType resultType, ::llzk::pod::InitializedRecords initialValues = {});
301 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llzk::pod::PodType resultType, ::llvm::ArrayRef<::mlir::ValueRange> mapOperands, ::mlir::DenseI32ArrayAttr numDimsPerMap, ::llzk::pod::InitializedRecords initialValues = {});
302 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llzk::pod::PodType resultType, ::llvm::ArrayRef<::mlir::ValueRange> mapOperands, ::llvm::ArrayRef<int32_t> numDimsPerMap, ::llzk::pod::InitializedRecords initialValues = {});
303 static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties);
304 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
305 void print(::mlir::OpAsmPrinter &p);
306 ::llvm::LogicalResult verifyInvariantsImpl();
307 ::llvm::LogicalResult verifyInvariants();
308 ::llvm::LogicalResult verify();
309 ::llvm::SmallVector<::mlir::MemorySlot> getPromotableSlots();
310 ::mlir::Value getDefaultValue(const ::mlir::MemorySlot &slot, ::mlir::OpBuilder &builder);
311 void handleBlockArgument(const ::mlir::MemorySlot &slot, ::mlir::BlockArgument argument, ::mlir::OpBuilder &builder);
312 ::std::optional<::mlir::PromotableAllocationOpInterface> handlePromotionComplete(const ::mlir::MemorySlot &slot, ::mlir::Value defaultValue, ::mlir::OpBuilder &builder);
313 ::llvm::SmallVector<::mlir::DestructurableMemorySlot> getDestructurableSlots();
314 ::llvm::DenseMap<::mlir::Attribute, ::mlir::MemorySlot> destructure(const ::mlir::DestructurableMemorySlot &slot, const ::llvm::SmallPtrSetImpl<::mlir::Attribute> &usedIndices, ::mlir::OpBuilder &builder, ::mlir::SmallVectorImpl<::mlir::DestructurableAllocationOpInterface> &newAllocators);
315 ::std::optional<::mlir::DestructurableAllocationOpInterface> handleDestructuringComplete(const ::mlir::DestructurableMemorySlot &slot, ::mlir::OpBuilder &builder);
316 void getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn);
317 void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
318private:
319 ::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
320 return getAttributeNameForIndex((*this)->getName(), index);
321 }
322
323 static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
324 assert(index < 3 && "invalid attribute index");
325 assert(name.getStringRef() == getOperationName() && "invalid operation name");
326 assert(name.isRegistered() && "Operation isn't registered, missing a "
327 "dependent dialect loading?");
328 return name.getAttributeNames()[index];
329 }
330
331public:
332 ::mlir::SmallVector<::llzk::pod::RecordValue> getInitializedRecordValues();
333};
334} // namespace pod
335} // namespace llzk
336MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::pod::NewPodOp)
337
338namespace llzk {
339namespace pod {
340
341//===----------------------------------------------------------------------===//
342// ::llzk::pod::ReadPodOp declarations
343//===----------------------------------------------------------------------===//
344
345namespace detail {
347public:
348 struct Properties {
349 using record_nameTy = ::mlir::StringAttr;
351
353 auto &propStorage = this->record_name;
354 return ::llvm::cast<::mlir::StringAttr>(propStorage);
355 }
356 void setRecordName(const ::mlir::StringAttr &propValue) {
357 this->record_name = propValue;
358 }
359 bool operator==(const Properties &rhs) const {
360 return
361 rhs.record_name == this->record_name &&
362 true;
363 }
364 bool operator!=(const Properties &rhs) const {
365 return !(*this == rhs);
366 }
367 };
368protected:
369 ::mlir::DictionaryAttr odsAttrs;
370 ::std::optional<::mlir::OperationName> odsOpName;
372 ::mlir::RegionRange odsRegions;
373public:
374 ReadPodOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
375 odsOpName.emplace("pod.read", odsAttrs.getContext());
376 }
377
379
380 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
381 return {index, 1};
382 }
383
385 return properties;
386 }
387
388 ::mlir::DictionaryAttr getAttributes() {
389 return odsAttrs;
390 }
391
392 ::mlir::StringAttr getRecordNameAttr() {
393 auto attr = ::llvm::cast<::mlir::StringAttr>(getProperties().record_name);
394 return attr;
395 }
396
397 ::llvm::StringRef getRecordName();
398};
399} // namespace detail
400template <typename RangeT>
402 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
404public:
405 ReadPodOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
406
407 ReadPodOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : ReadPodOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
408
409 ReadPodOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : ReadPodOpGenericAdaptor(values, attrs, Properties{}, {}) {}
410
411 ReadPodOpGenericAdaptor(RangeT values, const ReadPodOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {}
412
413 template <typename LateInst = ReadPodOp, typename = std::enable_if_t<std::is_same_v<LateInst, ReadPodOp>>>
414 ReadPodOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
415
416 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
417 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
418 }
419
420 RangeT getODSOperands(unsigned index) {
421 auto valueRange = getODSOperandIndexAndLength(index);
422 return {std::next(odsOperands.begin(), valueRange.first),
423 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
424 }
425
426 ValueT getPodRef() {
427 return (*getODSOperands(0).begin());
428 }
429
430 RangeT getOperands() {
431 return odsOperands;
432 }
433
434private:
435 RangeT odsOperands;
436};
437class ReadPodOpAdaptor : public ReadPodOpGenericAdaptor<::mlir::ValueRange> {
438public:
441
442 ::llvm::LogicalResult verify(::mlir::Location loc);
443};
444class ReadPodOp : public ::mlir::Op<ReadPodOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::DestructurableAccessorOpInterface::Trait, ::mlir::PromotableMemOpInterface::Trait, ::llzk::DiscardableAllocationAccessorOpInterface::Trait, ::llzk::pod::PodRefOpInterface::Trait, ::llzk::pod::PodAccessOpInterface::Trait> {
445public:
446 using Op::Op;
447 using Op::print;
449 template <typename RangeT>
453 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
454 static ::llvm::StringRef attrNames[] = {::llvm::StringRef("record_name")};
455 return ::llvm::ArrayRef(attrNames);
456 }
457
458 ::mlir::StringAttr getRecordNameAttrName() {
459 return getAttributeNameForIndex(0);
460 }
461
462 static ::mlir::StringAttr getRecordNameAttrName(::mlir::OperationName name) {
463 return getAttributeNameForIndex(name, 0);
464 }
465
466 static constexpr ::llvm::StringLiteral getOperationName() {
467 return ::llvm::StringLiteral("pod.read");
468 }
469
470 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
471 return {index, 1};
472 }
473
474 ::mlir::Operation::operand_range getODSOperands(unsigned index) {
475 auto valueRange = getODSOperandIndexAndLength(index);
476 return {std::next(getOperation()->operand_begin(), valueRange.first),
477 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
478 }
479
480 ::mlir::TypedValue<::llzk::pod::PodType> getPodRef() {
481 return ::llvm::cast<::mlir::TypedValue<::llzk::pod::PodType>>(*getODSOperands(0).begin());
482 }
483
484 ::mlir::OpOperand &getPodRefMutable() {
485 auto range = getODSOperandIndexAndLength(0);
486 return getOperation()->getOpOperand(range.first);
487 }
488
489 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) {
490 return {index, 1};
491 }
492
493 ::mlir::Operation::result_range getODSResults(unsigned index) {
494 auto valueRange = getODSResultIndexAndLength(index);
495 return {std::next(getOperation()->result_begin(), valueRange.first),
496 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
497 }
498
499 ::mlir::TypedValue<::mlir::Type> getResult() {
500 return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(*getODSResults(0).begin());
501 }
502
503 static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
504 static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
505 static llvm::hash_code computePropertiesHash(const Properties &prop);
506 static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
507 static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
508 static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
509 static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
510 static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
511 void writeProperties(::mlir::DialectBytecodeWriter &writer);
512 ::mlir::StringAttr getRecordNameAttr() {
513 return ::llvm::cast<::mlir::StringAttr>(getProperties().record_name);
514 }
515
516 ::llvm::StringRef getRecordName();
517 void setRecordNameAttr(::mlir::StringAttr attr) {
518 getProperties().record_name = attr;
519 }
520
521 void setRecordName(::llvm::StringRef attrValue);
522 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value pod_ref, ::mlir::StringAttr record_name);
523 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value pod_ref, ::mlir::StringAttr record_name);
524 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value pod_ref, ::llvm::StringRef record_name);
525 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value pod_ref, ::llvm::StringRef record_name);
526 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
527 ::llvm::LogicalResult verifyInvariantsImpl();
528 ::llvm::LogicalResult verifyInvariants();
529 ::llvm::LogicalResult verify();
530 bool canRewire(const ::mlir::DestructurableMemorySlot &slot, ::llvm::SmallPtrSetImpl<::mlir::Attribute> &usedIndices, ::mlir::SmallVectorImpl<::mlir::MemorySlot> &mustBeSafelyUsed, const ::mlir::DataLayout &dataLayout);
531 ::mlir::DeletionKind rewire(const ::mlir::DestructurableMemorySlot &slot, ::llvm::DenseMap<::mlir::Attribute, ::mlir::MemorySlot> &subslots, ::mlir::OpBuilder &builder, const ::mlir::DataLayout &dataLayout);
532 bool loadsFrom(const ::mlir::MemorySlot &slot);
533 bool storesTo(const ::mlir::MemorySlot &slot);
534 ::mlir::Value getStored(const ::mlir::MemorySlot &slot, ::mlir::OpBuilder &builder, ::mlir::Value reachingDef, const ::mlir::DataLayout &dataLayout);
535 bool canUsesBeRemoved(const ::mlir::MemorySlot &slot, const ::llvm::SmallPtrSetImpl<::mlir::OpOperand *> &blockingUses, ::llvm::SmallVectorImpl<::mlir::OpOperand *> &newBlockingUses, const ::mlir::DataLayout &datalayout);
536 ::mlir::DeletionKind removeBlockingUses(const ::mlir::MemorySlot &slot, const ::llvm::SmallPtrSetImpl<mlir::OpOperand *> &blockingUses, ::mlir::OpBuilder &builder, ::mlir::Value reachingDefinition, const ::mlir::DataLayout &dataLayout);
537 bool loadsFromDiscardableAllocation(::mlir::Value ptr);
538 bool storesToDiscardableAllocation(::mlir::Value ptr);
539 bool canEraseAsDeadStoreTo(::mlir::Value ptr, const ::mlir::DataLayout &dataLayout);
540 bool isRead();
541 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
542 void print(::mlir::OpAsmPrinter &_odsPrinter);
543private:
544 ::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
545 return getAttributeNameForIndex((*this)->getName(), index);
546 }
547
548 static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
549 assert(index < 1 && "invalid attribute index");
550 assert(name.getStringRef() == getOperationName() && "invalid operation name");
551 assert(name.isRegistered() && "Operation isn't registered, missing a "
552 "dependent dialect loading?");
553 return name.getAttributeNames()[index];
554 }
555
556public:
558 inline ::llzk::pod::PodType getPodRefType() {
559 return ::llvm::cast<PodAccessOpInterface>(getOperation()).getPodRefType();
560 }
561};
562} // namespace pod
563} // namespace llzk
564MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::pod::ReadPodOp)
565
566namespace llzk {
567namespace pod {
568
569//===----------------------------------------------------------------------===//
570// ::llzk::pod::WritePodOp declarations
571//===----------------------------------------------------------------------===//
572
573namespace detail {
575public:
576 struct Properties {
577 using record_nameTy = ::mlir::StringAttr;
579
581 auto &propStorage = this->record_name;
582 return ::llvm::cast<::mlir::StringAttr>(propStorage);
583 }
584 void setRecordName(const ::mlir::StringAttr &propValue) {
585 this->record_name = propValue;
586 }
587 bool operator==(const Properties &rhs) const {
588 return
589 rhs.record_name == this->record_name &&
590 true;
591 }
592 bool operator!=(const Properties &rhs) const {
593 return !(*this == rhs);
594 }
595 };
596protected:
597 ::mlir::DictionaryAttr odsAttrs;
598 ::std::optional<::mlir::OperationName> odsOpName;
600 ::mlir::RegionRange odsRegions;
601public:
602 WritePodOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
603 odsOpName.emplace("pod.write", odsAttrs.getContext());
604 }
605
607
608 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
609 return {index, 1};
610 }
611
613 return properties;
614 }
615
616 ::mlir::DictionaryAttr getAttributes() {
617 return odsAttrs;
618 }
619
620 ::mlir::StringAttr getRecordNameAttr() {
621 auto attr = ::llvm::cast<::mlir::StringAttr>(getProperties().record_name);
622 return attr;
623 }
624
625 ::llvm::StringRef getRecordName();
626};
627} // namespace detail
628template <typename RangeT>
630 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
632public:
633 WritePodOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
634
635 WritePodOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : WritePodOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
636
637 WritePodOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : WritePodOpGenericAdaptor(values, attrs, Properties{}, {}) {}
638
639 WritePodOpGenericAdaptor(RangeT values, const WritePodOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {}
640
641 template <typename LateInst = WritePodOp, typename = std::enable_if_t<std::is_same_v<LateInst, WritePodOp>>>
642 WritePodOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
643
644 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
645 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
646 }
647
648 RangeT getODSOperands(unsigned index) {
649 auto valueRange = getODSOperandIndexAndLength(index);
650 return {std::next(odsOperands.begin(), valueRange.first),
651 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
652 }
653
654 ValueT getPodRef() {
655 return (*getODSOperands(0).begin());
656 }
657
658 ValueT getValue() {
659 return (*getODSOperands(1).begin());
660 }
661
662 RangeT getOperands() {
663 return odsOperands;
664 }
665
666private:
667 RangeT odsOperands;
668};
669class WritePodOpAdaptor : public WritePodOpGenericAdaptor<::mlir::ValueRange> {
670public:
673
674 ::llvm::LogicalResult verify(::mlir::Location loc);
675};
676class WritePodOp : public ::mlir::Op<WritePodOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::ZeroResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::DestructurableAccessorOpInterface::Trait, ::mlir::PromotableMemOpInterface::Trait, ::llzk::DiscardableAllocationAccessorOpInterface::Trait, ::llzk::pod::PodRefOpInterface::Trait, ::llzk::pod::PodAccessOpInterface::Trait> {
677public:
678 using Op::Op;
679 using Op::print;
681 template <typename RangeT>
685 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
686 static ::llvm::StringRef attrNames[] = {::llvm::StringRef("record_name")};
687 return ::llvm::ArrayRef(attrNames);
688 }
689
690 ::mlir::StringAttr getRecordNameAttrName() {
691 return getAttributeNameForIndex(0);
692 }
693
694 static ::mlir::StringAttr getRecordNameAttrName(::mlir::OperationName name) {
695 return getAttributeNameForIndex(name, 0);
696 }
697
698 static constexpr ::llvm::StringLiteral getOperationName() {
699 return ::llvm::StringLiteral("pod.write");
700 }
701
702 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
703 return {index, 1};
704 }
705
706 ::mlir::Operation::operand_range getODSOperands(unsigned index) {
707 auto valueRange = getODSOperandIndexAndLength(index);
708 return {std::next(getOperation()->operand_begin(), valueRange.first),
709 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
710 }
711
712 ::mlir::TypedValue<::llzk::pod::PodType> getPodRef() {
713 return ::llvm::cast<::mlir::TypedValue<::llzk::pod::PodType>>(*getODSOperands(0).begin());
714 }
715
716 ::mlir::TypedValue<::mlir::Type> getValue() {
717 return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(*getODSOperands(1).begin());
718 }
719
720 ::mlir::OpOperand &getPodRefMutable() {
721 auto range = getODSOperandIndexAndLength(0);
722 return getOperation()->getOpOperand(range.first);
723 }
724
725 ::mlir::OpOperand &getValueMutable() {
726 auto range = getODSOperandIndexAndLength(1);
727 return getOperation()->getOpOperand(range.first);
728 }
729
730 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) {
731 return {index, 1};
732 }
733
734 ::mlir::Operation::result_range getODSResults(unsigned index) {
735 auto valueRange = getODSResultIndexAndLength(index);
736 return {std::next(getOperation()->result_begin(), valueRange.first),
737 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
738 }
739
740 static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
741 static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
742 static llvm::hash_code computePropertiesHash(const Properties &prop);
743 static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
744 static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
745 static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
746 static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
747 static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
748 void writeProperties(::mlir::DialectBytecodeWriter &writer);
749 ::mlir::StringAttr getRecordNameAttr() {
750 return ::llvm::cast<::mlir::StringAttr>(getProperties().record_name);
751 }
752
753 ::llvm::StringRef getRecordName();
754 void setRecordNameAttr(::mlir::StringAttr attr) {
755 getProperties().record_name = attr;
756 }
757
758 void setRecordName(::llvm::StringRef attrValue);
759 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value pod_ref, ::mlir::StringAttr record_name, ::mlir::Value value);
760 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value pod_ref, ::mlir::StringAttr record_name, ::mlir::Value value);
761 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value pod_ref, ::llvm::StringRef record_name, ::mlir::Value value);
762 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value pod_ref, ::llvm::StringRef record_name, ::mlir::Value value);
763 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
764 ::llvm::LogicalResult verifyInvariantsImpl();
765 ::llvm::LogicalResult verifyInvariants();
766 ::llvm::LogicalResult verify();
767 bool canRewire(const ::mlir::DestructurableMemorySlot &slot, ::llvm::SmallPtrSetImpl<::mlir::Attribute> &usedIndices, ::mlir::SmallVectorImpl<::mlir::MemorySlot> &mustBeSafelyUsed, const ::mlir::DataLayout &dataLayout);
768 ::mlir::DeletionKind rewire(const ::mlir::DestructurableMemorySlot &slot, ::llvm::DenseMap<::mlir::Attribute, ::mlir::MemorySlot> &subslots, ::mlir::OpBuilder &builder, const ::mlir::DataLayout &dataLayout);
769 bool loadsFrom(const ::mlir::MemorySlot &slot);
770 bool storesTo(const ::mlir::MemorySlot &slot);
771 ::mlir::Value getStored(const ::mlir::MemorySlot &slot, ::mlir::OpBuilder &builder, ::mlir::Value reachingDef, const ::mlir::DataLayout &dataLayout);
772 bool canUsesBeRemoved(const ::mlir::MemorySlot &slot, const ::llvm::SmallPtrSetImpl<::mlir::OpOperand *> &blockingUses, ::llvm::SmallVectorImpl<::mlir::OpOperand *> &newBlockingUses, const ::mlir::DataLayout &datalayout);
773 ::mlir::DeletionKind removeBlockingUses(const ::mlir::MemorySlot &slot, const ::llvm::SmallPtrSetImpl<mlir::OpOperand *> &blockingUses, ::mlir::OpBuilder &builder, ::mlir::Value reachingDefinition, const ::mlir::DataLayout &dataLayout);
774 bool loadsFromDiscardableAllocation(::mlir::Value ptr);
775 bool storesToDiscardableAllocation(::mlir::Value ptr);
776 bool canEraseAsDeadStoreTo(::mlir::Value ptr, const ::mlir::DataLayout &dataLayout);
777 bool isRead();
778 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
779 void print(::mlir::OpAsmPrinter &_odsPrinter);
780private:
781 ::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
782 return getAttributeNameForIndex((*this)->getName(), index);
783 }
784
785 static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
786 assert(index < 1 && "invalid attribute index");
787 assert(name.getStringRef() == getOperationName() && "invalid operation name");
788 assert(name.isRegistered() && "Operation isn't registered, missing a "
789 "dependent dialect loading?");
790 return name.getAttributeNames()[index];
791 }
792
793public:
795 inline ::llzk::pod::PodType getPodRefType() {
796 return ::llvm::cast<PodAccessOpInterface>(getOperation()).getPodRefType();
797 }
798};
799} // namespace pod
800} // namespace llzk
801MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::pod::WritePodOp)
802
803
804#endif // GET_OP_CLASSES
805
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:159
NewPodOpAdaptor(NewPodOp op)
Definition Ops.cpp.inc:157
NewPodOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:129
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:140
NewPodOpGenericAdaptor(RangeT values, const NewPodOpGenericAdaptorBase &base)
Definition Ops.h.inc:135
::llvm::SmallVector< RangeT > getMapOperands()
Definition Ops.h.inc:154
NewPodOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:138
NewPodOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs)
Definition Ops.h.inc:133
NewPodOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:129
RangeT getODSOperands(unsigned index)
Definition Ops.h.inc:144
NewPodOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:131
void print(::mlir::OpAsmPrinter &p)
Definition Ops.cpp:420
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:521
::mlir::StringAttr getMapOpGroupSizesAttrName(::mlir::OperationName name)
Definition Ops.h.inc:206
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:197
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:297
NewPodOpAdaptor Adaptor
Definition Ops.h.inc:184
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:527
void setMapOpGroupSizesAttr(::mlir::DenseI32ArrayAttr attr)
Definition Ops.h.inc:294
::mlir::ArrayAttr getInitializedRecordsAttr()
Definition Ops.h.inc:270
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:376
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:478
::mlir::Operation::operand_range getInitialValues()
Definition Ops.h.inc:237
::mlir::StringAttr getNumDimsPerMapAttrName(::mlir::OperationName name)
Definition Ops.h.inc:214
::mlir::OperandRangeRange getMapOperands()
Definition Ops.h.inc:241
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:308
::mlir::SmallVector<::llzk::pod::RecordValue > getInitializedRecordValues()
Definition Ops.cpp:457
NewPodOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:186
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:259
static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties)
Definition Ops.cpp.inc:470
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:321
void setMapOpGroupSizes(::llvm::ArrayRef< int32_t > attrValue)
Definition Ops.cpp.inc:454
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llzk::pod::InitializedRecords initialValues={})
Definition Ops.cpp.inc:458
::std::optional<::mlir::PromotableAllocationOpInterface > handlePromotionComplete(const ::mlir::MemorySlot &slot, ::mlir::Value defaultValue, ::mlir::OpBuilder &builder)
Required by PromotableAllocationOpInterface / mem2reg pass.
Definition Ops.cpp:181
::llvm::SmallVector<::mlir::DestructurableMemorySlot > getDestructurableSlots()
Required by DestructurableAllocationOpInterface / SROA pass.
Definition Ops.cpp:94
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.h.inc:247
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llzk::pod::PodType resultType, ::llvm::ArrayRef<::mlir::ValueRange > mapOperands, ::mlir::DenseI32ArrayAttr numDimsPerMap, ::llzk::pod::InitializedRecords initialValues={})
::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name)
Definition Ops.h.inc:222
::llvm::SmallVector<::mlir::MemorySlot > getPromotableSlots()
Required by PromotableAllocationOpInterface / mem2reg pass.
Definition Ops.cpp:153
::llvm::ArrayRef< int32_t > getNumDimsPerMap()
Definition Ops.cpp.inc:440
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:346
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:187
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.cpp.inc:176
::mlir::DenseI32ArrayAttr getNumDimsPerMapAttr()
Definition Ops.h.inc:275
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:251
::mlir::TypedValue<::llzk::pod::PodType > getResult()
Definition Ops.h.inc:257
::mlir::StringAttr getInitializedRecordsAttrName()
Definition Ops.h.inc:194
::llvm::ArrayRef< int32_t > getMapOpGroupSizes()
Definition Ops.cpp.inc:445
::mlir::Value getDefaultValue(const ::mlir::MemorySlot &slot, ::mlir::OpBuilder &builder)
Required by PromotableAllocationOpInterface / mem2reg pass.
Definition Ops.cpp:162
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:231
::mlir::StringAttr getMapOpGroupSizesAttrName()
Definition Ops.h.inc:202
void setInitializedRecordsAttr(::mlir::ArrayAttr attr)
Definition Ops.h.inc:285
::mlir::DenseI32ArrayAttr getMapOpGroupSizesAttr()
Definition Ops.h.inc:280
::mlir::MutableOperandRange getInitialValuesMutable()
Definition Ops.cpp.inc:185
void setNumDimsPerMap(::llvm::ArrayRef< int32_t > attrValue)
Definition Ops.cpp.inc:450
void getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn)
Definition Ops.cpp:89
::mlir::StringAttr getOperandSegmentSizesAttrName()
Definition Ops.h.inc:218
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
Definition Ops.h.inc:189
FoldAdaptor::Properties Properties
Definition Ops.h.inc:188
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:355
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llzk::pod::PodType resultType, ::llzk::pod::InitializedRecords initialValues={})
::mlir::MutableOperandRangeRange getMapOperandsMutable()
Definition Ops.cpp.inc:191
::llvm::LogicalResult verify()
Definition Ops.cpp:291
::mlir::StringAttr getInitializedRecordsAttrName(::mlir::OperationName name)
Definition Ops.h.inc:198
::llvm::DenseMap<::mlir::Attribute, ::mlir::MemorySlot > destructure(const ::mlir::DestructurableMemorySlot &slot, const ::llvm::SmallPtrSetImpl<::mlir::Attribute > &usedIndices, ::mlir::OpBuilder &builder, ::mlir::SmallVectorImpl<::mlir::DestructurableAllocationOpInterface > &newAllocators)
Required by DestructurableAllocationOpInterface / SROA pass.
Definition Ops.cpp:106
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:413
::std::optional<::mlir::DestructurableAllocationOpInterface > handleDestructuringComplete(const ::mlir::DestructurableMemorySlot &slot, ::mlir::OpBuilder &builder)
Required by DestructurableAllocationOpInterface / SROA pass.
Definition Ops.cpp:144
::mlir::ArrayAttr getInitializedRecords()
Definition Ops.cpp.inc:435
void setNumDimsPerMapAttr(::mlir::DenseI32ArrayAttr attr)
Definition Ops.h.inc:289
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp:322
::mlir::StringAttr getNumDimsPerMapAttrName()
Definition Ops.h.inc:210
void handleBlockArgument(const ::mlir::MemorySlot &slot, ::mlir::BlockArgument argument, ::mlir::OpBuilder &builder)
Required by PromotableAllocationOpInterface / mem2reg pass.
Definition Ops.cpp:178
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:226
ReadPodOpAdaptor(ReadPodOp op)
Definition Ops.cpp.inc:551
ReadPodOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:405
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:553
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:416
ReadPodOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:405
ReadPodOpGenericAdaptor(RangeT values, const ReadPodOpGenericAdaptorBase &base)
Definition Ops.h.inc:411
RangeT getODSOperands(unsigned index)
Definition Ops.h.inc:420
ReadPodOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr)
Definition Ops.h.inc:409
ReadPodOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:414
ReadPodOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:407
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:712
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:585
::llvm::StringRef getRecordName()
Definition Ops.cpp.inc:632
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:619
::mlir::TypedValue<::mlir::Type > getResult()
Definition Ops.h.inc:499
void setRecordNameAttr(::mlir::StringAttr attr)
Definition Ops.h.inc:517
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:474
bool canUsesBeRemoved(const ::mlir::MemorySlot &slot, const ::llvm::SmallPtrSetImpl<::mlir::OpOperand * > &blockingUses, ::llvm::SmallVectorImpl<::mlir::OpOperand * > &newBlockingUses, const ::mlir::DataLayout &datalayout)
Required by PromotableMemOpInterface / mem2reg pass.
Definition Ops.cpp.inc:836
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.h.inc:489
::mlir::DeletionKind removeBlockingUses(const ::mlir::MemorySlot &slot, const ::llvm::SmallPtrSetImpl< mlir::OpOperand * > &blockingUses, ::mlir::OpBuilder &builder, ::mlir::Value reachingDefinition, const ::mlir::DataLayout &dataLayout)
Required by PromotableMemOpInterface / mem2reg pass.
Definition Ops.cpp.inc:850
ReadPodOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:450
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:470
bool storesTo(const ::mlir::MemorySlot &slot)
Required by PromotableMemOpInterface / mem2reg pass.
Definition Ops.cpp.inc:825
bool isRead()
Return true if the op is a read, false if it's a write.
Definition Ops.cpp.inc:858
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:685
inline ::llzk::pod::PodType getPodRefType()
Gets the type of the referenced pod.
Definition Ops.h.inc:558
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp:534
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp:529
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:718
::llvm::LogicalResult verify()
Definition Ops.cpp:538
FoldAdaptor::Properties Properties
Definition Ops.h.inc:452
::mlir::Value getStored(const ::mlir::MemorySlot &slot, ::mlir::OpBuilder &builder, ::mlir::Value reachingDef, const ::mlir::DataLayout &dataLayout)
Required by PromotableAllocationOpInterface / mem2reg pass.
Definition Ops.cpp.inc:830
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:562
::mlir::TypedValue<::llzk::pod::PodType > getPodRef()
Definition Ops.h.inc:480
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:773
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:601
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value pod_ref, ::mlir::StringAttr record_name)
Definition Ops.cpp.inc:641
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:451
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:612
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:466
bool canEraseAsDeadStoreTo(::mlir::Value ptr, const ::mlir::DataLayout &dataLayout)
Required by DiscardableAllocationAccessorOpInterface / unused allocation cleanup.
Definition Ops.cpp.inc:873
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:606
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:493
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
Definition Ops.h.inc:453
::mlir::OpOperand & getPodRefMutable()
Definition Ops.h.inc:484
::mlir::StringAttr getRecordNameAttr()
Definition Ops.h.inc:512
::mlir::StringAttr getRecordNameAttrName()
Definition Ops.h.inc:458
bool loadsFrom(const ::mlir::MemorySlot &slot)
Required by PromotableMemOpInterface / mem2reg pass.
Definition Ops.cpp.inc:820
bool canRewire(const ::mlir::DestructurableMemorySlot &slot, ::llvm::SmallPtrSetImpl<::mlir::Attribute > &usedIndices, ::mlir::SmallVectorImpl<::mlir::MemorySlot > &mustBeSafelyUsed, const ::mlir::DataLayout &dataLayout)
Required by DestructurableAllocationOpInterface / SROA pass.
Definition Ops.cpp.inc:803
bool storesToDiscardableAllocation(::mlir::Value ptr)
Required by DiscardableAllocationAccessorOpInterface / unused allocation cleanup.
Definition Ops.cpp.inc:868
::mlir::StringAttr getRecordNameAttrName(::mlir::OperationName name)
Definition Ops.h.inc:462
void setRecordName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:637
ReadPodOpAdaptor Adaptor
Definition Ops.h.inc:448
bool loadsFromDiscardableAllocation(::mlir::Value ptr)
Required by DiscardableAllocationAccessorOpInterface / unused allocation cleanup.
Definition Ops.cpp.inc:863
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:623
::mlir::DeletionKind rewire(const ::mlir::DestructurableMemorySlot &slot, ::llvm::DenseMap<::mlir::Attribute, ::mlir::MemorySlot > &subslots, ::mlir::OpBuilder &builder, const ::mlir::DataLayout &dataLayout)
Required by DestructurableAllocationOpInterface / SROA pass.
Definition Ops.cpp.inc:812
WritePodOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:633
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:898
WritePodOpAdaptor(WritePodOp op)
Definition Ops.cpp.inc:896
WritePodOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:633
RangeT getODSOperands(unsigned index)
Definition Ops.h.inc:648
WritePodOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:635
WritePodOpGenericAdaptor(RangeT values, const WritePodOpGenericAdaptorBase &base)
Definition Ops.h.inc:639
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:644
WritePodOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr)
Definition Ops.h.inc:637
WritePodOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:642
bool canUsesBeRemoved(const ::mlir::MemorySlot &slot, const ::llvm::SmallPtrSetImpl<::mlir::OpOperand * > &blockingUses, ::llvm::SmallVectorImpl<::mlir::OpOperand * > &newBlockingUses, const ::mlir::DataLayout &datalayout)
Required by PromotableMemOpInterface / mem2reg pass.
Definition Ops.cpp.inc:1193
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:734
inline ::llzk::pod::PodType getPodRefType()
Gets the type of the referenced pod.
Definition Ops.h.inc:795
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
Definition Ops.h.inc:685
::mlir::Value getStored(const ::mlir::MemorySlot &slot, ::mlir::OpBuilder &builder, ::mlir::Value reachingDef, const ::mlir::DataLayout &dataLayout)
Required by PromotableAllocationOpInterface / mem2reg pass.
Definition Ops.cpp.inc:1187
::llvm::LogicalResult verify()
Definition Ops.cpp:571
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:946
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value pod_ref, ::mlir::StringAttr record_name, ::mlir::Value value)
Definition Ops.cpp.inc:986
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1127
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1056
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.h.inc:730
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:698
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1062
bool loadsFromDiscardableAllocation(::mlir::Value ptr)
Required by DiscardableAllocationAccessorOpInterface / unused allocation cleanup.
Definition Ops.cpp.inc:1220
::mlir::StringAttr getRecordNameAttr()
Definition Ops.h.inc:749
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:968
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp:562
::mlir::TypedValue<::mlir::Type > getValue()
Definition Ops.h.inc:716
::mlir::StringAttr getRecordNameAttrName(::mlir::OperationName name)
Definition Ops.h.inc:694
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:683
::mlir::OpOperand & getPodRefMutable()
Definition Ops.h.inc:720
void setRecordName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:982
WritePodOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:682
::mlir::TypedValue<::llzk::pod::PodType > getPodRef()
Definition Ops.h.inc:712
FoldAdaptor::Properties Properties
Definition Ops.h.inc:684
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:951
::mlir::OpOperand & getValueMutable()
Definition Ops.h.inc:725
::mlir::DeletionKind rewire(const ::mlir::DestructurableMemorySlot &slot, ::llvm::DenseMap<::mlir::Attribute, ::mlir::MemorySlot > &subslots, ::mlir::OpBuilder &builder, const ::mlir::DataLayout &dataLayout)
Required by DestructurableAllocationOpInterface / SROA pass.
Definition Ops.cpp.inc:1169
bool isRead()
Return true if the op is a read, false if it's a write.
Definition Ops.cpp.inc:1215
bool canRewire(const ::mlir::DestructurableMemorySlot &slot, ::llvm::SmallPtrSetImpl<::mlir::Attribute > &usedIndices, ::mlir::SmallVectorImpl<::mlir::MemorySlot > &mustBeSafelyUsed, const ::mlir::DataLayout &dataLayout)
Required by DestructurableAllocationOpInterface / SROA pass.
Definition Ops.cpp.inc:1160
::mlir::DeletionKind removeBlockingUses(const ::mlir::MemorySlot &slot, const ::llvm::SmallPtrSetImpl< mlir::OpOperand * > &blockingUses, ::mlir::OpBuilder &builder, ::mlir::Value reachingDefinition, const ::mlir::DataLayout &dataLayout)
Required by PromotableMemOpInterface / mem2reg pass.
Definition Ops.cpp.inc:1207
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:706
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1032
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp:567
WritePodOpAdaptor Adaptor
Definition Ops.h.inc:680
bool storesTo(const ::mlir::MemorySlot &slot)
Required by PromotableMemOpInterface / mem2reg pass.
Definition Ops.cpp.inc:1182
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:702
::llvm::StringRef getRecordName()
Definition Ops.cpp.inc:977
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:964
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:907
void setRecordNameAttr(::mlir::StringAttr attr)
Definition Ops.h.inc:754
bool canEraseAsDeadStoreTo(::mlir::Value ptr, const ::mlir::DataLayout &dataLayout)
Required by DiscardableAllocationAccessorOpInterface / unused allocation cleanup.
Definition Ops.cpp.inc:1230
bool storesToDiscardableAllocation(::mlir::Value ptr)
Required by DiscardableAllocationAccessorOpInterface / unused allocation cleanup.
Definition Ops.cpp.inc:1225
bool loadsFrom(const ::mlir::MemorySlot &slot)
Required by PromotableMemOpInterface / mem2reg pass.
Definition Ops.cpp.inc:1177
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:957
::mlir::StringAttr getRecordNameAttrName()
Definition Ops.h.inc:690
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:930
::mlir::DenseI32ArrayAttr getMapOpGroupSizesAttr()
Definition Ops.h.inc:116
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.cpp.inc:122
::llvm::ArrayRef< int32_t > getMapOpGroupSizes()
Definition Ops.cpp.inc:151
NewPodOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:97
::llvm::ArrayRef< int32_t > getNumDimsPerMap()
Definition Ops.cpp.inc:146
::mlir::DictionaryAttr getAttributes()
Definition Ops.h.inc:108
::mlir::DenseI32ArrayAttr getNumDimsPerMapAttr()
Definition Ops.cpp.inc:141
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:93
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.h.inc:380
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:370
ReadPodOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:374
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.h.inc:608
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:598
WritePodOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:602
mlir::ArrayRef< RecordValue > InitializedRecords
Definition Types.h:25
bool operator!=(const Properties &rhs) const
Definition Ops.h.inc:87
bool operator==(const Properties &rhs) const
Definition Ops.h.inc:79
void setOperandSegmentSizes(::llvm::ArrayRef< int32_t > propValue)
Definition Ops.h.inc:75
void setInitializedRecords(const ::mlir::ArrayAttr &propValue)
Definition Ops.h.inc:46
void setNumDimsPerMap(const ::mlir::DenseI32ArrayAttr &propValue)
Definition Ops.h.inc:66
void setMapOpGroupSizes(const ::mlir::DenseI32ArrayAttr &propValue)
Definition Ops.h.inc:56
::llvm::ArrayRef< int32_t > getOperandSegmentSizes() const
Definition Ops.h.inc:71
void setRecordName(const ::mlir::StringAttr &propValue)
Definition Ops.h.inc:356
void setRecordName(const ::mlir::StringAttr &propValue)
Definition Ops.h.inc:584