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::pod {
10
13
14} // namespace llzk::pod
15namespace llzk::pod {
16
19
20} // namespace llzk::pod
21namespace llzk::pod {
22
24namespace detail {
26 struct Concept {
28 ::mlir::TypedValue<::llzk::pod::PodType> (*getPodRef)(const Concept *impl, ::mlir::Operation *);
29 ::mlir::OpOperand &(*getPodRefMutable)(const Concept *impl, ::mlir::Operation *);
30 };
31 template<typename ConcreteOp>
32 class Model : public Concept {
33 public:
36
37 static inline ::mlir::TypedValue<::llzk::pod::PodType> getPodRef(const Concept *impl, ::mlir::Operation *tablegen_opaque_val);
38 static inline ::mlir::OpOperand &getPodRefMutable(const Concept *impl, ::mlir::Operation *tablegen_opaque_val);
39 };
40 template<typename ConcreteOp>
41 class FallbackModel : public Concept {
42 public:
45
46 static inline ::mlir::TypedValue<::llzk::pod::PodType> getPodRef(const Concept *impl, ::mlir::Operation *tablegen_opaque_val);
47 static inline ::mlir::OpOperand &getPodRefMutable(const Concept *impl, ::mlir::Operation *tablegen_opaque_val);
48 };
49 template<typename ConcreteModel, typename ConcreteOp>
50 class ExternalModel : public FallbackModel<ConcreteModel> {
51 public:
52 using ConcreteEntity = ConcreteOp;
53 };
54};
55template <typename ConcreteOp>
57
58} // namespace detail
59class PodRefOpInterface : public ::mlir::OpInterface<PodRefOpInterface, detail::PodRefOpInterfaceInterfaceTraits> {
60public:
61 using ::mlir::OpInterface<PodRefOpInterface, detail::PodRefOpInterfaceInterfaceTraits>::OpInterface;
62 template <typename ConcreteOp>
63 struct Trait : public detail::PodRefOpInterfaceTrait<ConcreteOp> {};
64
66 ::mlir::TypedValue<::llzk::pod::PodType> getPodRef();
67
69 ::mlir::OpOperand &getPodRefMutable();
70
72 inline ::llzk::pod::PodType getPodRefType() { return getPodRef().getType(); }
73};
74
75} // namespace llzk::pod
76namespace llzk::pod {
77
79namespace detail {
81 struct Concept {
83 ::mlir::StringAttr (*getRecordNameAttr)(const Concept *impl, ::mlir::Operation *);
84 bool (*isRead)(const Concept *impl, ::mlir::Operation *);
86 const ::llzk::pod::PodRefOpInterface::Concept *implPodRefOpInterface = nullptr;
87
88 void initializeInterfaceConcept(::mlir::detail::InterfaceMap &interfaceMap) {
90 assert(implPodRefOpInterface && "`::llzk::pod::PodAccessOpInterface` expected its base interface `::llzk::pod::PodRefOpInterface` to be registered");
91 }
92 };
93 template<typename ConcreteOp>
94 class Model : public Concept {
95 public:
98
99 static inline ::mlir::StringAttr getRecordNameAttr(const Concept *impl, ::mlir::Operation *tablegen_opaque_val);
100 static inline bool isRead(const Concept *impl, ::mlir::Operation *tablegen_opaque_val);
101 };
102 template<typename ConcreteOp>
103 class FallbackModel : public Concept {
104 public:
107
108 static inline ::mlir::StringAttr getRecordNameAttr(const Concept *impl, ::mlir::Operation *tablegen_opaque_val);
109 static inline bool isRead(const Concept *impl, ::mlir::Operation *tablegen_opaque_val);
110 };
111 template<typename ConcreteModel, typename ConcreteOp>
112 class ExternalModel : public FallbackModel<ConcreteModel> {
113 public:
114 using ConcreteEntity = ConcreteOp;
115 };
116};
117template <typename ConcreteOp>
119
120} // namespace detail
121class PodAccessOpInterface : public ::mlir::OpInterface<PodAccessOpInterface, detail::PodAccessOpInterfaceInterfaceTraits> {
122public:
123 using ::mlir::OpInterface<PodAccessOpInterface, detail::PodAccessOpInterfaceInterfaceTraits>::OpInterface;
124 template <typename ConcreteOp>
125 struct Trait : public detail::PodAccessOpInterfaceTrait<ConcreteOp> {};
126
128 ::mlir::StringAttr getRecordNameAttr();
129
131 bool isRead();
132
134 bool canRewire(const ::mlir::DestructurableMemorySlot &slot,
135 ::llvm::SmallPtrSetImpl<::mlir::Attribute> &usedIndices,
136 ::mlir::SmallVectorImpl<::mlir::MemorySlot> &mustBeSafelyUsed,
137 const ::mlir::DataLayout &dataLayout);
138
140 ::mlir::DeletionKind rewire(const ::mlir::DestructurableMemorySlot &slot,
141 ::llvm::DenseMap<::mlir::Attribute, ::mlir::MemorySlot> &subslots,
142 ::mlir::OpBuilder &builder, const ::mlir::DataLayout &dataLayout);
143 //===----------------------------------------------------------------===//
144 // Inherited from ::llzk::pod::PodRefOpInterface
145 //===----------------------------------------------------------------===//
146
147 operator ::llzk::pod::PodRefOpInterface () const {
148 if (!*this) return nullptr;
149 return ::llzk::pod::PodRefOpInterface(*this, getImpl()->implPodRefOpInterface);
150 }
151
152
154 ::mlir::TypedValue<::llzk::pod::PodType> getPodRef();
155
157 ::mlir::OpOperand &getPodRefMutable();
158
160 inline ::llzk::pod::PodType getPodRefType() { return getPodRef().getType(); }
161};
162
163} // namespace llzk::pod
164namespace llzk::pod::detail {
165
166 template <typename ConcreteOp>
167 struct PodRefOpInterfaceTrait : public ::mlir::OpInterface<PodRefOpInterface, detail::PodRefOpInterfaceInterfaceTraits>::Trait<ConcreteOp> {
168 };
169
170} // namespace llzk::pod::detail
171namespace llzk::pod::detail {
172
173 template <typename ConcreteOp>
174 struct PodAccessOpInterfaceTrait : public ::mlir::OpInterface<PodAccessOpInterface, detail::PodAccessOpInterfaceInterfaceTraits>::Trait<ConcreteOp> {
175 };
176
177} // namespace llzk::pod::detail
178namespace llzk::pod {
179
180template<typename ConcreteOp>
181::mlir::TypedValue<::llzk::pod::PodType> detail::PodRefOpInterfaceInterfaceTraits::Model<ConcreteOp>::getPodRef(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) {
182 return (llvm::cast<ConcreteOp>(tablegen_opaque_val)).getPodRef();
183}
184template<typename ConcreteOp>
185::mlir::OpOperand &detail::PodRefOpInterfaceInterfaceTraits::Model<ConcreteOp>::getPodRefMutable(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) {
186 return (llvm::cast<ConcreteOp>(tablegen_opaque_val)).getPodRefMutable();
187}
188template<typename ConcreteOp>
189::mlir::TypedValue<::llzk::pod::PodType> detail::PodRefOpInterfaceInterfaceTraits::FallbackModel<ConcreteOp>::getPodRef(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) {
190 return static_cast<const ConcreteOp *>(impl)->getPodRef(tablegen_opaque_val);
191}
192template<typename ConcreteOp>
193::mlir::OpOperand &detail::PodRefOpInterfaceInterfaceTraits::FallbackModel<ConcreteOp>::getPodRefMutable(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) {
194 return static_cast<const ConcreteOp *>(impl)->getPodRefMutable(tablegen_opaque_val);
195}
196
197} // namespace llzk::pod
198namespace llzk::pod {
199
200template<typename ConcreteOp>
201::mlir::StringAttr detail::PodAccessOpInterfaceInterfaceTraits::Model<ConcreteOp>::getRecordNameAttr(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) {
202 return (llvm::cast<ConcreteOp>(tablegen_opaque_val)).getRecordNameAttr();
203}
204template<typename ConcreteOp>
205bool detail::PodAccessOpInterfaceInterfaceTraits::Model<ConcreteOp>::isRead(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) {
206 return (llvm::cast<ConcreteOp>(tablegen_opaque_val)).isRead();
207}
208template<typename ConcreteOp>
209::mlir::StringAttr detail::PodAccessOpInterfaceInterfaceTraits::FallbackModel<ConcreteOp>::getRecordNameAttr(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) {
210 return static_cast<const ConcreteOp *>(impl)->getRecordNameAttr(tablegen_opaque_val);
211}
212template<typename ConcreteOp>
214 return static_cast<const ConcreteOp *>(impl)->isRead(tablegen_opaque_val);
215}
216
217} // namespace llzk::pod
::mlir::OpOperand & getPodRefMutable()
Gets the mutable operand slot holding the SSA Value for the referenced pod.
::mlir::TypedValue<::llzk::pod::PodType > getPodRef()
Gets the SSA Value for the referenced pod.
inline ::llzk::pod::PodType getPodRefType()
Gets the type of the referenced pod.
::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:567
::mlir::StringAttr getRecordNameAttr()
Gets the record name attribute from the pod access op.
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:549
bool isRead()
Return true if the op is a read, false if it's a write.
inline ::llzk::pod::PodType getPodRefType()
Gets the type of the referenced pod.
::mlir::OpOperand & getPodRefMutable()
Gets the mutable operand slot holding the SSA Value for the referenced pod.
::mlir::TypedValue<::llzk::pod::PodType > getPodRef()
Gets the SSA Value for the referenced pod.
static inline ::mlir::StringAttr getRecordNameAttr(const Concept *impl, ::mlir::Operation *tablegen_opaque_val)
static bool isRead(const Concept *impl, ::mlir::Operation *tablegen_opaque_val)
static inline ::mlir::StringAttr getRecordNameAttr(const Concept *impl, ::mlir::Operation *tablegen_opaque_val)
static bool isRead(const Concept *impl, ::mlir::Operation *tablegen_opaque_val)
static inline ::mlir::TypedValue<::llzk::pod::PodType > getPodRef(const Concept *impl, ::mlir::Operation *tablegen_opaque_val)
static inline ::mlir::OpOperand & getPodRefMutable(const Concept *impl, ::mlir::Operation *tablegen_opaque_val)
static inline ::mlir::TypedValue<::llzk::pod::PodType > getPodRef(const Concept *impl, ::mlir::Operation *tablegen_opaque_val)
static inline ::mlir::OpOperand & getPodRefMutable(const Concept *impl, ::mlir::Operation *tablegen_opaque_val)
Common interface for operations that reference a plain-old-data struct value.
void initializeInterfaceConcept(::mlir::detail::InterfaceMap &interfaceMap)
const ::llzk::pod::PodRefOpInterface::Concept * implPodRefOpInterface
The base classes of this interface.
bool(* isRead)(const Concept *impl, ::mlir::Operation *)
::mlir::StringAttr(* getRecordNameAttr)(const Concept *impl, ::mlir::Operation *)
The methods defined by the interface.
::mlir::OpOperand &(* getPodRefMutable)(const Concept *impl, ::mlir::Operation *)
::mlir::TypedValue<::llzk::pod::PodType >(* getPodRef)(const Concept *impl, ::mlir::Operation *)
The methods defined by the interface.