LLZK 2.1.1
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 pod {
12namespace detail {
14 struct Concept {
16 ::mlir::TypedValue<::llzk::pod::PodType> (*getPodRef)(const Concept *impl, ::mlir::Operation *);
17 ::mlir::OpOperand &(*getPodRefMutable)(const Concept *impl, ::mlir::Operation *);
18 };
19 template<typename ConcreteOp>
20 class Model : public Concept {
21 public:
24
25 static inline ::mlir::TypedValue<::llzk::pod::PodType> getPodRef(const Concept *impl, ::mlir::Operation *tablegen_opaque_val);
26 static inline ::mlir::OpOperand &getPodRefMutable(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::pod::PodType> getPodRef(const Concept *impl, ::mlir::Operation *tablegen_opaque_val);
35 static inline ::mlir::OpOperand &getPodRefMutable(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 PodRefOpInterface : public ::mlir::OpInterface<PodRefOpInterface, detail::PodRefOpInterfaceInterfaceTraits> {
48public:
49 using ::mlir::OpInterface<PodRefOpInterface, detail::PodRefOpInterfaceInterfaceTraits>::OpInterface;
50 template <typename ConcreteOp>
51 struct Trait : public detail::PodRefOpInterfaceTrait<ConcreteOp> {};
53 ::mlir::TypedValue<::llzk::pod::PodType> getPodRef();
55 ::mlir::OpOperand &getPodRefMutable();
56
58 inline ::llzk::pod::PodType getPodRefType() { return getPodRef().getType(); }
59};
60namespace detail {
61 template <typename ConcreteOp>
62 struct PodRefOpInterfaceTrait : public ::mlir::OpInterface<PodRefOpInterface, detail::PodRefOpInterfaceInterfaceTraits>::Trait<ConcreteOp> {
63 };
64}// namespace detail
65} // namespace pod
66} // namespace llzk
67namespace llzk {
68namespace pod {
69class PodAccessOpInterface;
70namespace detail {
72 struct Concept {
74 ::mlir::FlatSymbolRefAttr (*getRecordNameAttr)(const Concept *impl, ::mlir::Operation *);
75 bool (*isRead)(const Concept *impl, ::mlir::Operation *);
77 const ::llzk::pod::PodRefOpInterface::Concept *implPodRefOpInterface = nullptr;
78
79 void initializeInterfaceConcept(::mlir::detail::InterfaceMap &interfaceMap) {
81 assert(implPodRefOpInterface && "`::llzk::pod::PodAccessOpInterface` expected its base interface `::llzk::pod::PodRefOpInterface` to be registered");
82 }
83 };
84 template<typename ConcreteOp>
85 class Model : public Concept {
86 public:
89
90 static inline ::mlir::FlatSymbolRefAttr getRecordNameAttr(const Concept *impl, ::mlir::Operation *tablegen_opaque_val);
91 static inline bool isRead(const Concept *impl, ::mlir::Operation *tablegen_opaque_val);
92 };
93 template<typename ConcreteOp>
94 class FallbackModel : public Concept {
95 public:
98
99 static inline ::mlir::FlatSymbolRefAttr 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 ConcreteModel, typename ConcreteOp>
103 class ExternalModel : public FallbackModel<ConcreteModel> {
104 public:
105 using ConcreteEntity = ConcreteOp;
106 };
107};
108template <typename ConcreteOp>
110
111} // namespace detail
112class PodAccessOpInterface : public ::mlir::OpInterface<PodAccessOpInterface, detail::PodAccessOpInterfaceInterfaceTraits> {
113public:
114 using ::mlir::OpInterface<PodAccessOpInterface, detail::PodAccessOpInterfaceInterfaceTraits>::OpInterface;
115 template <typename ConcreteOp>
116 struct Trait : public detail::PodAccessOpInterfaceTrait<ConcreteOp> {};
118 ::mlir::FlatSymbolRefAttr getRecordNameAttr();
120 bool isRead();
121
123 inline ::mlir::StringAttr getRecordNameAsStringAttr() {
124 return getRecordNameAttr().getLeafReference();
125 }
126
128 bool canRewire(const ::mlir::DestructurableMemorySlot &slot,
129 ::llvm::SmallPtrSetImpl<::mlir::Attribute> &usedIndices,
130 ::mlir::SmallVectorImpl<::mlir::MemorySlot> &mustBeSafelyUsed,
131 const ::mlir::DataLayout &dataLayout);
132
134 ::mlir::DeletionKind rewire(const ::mlir::DestructurableMemorySlot &slot,
135 ::llvm::DenseMap<::mlir::Attribute, ::mlir::MemorySlot> &subslots,
136 ::mlir::OpBuilder &builder, const ::mlir::DataLayout &dataLayout);
137 //===----------------------------------------------------------------===//
138 // Inherited from ::llzk::pod::PodRefOpInterface
139 //===----------------------------------------------------------------===//
140
141 operator ::llzk::pod::PodRefOpInterface () const {
142 if (!*this) return nullptr;
143 return ::llzk::pod::PodRefOpInterface(*this, getImpl()->implPodRefOpInterface);
144 }
145
147 ::mlir::TypedValue<::llzk::pod::PodType> getPodRef();
149 ::mlir::OpOperand &getPodRefMutable();
150
152 inline ::llzk::pod::PodType getPodRefType() { return getPodRef().getType(); }
153};
154namespace detail {
155 template <typename ConcreteOp>
156 struct PodAccessOpInterfaceTrait : public ::mlir::OpInterface<PodAccessOpInterface, detail::PodAccessOpInterfaceInterfaceTraits>::Trait<ConcreteOp> {
157 };
158}// namespace detail
159} // namespace pod
160} // namespace llzk
161namespace llzk {
162namespace pod {
163template<typename ConcreteOp>
164::mlir::TypedValue<::llzk::pod::PodType> detail::PodRefOpInterfaceInterfaceTraits::Model<ConcreteOp>::getPodRef(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) {
165 return (llvm::cast<ConcreteOp>(tablegen_opaque_val)).getPodRef();
166}
167template<typename ConcreteOp>
168::mlir::OpOperand &detail::PodRefOpInterfaceInterfaceTraits::Model<ConcreteOp>::getPodRefMutable(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) {
169 return (llvm::cast<ConcreteOp>(tablegen_opaque_val)).getPodRefMutable();
170}
171template<typename ConcreteOp>
172::mlir::TypedValue<::llzk::pod::PodType> detail::PodRefOpInterfaceInterfaceTraits::FallbackModel<ConcreteOp>::getPodRef(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) {
173 return static_cast<const ConcreteOp *>(impl)->getPodRef(tablegen_opaque_val);
174}
175template<typename ConcreteOp>
176::mlir::OpOperand &detail::PodRefOpInterfaceInterfaceTraits::FallbackModel<ConcreteOp>::getPodRefMutable(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) {
177 return static_cast<const ConcreteOp *>(impl)->getPodRefMutable(tablegen_opaque_val);
178}
179} // namespace pod
180} // namespace llzk
181namespace llzk {
182namespace pod {
183template<typename ConcreteOp>
184::mlir::FlatSymbolRefAttr detail::PodAccessOpInterfaceInterfaceTraits::Model<ConcreteOp>::getRecordNameAttr(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) {
185 return (llvm::cast<ConcreteOp>(tablegen_opaque_val)).getRecordNameAttr();
186}
187template<typename ConcreteOp>
188bool detail::PodAccessOpInterfaceInterfaceTraits::Model<ConcreteOp>::isRead(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) {
189 return (llvm::cast<ConcreteOp>(tablegen_opaque_val)).isRead();
190}
191template<typename ConcreteOp>
192::mlir::FlatSymbolRefAttr detail::PodAccessOpInterfaceInterfaceTraits::FallbackModel<ConcreteOp>::getRecordNameAttr(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) {
193 return static_cast<const ConcreteOp *>(impl)->getRecordNameAttr(tablegen_opaque_val);
194}
195template<typename ConcreteOp>
197 return static_cast<const ConcreteOp *>(impl)->isRead(tablegen_opaque_val);
198}
199} // namespace pod
200} // namespace llzk
::mlir::FlatSymbolRefAttr getRecordNameAttr()
Gets the record name attribute from the pod access op.
::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:483
inline ::mlir::StringAttr getRecordNameAsStringAttr()
Gets the record name as an attribute suitable for destructuring indices.
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:465
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::FlatSymbolRefAttr getRecordNameAttr(const Concept *impl, ::mlir::Operation *tablegen_opaque_val)
static bool isRead(const Concept *impl, ::mlir::Operation *tablegen_opaque_val)
static inline ::mlir::FlatSymbolRefAttr 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)
::mlir::FlatSymbolRefAttr(* getRecordNameAttr)(const Concept *impl, ::mlir::Operation *)
The methods defined by the interface.
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::OpOperand &(* getPodRefMutable)(const Concept *impl, ::mlir::Operation *)
::mlir::TypedValue<::llzk::pod::PodType >(* getPodRef)(const Concept *impl, ::mlir::Operation *)
The methods defined by the interface.