LLZK 3.0.0
An open-source IR for Zero Knowledge (ZK) circuits
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
150 static ::llvm::SmallVector<::mlir::Value>
151 genIndexConstants(::mlir::OpBuilder &bldr, ::mlir::Location loc, ::mlir::ArrayAttr index);
152
154 static ::mlir::Value
155 genRead(::mlir::OpBuilder &bldr, ::mlir::Location loc, ::mlir::Value arrayRef,
156 ::mlir::ValueRange indices);
157
159 static ::mlir::Value
160 genRead(::mlir::OpBuilder &bldr, ::mlir::Location loc, ::mlir::Value arrayRef,
161 ::mlir::ArrayAttr index);
162
164 static void genWrite(::mlir::OpBuilder &bldr, ::mlir::Location loc, ::mlir::Value arrayRef,
165 ::mlir::ValueRange indices, ::mlir::Value value);
166
168 static void genWrite(::mlir::OpBuilder &bldr, ::mlir::Location loc, ::mlir::Value arrayRef,
169 ::mlir::ArrayAttr index, ::mlir::Value value);
170 //===----------------------------------------------------------------===//
171 // Inherited from ::llzk::array::ArrayRefOpInterface
172 //===----------------------------------------------------------------===//
173
174 operator ::llzk::array::ArrayRefOpInterface () const {
175 if (!*this) return nullptr;
176 return ::llzk::array::ArrayRefOpInterface(*this, getImpl()->implArrayRefOpInterface);
177 }
178
180 ::mlir::TypedValue<::llzk::array::ArrayType> getArrRef();
182 ::mlir::OpOperand &getArrRefMutable();
183
185 inline ::llzk::array::ArrayType getArrRefType() { return getArrRef().getType(); }
186};
187namespace detail {
188 template <typename ConcreteOp>
189 struct ArrayAccessOpInterfaceTrait : public ::mlir::OpInterface<ArrayAccessOpInterface, detail::ArrayAccessOpInterfaceInterfaceTraits>::Trait<ConcreteOp> {
190 };
191}// namespace detail
192} // namespace array
193} // namespace llzk
194namespace llzk {
195namespace array {
196template<typename ConcreteOp>
197::mlir::TypedValue<::llzk::array::ArrayType> detail::ArrayRefOpInterfaceInterfaceTraits::Model<ConcreteOp>::getArrRef(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) {
198 return (llvm::cast<ConcreteOp>(tablegen_opaque_val)).getArrRef();
199}
200template<typename ConcreteOp>
201::mlir::OpOperand &detail::ArrayRefOpInterfaceInterfaceTraits::Model<ConcreteOp>::getArrRefMutable(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) {
202 return (llvm::cast<ConcreteOp>(tablegen_opaque_val)).getArrRefMutable();
203}
204template<typename ConcreteOp>
205::mlir::TypedValue<::llzk::array::ArrayType> detail::ArrayRefOpInterfaceInterfaceTraits::FallbackModel<ConcreteOp>::getArrRef(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) {
206 return static_cast<const ConcreteOp *>(impl)->getArrRef(tablegen_opaque_val);
207}
208template<typename ConcreteOp>
209::mlir::OpOperand &detail::ArrayRefOpInterfaceInterfaceTraits::FallbackModel<ConcreteOp>::getArrRefMutable(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) {
210 return static_cast<const ConcreteOp *>(impl)->getArrRefMutable(tablegen_opaque_val);
211}
212} // namespace array
213} // namespace llzk
214namespace llzk {
215namespace array {
216template<typename ConcreteOp>
217::mlir::Operation::operand_range detail::ArrayAccessOpInterfaceInterfaceTraits::Model<ConcreteOp>::getIndices(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) {
218 return (llvm::cast<ConcreteOp>(tablegen_opaque_val)).getIndices();
219}
220template<typename ConcreteOp>
221::mlir::MutableOperandRange detail::ArrayAccessOpInterfaceInterfaceTraits::Model<ConcreteOp>::getIndicesMutable(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) {
222 return (llvm::cast<ConcreteOp>(tablegen_opaque_val)).getIndicesMutable();
223}
224template<typename ConcreteOp>
226 return (llvm::cast<ConcreteOp>(tablegen_opaque_val)).isRead();
227}
228template<typename ConcreteOp>
229::mlir::Operation::operand_range detail::ArrayAccessOpInterfaceInterfaceTraits::FallbackModel<ConcreteOp>::getIndices(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) {
230 return static_cast<const ConcreteOp *>(impl)->getIndices(tablegen_opaque_val);
231}
232template<typename ConcreteOp>
233::mlir::MutableOperandRange detail::ArrayAccessOpInterfaceInterfaceTraits::FallbackModel<ConcreteOp>::getIndicesMutable(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) {
234 return static_cast<const ConcreteOp *>(impl)->getIndicesMutable(tablegen_opaque_val);
235}
236template<typename ConcreteOp>
238 return static_cast<const ConcreteOp *>(impl)->isRead(tablegen_opaque_val);
239}
240} // namespace array
241} // 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:304
static void genWrite(::mlir::OpBuilder &bldr, ::mlir::Location loc, ::mlir::Value arrayRef, ::mlir::ValueRange indices, ::mlir::Value value)
Create an array.write or array.insert for one concrete element or subarray.
::mlir::Operation::operand_range getIndices()
Gets the operand range containing the index for each dimension.
::mlir::Value genRead(::mlir::OpBuilder &bldr, ::mlir::Location loc, ::mlir::Value arrayRef, ::mlir::ArrayAttr index)
Create an array.read or array.extract for one concrete element or subarray.
::mlir::OpOperand & getArrRefMutable()
Gets the mutable operand slot holding the SSA Value for the referenced array.
::mlir::Value genRead(::mlir::OpBuilder &bldr, ::mlir::Location loc, ::mlir::Value arrayRef, ::mlir::ValueRange indices)
Create an array.read or array.extract for one concrete element or subarray.
bool isRead()
Return true if the op is a read, false if it's a write.
static void genWrite(::mlir::OpBuilder &bldr, ::mlir::Location loc, ::mlir::Value arrayRef, ::mlir::ArrayAttr index, ::mlir::Value value)
Create an array.write or array.insert for one concrete element or subarray.
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:216
static ::llvm::SmallVector<::mlir::Value > genIndexConstants(::mlir::OpBuilder &bldr, ::mlir::Location loc, ::mlir::ArrayAttr index)
Generate arith.constant indices for one static array element position.
Definition Ops.cpp:228
::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:280
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 *)