LLZK 2.1.1
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::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::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::FlatSymbolRefAttr;
351
353 auto &propStorage = this->record_name;
354 return ::llvm::cast<::mlir::FlatSymbolRefAttr>(propStorage);
355 }
356 void setRecordName(const ::mlir::FlatSymbolRefAttr &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::FlatSymbolRefAttr getRecordNameAttr() {
393 auto attr = ::llvm::cast<::mlir::FlatSymbolRefAttr>(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::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::FlatSymbolRefAttr getRecordNameAttr() {
513 return ::llvm::cast<::mlir::FlatSymbolRefAttr>(getProperties().record_name);
514 }
515
516 ::llvm::StringRef getRecordName();
517 void setRecordNameAttr(::mlir::FlatSymbolRefAttr 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::FlatSymbolRefAttr record_name);
523 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value pod_ref, ::mlir::FlatSymbolRefAttr 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 isRead();
538 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
539 void print(::mlir::OpAsmPrinter &_odsPrinter);
540private:
541 ::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
542 return getAttributeNameForIndex((*this)->getName(), index);
543 }
544
545 static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
546 assert(index < 1 && "invalid attribute index");
547 assert(name.getStringRef() == getOperationName() && "invalid operation name");
548 assert(name.isRegistered() && "Operation isn't registered, missing a "
549 "dependent dialect loading?");
550 return name.getAttributeNames()[index];
551 }
552
553public:
555 inline ::llzk::pod::PodType getPodRefType() {
556 return ::llvm::cast<PodAccessOpInterface>(getOperation()).getPodRefType();
557 }
558};
559} // namespace pod
560} // namespace llzk
561MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::pod::ReadPodOp)
562
563namespace llzk {
564namespace pod {
565
566//===----------------------------------------------------------------------===//
567// ::llzk::pod::WritePodOp declarations
568//===----------------------------------------------------------------------===//
569
570namespace detail {
572public:
573 struct Properties {
574 using record_nameTy = ::mlir::FlatSymbolRefAttr;
576
578 auto &propStorage = this->record_name;
579 return ::llvm::cast<::mlir::FlatSymbolRefAttr>(propStorage);
580 }
581 void setRecordName(const ::mlir::FlatSymbolRefAttr &propValue) {
582 this->record_name = propValue;
583 }
584 bool operator==(const Properties &rhs) const {
585 return
586 rhs.record_name == this->record_name &&
587 true;
588 }
589 bool operator!=(const Properties &rhs) const {
590 return !(*this == rhs);
591 }
592 };
593protected:
594 ::mlir::DictionaryAttr odsAttrs;
595 ::std::optional<::mlir::OperationName> odsOpName;
597 ::mlir::RegionRange odsRegions;
598public:
599 WritePodOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
600 odsOpName.emplace("pod.write", odsAttrs.getContext());
601 }
602
604
605 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
606 return {index, 1};
607 }
608
610 return properties;
611 }
612
613 ::mlir::DictionaryAttr getAttributes() {
614 return odsAttrs;
615 }
616
617 ::mlir::FlatSymbolRefAttr getRecordNameAttr() {
618 auto attr = ::llvm::cast<::mlir::FlatSymbolRefAttr>(getProperties().record_name);
619 return attr;
620 }
621
622 ::llvm::StringRef getRecordName();
623};
624} // namespace detail
625template <typename RangeT>
627 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
629public:
630 WritePodOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
631
632 WritePodOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : WritePodOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
633
634 WritePodOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : WritePodOpGenericAdaptor(values, attrs, Properties{}, {}) {}
635
636 WritePodOpGenericAdaptor(RangeT values, const WritePodOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {}
637
638 template <typename LateInst = WritePodOp, typename = std::enable_if_t<std::is_same_v<LateInst, WritePodOp>>>
639 WritePodOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
640
641 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
642 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
643 }
644
645 RangeT getODSOperands(unsigned index) {
646 auto valueRange = getODSOperandIndexAndLength(index);
647 return {std::next(odsOperands.begin(), valueRange.first),
648 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
649 }
650
651 ValueT getPodRef() {
652 return (*getODSOperands(0).begin());
653 }
654
655 ValueT getValue() {
656 return (*getODSOperands(1).begin());
657 }
658
659 RangeT getOperands() {
660 return odsOperands;
661 }
662
663private:
664 RangeT odsOperands;
665};
666class WritePodOpAdaptor : public WritePodOpGenericAdaptor<::mlir::ValueRange> {
667public:
670
671 ::llvm::LogicalResult verify(::mlir::Location loc);
672};
673class 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::pod::PodRefOpInterface::Trait, ::llzk::pod::PodAccessOpInterface::Trait> {
674public:
675 using Op::Op;
676 using Op::print;
678 template <typename RangeT>
682 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
683 static ::llvm::StringRef attrNames[] = {::llvm::StringRef("record_name")};
684 return ::llvm::ArrayRef(attrNames);
685 }
686
687 ::mlir::StringAttr getRecordNameAttrName() {
688 return getAttributeNameForIndex(0);
689 }
690
691 static ::mlir::StringAttr getRecordNameAttrName(::mlir::OperationName name) {
692 return getAttributeNameForIndex(name, 0);
693 }
694
695 static constexpr ::llvm::StringLiteral getOperationName() {
696 return ::llvm::StringLiteral("pod.write");
697 }
698
699 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
700 return {index, 1};
701 }
702
703 ::mlir::Operation::operand_range getODSOperands(unsigned index) {
704 auto valueRange = getODSOperandIndexAndLength(index);
705 return {std::next(getOperation()->operand_begin(), valueRange.first),
706 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
707 }
708
709 ::mlir::TypedValue<::llzk::pod::PodType> getPodRef() {
710 return ::llvm::cast<::mlir::TypedValue<::llzk::pod::PodType>>(*getODSOperands(0).begin());
711 }
712
713 ::mlir::TypedValue<::mlir::Type> getValue() {
714 return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(*getODSOperands(1).begin());
715 }
716
717 ::mlir::OpOperand &getPodRefMutable() {
718 auto range = getODSOperandIndexAndLength(0);
719 return getOperation()->getOpOperand(range.first);
720 }
721
722 ::mlir::OpOperand &getValueMutable() {
723 auto range = getODSOperandIndexAndLength(1);
724 return getOperation()->getOpOperand(range.first);
725 }
726
727 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) {
728 return {index, 1};
729 }
730
731 ::mlir::Operation::result_range getODSResults(unsigned index) {
732 auto valueRange = getODSResultIndexAndLength(index);
733 return {std::next(getOperation()->result_begin(), valueRange.first),
734 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
735 }
736
737 static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
738 static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
739 static llvm::hash_code computePropertiesHash(const Properties &prop);
740 static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
741 static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
742 static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
743 static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
744 static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
745 void writeProperties(::mlir::DialectBytecodeWriter &writer);
746 ::mlir::FlatSymbolRefAttr getRecordNameAttr() {
747 return ::llvm::cast<::mlir::FlatSymbolRefAttr>(getProperties().record_name);
748 }
749
750 ::llvm::StringRef getRecordName();
751 void setRecordNameAttr(::mlir::FlatSymbolRefAttr attr) {
752 getProperties().record_name = attr;
753 }
754
755 void setRecordName(::llvm::StringRef attrValue);
756 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value pod_ref, ::mlir::FlatSymbolRefAttr record_name, ::mlir::Value value);
757 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value pod_ref, ::mlir::FlatSymbolRefAttr record_name, ::mlir::Value value);
758 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value pod_ref, ::llvm::StringRef record_name, ::mlir::Value value);
759 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value pod_ref, ::llvm::StringRef record_name, ::mlir::Value value);
760 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
761 ::llvm::LogicalResult verifyInvariantsImpl();
762 ::llvm::LogicalResult verifyInvariants();
763 ::llvm::LogicalResult verify();
764 bool canRewire(const ::mlir::DestructurableMemorySlot &slot, ::llvm::SmallPtrSetImpl<::mlir::Attribute> &usedIndices, ::mlir::SmallVectorImpl<::mlir::MemorySlot> &mustBeSafelyUsed, const ::mlir::DataLayout &dataLayout);
765 ::mlir::DeletionKind rewire(const ::mlir::DestructurableMemorySlot &slot, ::llvm::DenseMap<::mlir::Attribute, ::mlir::MemorySlot> &subslots, ::mlir::OpBuilder &builder, const ::mlir::DataLayout &dataLayout);
766 bool loadsFrom(const ::mlir::MemorySlot &slot);
767 bool storesTo(const ::mlir::MemorySlot &slot);
768 ::mlir::Value getStored(const ::mlir::MemorySlot &slot, ::mlir::OpBuilder &builder, ::mlir::Value reachingDef, const ::mlir::DataLayout &dataLayout);
769 bool canUsesBeRemoved(const ::mlir::MemorySlot &slot, const ::llvm::SmallPtrSetImpl<::mlir::OpOperand *> &blockingUses, ::llvm::SmallVectorImpl<::mlir::OpOperand *> &newBlockingUses, const ::mlir::DataLayout &datalayout);
770 ::mlir::DeletionKind removeBlockingUses(const ::mlir::MemorySlot &slot, const ::llvm::SmallPtrSetImpl<mlir::OpOperand *> &blockingUses, ::mlir::OpBuilder &builder, ::mlir::Value reachingDefinition, const ::mlir::DataLayout &dataLayout);
771 bool isRead();
772 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
773 void print(::mlir::OpAsmPrinter &_odsPrinter);
774private:
775 ::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
776 return getAttributeNameForIndex((*this)->getName(), index);
777 }
778
779 static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
780 assert(index < 1 && "invalid attribute index");
781 assert(name.getStringRef() == getOperationName() && "invalid operation name");
782 assert(name.isRegistered() && "Operation isn't registered, missing a "
783 "dependent dialect loading?");
784 return name.getAttributeNames()[index];
785 }
786
787public:
789 inline ::llzk::pod::PodType getPodRefType() {
790 return ::llvm::cast<PodAccessOpInterface>(getOperation()).getPodRefType();
791 }
792};
793} // namespace pod
794} // namespace llzk
795MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::pod::WritePodOp)
796
797
798#endif // GET_OP_CLASSES
799
::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:419
::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:456
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:180
::llvm::SmallVector<::mlir::DestructurableMemorySlot > getDestructurableSlots()
Required by DestructurableAllocationOpInterface / SROA pass.
Definition Ops.cpp:93
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:152
::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:161
::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:88
::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:290
::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:105
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:143
::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:321
::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:177
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:226
ReadPodOpAdaptor(ReadPodOp op)
Definition Ops.cpp.inc:550
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:552
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:723
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:584
::llvm::StringRef getRecordName()
Definition Ops.cpp.inc:643
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:618
::mlir::TypedValue<::mlir::Type > getResult()
Definition Ops.h.inc:499
::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:847
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:861
ReadPodOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:450
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:470
::mlir::FlatSymbolRefAttr getRecordNameAttr()
Definition Ops.h.inc:512
bool storesTo(const ::mlir::MemorySlot &slot)
Required by PromotableMemOpInterface / mem2reg pass.
Definition Ops.cpp.inc:836
bool isRead()
Return true if the op is a read, false if it's a write.
Definition Ops.cpp.inc:869
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:696
inline ::llzk::pod::PodType getPodRefType()
Gets the type of the referenced pod.
Definition Ops.h.inc:555
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:638
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:729
::llvm::LogicalResult verify()
Definition Ops.cpp:501
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:841
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:561
::mlir::TypedValue<::llzk::pod::PodType > getPodRef()
Definition Ops.h.inc:480
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:784
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:600
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:611
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:466
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:605
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:493
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
Definition Ops.h.inc:453
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:631
::mlir::OpOperand & getPodRefMutable()
Definition Ops.h.inc:484
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value pod_ref, ::mlir::FlatSymbolRefAttr record_name)
Definition Ops.cpp.inc:652
::mlir::StringAttr getRecordNameAttrName()
Definition Ops.h.inc:458
bool loadsFrom(const ::mlir::MemorySlot &slot)
Required by PromotableMemOpInterface / mem2reg pass.
Definition Ops.cpp.inc:831
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:814
::mlir::StringAttr getRecordNameAttrName(::mlir::OperationName name)
Definition Ops.h.inc:462
void setRecordNameAttr(::mlir::FlatSymbolRefAttr attr)
Definition Ops.h.inc:517
void setRecordName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:648
ReadPodOpAdaptor Adaptor
Definition Ops.h.inc:448
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:622
::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:823
WritePodOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:630
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:894
WritePodOpAdaptor(WritePodOp op)
Definition Ops.cpp.inc:892
WritePodOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:630
RangeT getODSOperands(unsigned index)
Definition Ops.h.inc:645
WritePodOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:632
WritePodOpGenericAdaptor(RangeT values, const WritePodOpGenericAdaptorBase &base)
Definition Ops.h.inc:636
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:641
WritePodOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr)
Definition Ops.h.inc:634
WritePodOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:639
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:1201
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:731
inline ::llzk::pod::PodType getPodRefType()
Gets the type of the referenced pod.
Definition Ops.h.inc:789
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
Definition Ops.h.inc:682
::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:1195
::mlir::FlatSymbolRefAttr getRecordNameAttr()
Definition Ops.h.inc:746
::llvm::LogicalResult verify()
Definition Ops.cpp:525
void setRecordNameAttr(::mlir::FlatSymbolRefAttr attr)
Definition Ops.h.inc:751
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:942
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1135
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:973
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1064
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.h.inc:727
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:695
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1070
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:964
::mlir::TypedValue<::mlir::Type > getValue()
Definition Ops.h.inc:713
::mlir::StringAttr getRecordNameAttrName(::mlir::OperationName name)
Definition Ops.h.inc:691
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:680
::mlir::OpOperand & getPodRefMutable()
Definition Ops.h.inc:717
void setRecordName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:990
WritePodOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:679
::mlir::TypedValue<::llzk::pod::PodType > getPodRef()
Definition Ops.h.inc:709
FoldAdaptor::Properties Properties
Definition Ops.h.inc:681
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:947
::mlir::OpOperand & getValueMutable()
Definition Ops.h.inc:722
::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:1177
bool isRead()
Return true if the op is a read, false if it's a write.
Definition Ops.cpp.inc:1223
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:1168
::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:1215
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:703
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1040
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:980
WritePodOpAdaptor Adaptor
Definition Ops.h.inc:677
bool storesTo(const ::mlir::MemorySlot &slot)
Required by PromotableMemOpInterface / mem2reg pass.
Definition Ops.cpp.inc:1190
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:699
::llvm::StringRef getRecordName()
Definition Ops.cpp.inc:985
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:960
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:903
bool loadsFrom(const ::mlir::MemorySlot &slot)
Required by PromotableMemOpInterface / mem2reg pass.
Definition Ops.cpp.inc:1185
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:953
::mlir::StringAttr getRecordNameAttrName()
Definition Ops.h.inc:687
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value pod_ref, ::mlir::FlatSymbolRefAttr record_name, ::mlir::Value value)
Definition Ops.cpp.inc:994
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:926
::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
::mlir::FlatSymbolRefAttr getRecordNameAttr()
Definition Ops.h.inc:392
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
::mlir::FlatSymbolRefAttr getRecordNameAttr()
Definition Ops.h.inc:617
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.h.inc:605
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:595
WritePodOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:599
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::FlatSymbolRefAttr &propValue)
Definition Ops.h.inc:356
void setRecordName(const ::mlir::FlatSymbolRefAttr &propValue)
Definition Ops.h.inc:581