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};template <typename ConcreteOp>
44
45} // namespace detail
46class ArrayRefOpInterface : public ::mlir::OpInterface<ArrayRefOpInterface, detail::ArrayRefOpInterfaceInterfaceTraits> {
47public:
48 using ::mlir::OpInterface<ArrayRefOpInterface, detail::ArrayRefOpInterfaceInterfaceTraits>::OpInterface;
49 template <typename ConcreteOp>
50 struct Trait : public detail::ArrayRefOpInterfaceTrait<ConcreteOp> {};
52 ::mlir::TypedValue<::llzk::array::ArrayType> getArrRef();
54 ::mlir::OpOperand &getArrRefMutable();
55
57 inline ::llzk::array::ArrayType getArrRefType() { return getArrRef().getType(); }
58};
59namespace detail {
60 template <typename ConcreteOp>
61 struct ArrayRefOpInterfaceTrait : public ::mlir::OpInterface<ArrayRefOpInterface, detail::ArrayRefOpInterfaceInterfaceTraits>::Trait<ConcreteOp> {
62 };
63}// namespace detail
64} // namespace array
65} // namespace llzk
66namespace llzk {
67namespace array {
68class ArrayAccessOpInterface;
69namespace detail {
71 struct Concept {
73 ::mlir::Operation::operand_range (*getIndices)(const Concept *impl, ::mlir::Operation *);
74 ::mlir::MutableOperandRange (*getIndicesMutable)(const Concept *impl, ::mlir::Operation *);
75 bool (*isRead)(const Concept *impl, ::mlir::Operation *);
77 const ::llzk::array::ArrayRefOpInterface::Concept *implArrayRefOpInterface = nullptr;
78
79 void initializeInterfaceConcept(::mlir::detail::InterfaceMap &interfaceMap) {
81 assert(implArrayRefOpInterface && "`::llzk::array::ArrayAccessOpInterface` expected its base interface `::llzk::array::ArrayRefOpInterface` to be registered");
82 }
83 };
84 template<typename ConcreteOp>
85 class Model : public Concept {
86 public:
89
90 static inline ::mlir::Operation::operand_range getIndices(const Concept *impl, ::mlir::Operation *tablegen_opaque_val);
91 static inline ::mlir::MutableOperandRange getIndicesMutable(const Concept *impl, ::mlir::Operation *tablegen_opaque_val);
92 static inline bool isRead(const Concept *impl, ::mlir::Operation *tablegen_opaque_val);
93 };
94 template<typename ConcreteOp>
95 class FallbackModel : public Concept {
96 public:
99
100 static inline ::mlir::Operation::operand_range getIndices(const Concept *impl, ::mlir::Operation *tablegen_opaque_val);
101 static inline ::mlir::MutableOperandRange getIndicesMutable(const Concept *impl, ::mlir::Operation *tablegen_opaque_val);
102 static inline bool isRead(const Concept *impl, ::mlir::Operation *tablegen_opaque_val);
103 };
104 template<typename ConcreteModel, typename ConcreteOp>
105 class ExternalModel : public FallbackModel<ConcreteModel> {
106 public:
107 using ConcreteEntity = ConcreteOp;
108 };
109};template <typename ConcreteOp>
111
112} // namespace detail
113class ArrayAccessOpInterface : public ::mlir::OpInterface<ArrayAccessOpInterface, detail::ArrayAccessOpInterfaceInterfaceTraits> {
114public:
115 using ::mlir::OpInterface<ArrayAccessOpInterface, detail::ArrayAccessOpInterfaceInterfaceTraits>::OpInterface;
116 template <typename ConcreteOp>
117 struct Trait : public detail::ArrayAccessOpInterfaceTrait<ConcreteOp> {};
119 ::mlir::Operation::operand_range getIndices();
121 ::mlir::MutableOperandRange getIndicesMutable();
123 bool isRead();
124
128 inline ::mlir::ArrayRef<::mlir::Attribute> getValueOperandDims() {
129 return getArrRefType().getDimensionSizes().drop_front(getIndices().size());
130 }
131
134 ::mlir::ArrayAttr indexOperandsToAttributeArray();
135
137 bool canRewire(const ::mlir::DestructurableMemorySlot &slot,
138 ::llvm::SmallPtrSetImpl<::mlir::Attribute> &usedIndices,
139 ::mlir::SmallVectorImpl<::mlir::MemorySlot> &mustBeSafelyUsed);
140
142 ::mlir::DeletionKind rewire(const ::mlir::DestructurableMemorySlot &slot,
143 ::llvm::DenseMap<::mlir::Attribute, ::mlir::MemorySlot> &subslots,
144 ::mlir::RewriterBase &rewriter);
145 //===----------------------------------------------------------------===//
146 // Inherited from ::llzk::array::ArrayRefOpInterface
147 //===----------------------------------------------------------------===//
148
149 operator ::llzk::array::ArrayRefOpInterface () const {
150 if (!*this) return nullptr;
151 return ::llzk::array::ArrayRefOpInterface(*this, getImpl()->implArrayRefOpInterface);
152 }
153
155 ::mlir::TypedValue<::llzk::array::ArrayType> getArrRef();
157 ::mlir::OpOperand &getArrRefMutable();
158
160 inline ::llzk::array::ArrayType getArrRefType() { return getArrRef().getType(); }
161};
162namespace detail {
163 template <typename ConcreteOp>
164 struct ArrayAccessOpInterfaceTrait : public ::mlir::OpInterface<ArrayAccessOpInterface, detail::ArrayAccessOpInterfaceInterfaceTraits>::Trait<ConcreteOp> {
165 };
166}// namespace detail
167} // namespace array
168} // namespace llzk
169namespace llzk {
170namespace array {
171template<typename ConcreteOp>
172::mlir::TypedValue<::llzk::array::ArrayType> detail::ArrayRefOpInterfaceInterfaceTraits::Model<ConcreteOp>::getArrRef(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) {
173 return (llvm::cast<ConcreteOp>(tablegen_opaque_val)).getArrRef();
174}
175template<typename ConcreteOp>
176::mlir::OpOperand &detail::ArrayRefOpInterfaceInterfaceTraits::Model<ConcreteOp>::getArrRefMutable(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) {
177 return (llvm::cast<ConcreteOp>(tablegen_opaque_val)).getArrRefMutable();
178}
179template<typename ConcreteOp>
180::mlir::TypedValue<::llzk::array::ArrayType> detail::ArrayRefOpInterfaceInterfaceTraits::FallbackModel<ConcreteOp>::getArrRef(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) {
181 return static_cast<const ConcreteOp *>(impl)->getArrRef(tablegen_opaque_val);
182}
183template<typename ConcreteOp>
184::mlir::OpOperand &detail::ArrayRefOpInterfaceInterfaceTraits::FallbackModel<ConcreteOp>::getArrRefMutable(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) {
185 return static_cast<const ConcreteOp *>(impl)->getArrRefMutable(tablegen_opaque_val);
186}
187} // namespace array
188} // namespace llzk
189namespace llzk {
190namespace array {
191template<typename ConcreteOp>
192::mlir::Operation::operand_range detail::ArrayAccessOpInterfaceInterfaceTraits::Model<ConcreteOp>::getIndices(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) {
193 return (llvm::cast<ConcreteOp>(tablegen_opaque_val)).getIndices();
194}
195template<typename ConcreteOp>
196::mlir::MutableOperandRange detail::ArrayAccessOpInterfaceInterfaceTraits::Model<ConcreteOp>::getIndicesMutable(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) {
197 return (llvm::cast<ConcreteOp>(tablegen_opaque_val)).getIndicesMutable();
198}
199template<typename ConcreteOp>
201 return (llvm::cast<ConcreteOp>(tablegen_opaque_val)).isRead();
202}
203template<typename ConcreteOp>
204::mlir::Operation::operand_range detail::ArrayAccessOpInterfaceInterfaceTraits::FallbackModel<ConcreteOp>::getIndices(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) {
205 return static_cast<const ConcreteOp *>(impl)->getIndices(tablegen_opaque_val);
206}
207template<typename ConcreteOp>
208::mlir::MutableOperandRange detail::ArrayAccessOpInterfaceInterfaceTraits::FallbackModel<ConcreteOp>::getIndicesMutable(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) {
209 return static_cast<const ConcreteOp *>(impl)->getIndicesMutable(tablegen_opaque_val);
210}
211template<typename ConcreteOp>
213 return static_cast<const ConcreteOp *>(impl)->isRead(tablegen_opaque_val);
214}
215} // namespace array
216} // namespace llzk
::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.
bool canRewire(const ::mlir::DestructurableMemorySlot &slot, ::llvm::SmallPtrSetImpl<::mlir::Attribute > &usedIndices, ::mlir::SmallVectorImpl<::mlir::MemorySlot > &mustBeSafelyUsed)
Required by companion interface DestructurableAccessorOpInterface / SROA pass.
Definition Ops.cpp:218
::mlir::DeletionKind rewire(const ::mlir::DestructurableMemorySlot &slot, ::llvm::DenseMap<::mlir::Attribute, ::mlir::MemorySlot > &subslots, ::mlir::RewriterBase &rewriter)
Required by companion interface DestructurableAccessorOpInterface / SROA pass.
Definition Ops.cpp:242
::mlir::ArrayAttr indexOperandsToAttributeArray()
Returns the multi-dimensional indices of the array access as an Attribute array or a null pointer if ...
Definition Ops.cpp:207
::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.
::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 *)