LLZK 0.1.0
Veridise's ZK Language IR
Loading...
Searching...
No Matches
OpInterfaces.h.inc
Go to the documentation of this file.
1/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2|* *|
3|* Interface Declarations *|
4|* *|
5|* Automatically generated file, do not edit! *|
6|* *|
7\*===----------------------------------------------------------------------===*/
8
9namespace llzk {
10namespace array {
12namespace detail {
14 struct Concept {
16 ::mlir::TypedValue<::llzk::array::ArrayType> (*getArrRef)(const Concept *impl, ::mlir::Operation *);
17 ::mlir::OpOperand &(*getArrRefMutable)(const Concept *impl, ::mlir::Operation *);
18 };
19 template<typename ConcreteOp>
20 class Model : public Concept {
21 public:
24
25 static inline ::mlir::TypedValue<::llzk::array::ArrayType> getArrRef(const Concept *impl, ::mlir::Operation *tablegen_opaque_val);
26 static inline ::mlir::OpOperand &getArrRefMutable(const Concept *impl, ::mlir::Operation *tablegen_opaque_val);
27 };
28 template<typename ConcreteOp>
29 class FallbackModel : public Concept {
30 public:
33
34 static inline ::mlir::TypedValue<::llzk::array::ArrayType> getArrRef(const Concept *impl, ::mlir::Operation *tablegen_opaque_val);
35 static inline ::mlir::OpOperand &getArrRefMutable(const Concept *impl, ::mlir::Operation *tablegen_opaque_val);
36 };
37 template<typename ConcreteModel, typename ConcreteOp>
38 class ExternalModel : public FallbackModel<ConcreteModel> {
39 public:
40 using ConcreteEntity = ConcreteOp;
41 };
42};
43template <typename ConcreteOp>
45
46} // namespace detail
47class ArrayRefOpInterface : public ::mlir::OpInterface<ArrayRefOpInterface, detail::ArrayRefOpInterfaceInterfaceTraits> {
48public:
49 using ::mlir::OpInterface<ArrayRefOpInterface, detail::ArrayRefOpInterfaceInterfaceTraits>::OpInterface;
50 template <typename ConcreteOp>
51 struct Trait : public detail::ArrayRefOpInterfaceTrait<ConcreteOp> {};
53 ::mlir::TypedValue<::llzk::array::ArrayType> getArrRef();
55 ::mlir::OpOperand &getArrRefMutable();
56
58 inline ::llzk::array::ArrayType getArrRefType() { return getArrRef().getType(); }
59};
60namespace detail {
61 template <typename ConcreteOp>
62 struct ArrayRefOpInterfaceTrait : public ::mlir::OpInterface<ArrayRefOpInterface, detail::ArrayRefOpInterfaceInterfaceTraits>::Trait<ConcreteOp> {
63 };
64}// namespace detail
65} // namespace array
66} // namespace llzk
67namespace llzk {
68namespace array {
69class ArrayAccessOpInterface;
70namespace detail {
72 struct Concept {
74 ::mlir::Operation::operand_range (*getIndices)(const Concept *impl, ::mlir::Operation *);
75 ::mlir::MutableOperandRange (*getIndicesMutable)(const Concept *impl, ::mlir::Operation *);
76 bool (*isRead)(const Concept *impl, ::mlir::Operation *);
78 const ::llzk::array::ArrayRefOpInterface::Concept *implArrayRefOpInterface = nullptr;
79
80 void initializeInterfaceConcept(::mlir::detail::InterfaceMap &interfaceMap) {
82 assert(implArrayRefOpInterface && "`::llzk::array::ArrayAccessOpInterface` expected its base interface `::llzk::array::ArrayRefOpInterface` to be registered");
83 }
84 };
85 template<typename ConcreteOp>
86 class Model : public Concept {
87 public:
90
91 static inline ::mlir::Operation::operand_range getIndices(const Concept *impl, ::mlir::Operation *tablegen_opaque_val);
92 static inline ::mlir::MutableOperandRange getIndicesMutable(const Concept *impl, ::mlir::Operation *tablegen_opaque_val);
93 static inline bool isRead(const Concept *impl, ::mlir::Operation *tablegen_opaque_val);
94 };
95 template<typename ConcreteOp>
96 class FallbackModel : public Concept {
97 public:
100
101 static inline ::mlir::Operation::operand_range getIndices(const Concept *impl, ::mlir::Operation *tablegen_opaque_val);
102 static inline ::mlir::MutableOperandRange getIndicesMutable(const Concept *impl, ::mlir::Operation *tablegen_opaque_val);
103 static inline bool isRead(const Concept *impl, ::mlir::Operation *tablegen_opaque_val);
104 };
105 template<typename ConcreteModel, typename ConcreteOp>
106 class ExternalModel : public FallbackModel<ConcreteModel> {
107 public:
108 using ConcreteEntity = ConcreteOp;
109 };
110};
111template <typename ConcreteOp>
113
114} // namespace detail
115class ArrayAccessOpInterface : public ::mlir::OpInterface<ArrayAccessOpInterface, detail::ArrayAccessOpInterfaceInterfaceTraits> {
116public:
117 using ::mlir::OpInterface<ArrayAccessOpInterface, detail::ArrayAccessOpInterfaceInterfaceTraits>::OpInterface;
118 template <typename ConcreteOp>
119 struct Trait : public detail::ArrayAccessOpInterfaceTrait<ConcreteOp> {};
121 ::mlir::Operation::operand_range getIndices();
123 ::mlir::MutableOperandRange getIndicesMutable();
125 bool isRead();
126
130 inline ::mlir::ArrayRef<::mlir::Attribute> getValueOperandDims() {
131 return getArrRefType().getDimensionSizes().drop_front(getIndices().size());
132 }
133
136 ::mlir::ArrayAttr indexOperandsToAttributeArray();
137
139 bool canRewire(const ::mlir::DestructurableMemorySlot &slot,
140 ::llvm::SmallPtrSetImpl<::mlir::Attribute> &usedIndices,
141 ::mlir::SmallVectorImpl<::mlir::MemorySlot> &mustBeSafelyUsed,
142 const ::mlir::DataLayout &dataLayout);
143
145 ::mlir::DeletionKind rewire(const ::mlir::DestructurableMemorySlot &slot,
146 ::llvm::DenseMap<::mlir::Attribute, ::mlir::MemorySlot> &subslots,
147 ::mlir::OpBuilder &builder, const ::mlir::DataLayout &dataLayout);
148 //===----------------------------------------------------------------===//
149 // Inherited from ::llzk::array::ArrayRefOpInterface
150 //===----------------------------------------------------------------===//
151
152 operator ::llzk::array::ArrayRefOpInterface () const {
153 if (!*this) return nullptr;
154 return ::llzk::array::ArrayRefOpInterface(*this, getImpl()->implArrayRefOpInterface);
155 }
156
158 ::mlir::TypedValue<::llzk::array::ArrayType> getArrRef();
160 ::mlir::OpOperand &getArrRefMutable();
161
163 inline ::llzk::array::ArrayType getArrRefType() { return getArrRef().getType(); }
164};
165namespace detail {
166 template <typename ConcreteOp>
167 struct ArrayAccessOpInterfaceTrait : public ::mlir::OpInterface<ArrayAccessOpInterface, detail::ArrayAccessOpInterfaceInterfaceTraits>::Trait<ConcreteOp> {
168 };
169}// namespace detail
170} // namespace array
171} // namespace llzk
172namespace llzk {
173namespace array {
174template<typename ConcreteOp>
175::mlir::TypedValue<::llzk::array::ArrayType> detail::ArrayRefOpInterfaceInterfaceTraits::Model<ConcreteOp>::getArrRef(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) {
176 return (llvm::cast<ConcreteOp>(tablegen_opaque_val)).getArrRef();
177}
178template<typename ConcreteOp>
179::mlir::OpOperand &detail::ArrayRefOpInterfaceInterfaceTraits::Model<ConcreteOp>::getArrRefMutable(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) {
180 return (llvm::cast<ConcreteOp>(tablegen_opaque_val)).getArrRefMutable();
181}
182template<typename ConcreteOp>
183::mlir::TypedValue<::llzk::array::ArrayType> detail::ArrayRefOpInterfaceInterfaceTraits::FallbackModel<ConcreteOp>::getArrRef(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) {
184 return static_cast<const ConcreteOp *>(impl)->getArrRef(tablegen_opaque_val);
185}
186template<typename ConcreteOp>
187::mlir::OpOperand &detail::ArrayRefOpInterfaceInterfaceTraits::FallbackModel<ConcreteOp>::getArrRefMutable(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) {
188 return static_cast<const ConcreteOp *>(impl)->getArrRefMutable(tablegen_opaque_val);
189}
190} // namespace array
191} // namespace llzk
192namespace llzk {
193namespace array {
194template<typename ConcreteOp>
195::mlir::Operation::operand_range detail::ArrayAccessOpInterfaceInterfaceTraits::Model<ConcreteOp>::getIndices(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) {
196 return (llvm::cast<ConcreteOp>(tablegen_opaque_val)).getIndices();
197}
198template<typename ConcreteOp>
199::mlir::MutableOperandRange detail::ArrayAccessOpInterfaceInterfaceTraits::Model<ConcreteOp>::getIndicesMutable(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) {
200 return (llvm::cast<ConcreteOp>(tablegen_opaque_val)).getIndicesMutable();
201}
202template<typename ConcreteOp>
204 return (llvm::cast<ConcreteOp>(tablegen_opaque_val)).isRead();
205}
206template<typename ConcreteOp>
207::mlir::Operation::operand_range detail::ArrayAccessOpInterfaceInterfaceTraits::FallbackModel<ConcreteOp>::getIndices(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) {
208 return static_cast<const ConcreteOp *>(impl)->getIndices(tablegen_opaque_val);
209}
210template<typename ConcreteOp>
211::mlir::MutableOperandRange detail::ArrayAccessOpInterfaceInterfaceTraits::FallbackModel<ConcreteOp>::getIndicesMutable(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) {
212 return static_cast<const ConcreteOp *>(impl)->getIndicesMutable(tablegen_opaque_val);
213}
214template<typename ConcreteOp>
216 return static_cast<const ConcreteOp *>(impl)->isRead(tablegen_opaque_val);
217}
218} // namespace array
219} // namespace llzk
::mlir::DeletionKind rewire(const ::mlir::DestructurableMemorySlot &slot, ::llvm::DenseMap<::mlir::Attribute, ::mlir::MemorySlot > &subslots, ::mlir::OpBuilder &builder, const ::mlir::DataLayout &dataLayout)
Required by companion interface DestructurableAccessorOpInterface / SROA pass.
Definition Ops.cpp:246
::mlir::Operation::operand_range getIndices()
Gets the operand range containing the index for each dimension.
::mlir::OpOperand & getArrRefMutable()
Gets the mutable operand slot holding the SSA Value for the referenced array.
bool isRead()
Return true if the op is a read, false if it's a write.
inline ::mlir::ArrayRef<::mlir::Attribute > getValueOperandDims()
Compute the dimensions of the read/write value.
::mlir::ArrayAttr indexOperandsToAttributeArray()
Returns the multi-dimensional indices of the array access as an Attribute array or a null pointer if ...
Definition Ops.cpp:211
::mlir::TypedValue<::llzk::array::ArrayType > getArrRef()
Gets the SSA Value for the referenced array.
bool canRewire(const ::mlir::DestructurableMemorySlot &slot, ::llvm::SmallPtrSetImpl<::mlir::Attribute > &usedIndices, ::mlir::SmallVectorImpl<::mlir::MemorySlot > &mustBeSafelyUsed, const ::mlir::DataLayout &dataLayout)
Required by companion interface DestructurableAccessorOpInterface / SROA pass.
Definition Ops.cpp:222
inline ::llzk::array::ArrayType getArrRefType()
Gets the type of the referenced array.
::mlir::MutableOperandRange getIndicesMutable()
Gets the mutable operand range containing the index for each dimension.
::mlir::OpOperand & getArrRefMutable()
Gets the mutable operand slot holding the SSA Value for the referenced array.
::mlir::TypedValue<::llzk::array::ArrayType > getArrRef()
Gets the SSA Value for the referenced array.
inline ::llzk::array::ArrayType getArrRefType()
Gets the type of the referenced array.
::llvm::ArrayRef<::mlir::Attribute > getDimensionSizes() const
static bool isRead(const Concept *impl, ::mlir::Operation *tablegen_opaque_val)
static inline ::mlir::MutableOperandRange getIndicesMutable(const Concept *impl, ::mlir::Operation *tablegen_opaque_val)
static inline ::mlir::Operation::operand_range getIndices(const Concept *impl, ::mlir::Operation *tablegen_opaque_val)
static inline ::mlir::MutableOperandRange getIndicesMutable(const Concept *impl, ::mlir::Operation *tablegen_opaque_val)
static inline ::mlir::Operation::operand_range getIndices(const Concept *impl, ::mlir::Operation *tablegen_opaque_val)
static bool isRead(const Concept *impl, ::mlir::Operation *tablegen_opaque_val)
static inline ::mlir::OpOperand & getArrRefMutable(const Concept *impl, ::mlir::Operation *tablegen_opaque_val)
static inline ::mlir::TypedValue<::llzk::array::ArrayType > getArrRef(const Concept *impl, ::mlir::Operation *tablegen_opaque_val)
static inline ::mlir::OpOperand & getArrRefMutable(const Concept *impl, ::mlir::Operation *tablegen_opaque_val)
static inline ::mlir::TypedValue<::llzk::array::ArrayType > getArrRef(const Concept *impl, ::mlir::Operation *tablegen_opaque_val)
void initializeInterfaceConcept(::mlir::detail::InterfaceMap &interfaceMap)
bool(* isRead)(const Concept *impl, ::mlir::Operation *)
::mlir::Operation::operand_range(* getIndices)(const Concept *impl, ::mlir::Operation *)
The methods defined by the interface.
::mlir::MutableOperandRange(* getIndicesMutable)(const Concept *impl, ::mlir::Operation *)
const ::llzk::array::ArrayRefOpInterface::Concept * implArrayRefOpInterface
The base classes of this interface.
::mlir::TypedValue<::llzk::array::ArrayType >(* getArrRef)(const Concept *impl, ::mlir::Operation *)
The methods defined by the interface.
::mlir::OpOperand &(* getArrRefMutable)(const Concept *impl, ::mlir::Operation *)