LLZK 3.0.0
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
DiscardableAllocationOpInterfaces.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 {
10
16
17} // namespace llzk
18namespace llzk {
19
24namespace detail {
26 struct Concept {
28 bool (*loadsFromDiscardableAllocation)(const Concept *impl, ::mlir::Operation *, ::mlir::Value);
29 bool (*storesToDiscardableAllocation)(const Concept *impl, ::mlir::Operation *, ::mlir::Value);
30 bool (*canEraseAsDeadStoreTo)(const Concept *impl, ::mlir::Operation *, ::mlir::Value, const ::mlir::DataLayout &);
31 };
32 template<typename ConcreteOp>
33 class Model : public Concept {
34 public:
37
38 static inline bool loadsFromDiscardableAllocation(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, ::mlir::Value ptr);
39 static inline bool storesToDiscardableAllocation(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, ::mlir::Value ptr);
40 static inline bool canEraseAsDeadStoreTo(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, ::mlir::Value ptr, const ::mlir::DataLayout & dataLayout);
41 };
42 template<typename ConcreteOp>
43 class FallbackModel : public Concept {
44 public:
47
48 static inline bool loadsFromDiscardableAllocation(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, ::mlir::Value ptr);
49 static inline bool storesToDiscardableAllocation(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, ::mlir::Value ptr);
50 static inline bool canEraseAsDeadStoreTo(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, ::mlir::Value ptr, const ::mlir::DataLayout & dataLayout);
51 };
52 template<typename ConcreteModel, typename ConcreteOp>
53 class ExternalModel : public FallbackModel<ConcreteModel> {
54 public:
55 using ConcreteEntity = ConcreteOp;
56 };
57};
58template <typename ConcreteOp>
60
61} // namespace detail
62class DiscardableAllocationAccessorOpInterface : public ::mlir::OpInterface<DiscardableAllocationAccessorOpInterface, detail::DiscardableAllocationAccessorOpInterfaceInterfaceTraits> {
63public:
64 using ::mlir::OpInterface<DiscardableAllocationAccessorOpInterface, detail::DiscardableAllocationAccessorOpInterfaceInterfaceTraits>::OpInterface;
65 template <typename ConcreteOp>
67
69 bool loadsFromDiscardableAllocation(::mlir::Value ptr);
70
72 bool storesToDiscardableAllocation(::mlir::Value ptr);
73
75 bool canEraseAsDeadStoreTo(::mlir::Value ptr, const ::mlir::DataLayout & dataLayout);
76};
77
78} // namespace llzk
79namespace llzk::detail {
80
81 template <typename ConcreteOp>
82 struct DiscardableAllocationAccessorOpInterfaceTrait : public ::mlir::OpInterface<DiscardableAllocationAccessorOpInterface, detail::DiscardableAllocationAccessorOpInterfaceInterfaceTraits>::Trait<ConcreteOp> {
83 };
84
85} // namespace llzk::detail
86namespace llzk {
87
88template<typename ConcreteOp>
90 return (llvm::cast<ConcreteOp>(tablegen_opaque_val)).loadsFromDiscardableAllocation(ptr);
91}
92template<typename ConcreteOp>
94 return (llvm::cast<ConcreteOp>(tablegen_opaque_val)).storesToDiscardableAllocation(ptr);
95}
96template<typename ConcreteOp>
97bool detail::DiscardableAllocationAccessorOpInterfaceInterfaceTraits::Model<ConcreteOp>::canEraseAsDeadStoreTo(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, ::mlir::Value ptr, const ::mlir::DataLayout & dataLayout) {
98 return (llvm::cast<ConcreteOp>(tablegen_opaque_val)).canEraseAsDeadStoreTo(ptr, dataLayout);
99}
100template<typename ConcreteOp>
102 return static_cast<const ConcreteOp *>(impl)->loadsFromDiscardableAllocation(tablegen_opaque_val, ptr);
103}
104template<typename ConcreteOp>
106 return static_cast<const ConcreteOp *>(impl)->storesToDiscardableAllocation(tablegen_opaque_val, ptr);
107}
108template<typename ConcreteOp>
109bool detail::DiscardableAllocationAccessorOpInterfaceInterfaceTraits::FallbackModel<ConcreteOp>::canEraseAsDeadStoreTo(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, ::mlir::Value ptr, const ::mlir::DataLayout & dataLayout) {
110 return static_cast<const ConcreteOp *>(impl)->canEraseAsDeadStoreTo(tablegen_opaque_val, ptr, dataLayout);
111}
112
113} // namespace llzk
bool canEraseAsDeadStoreTo(::mlir::Value ptr, const ::mlir::DataLayout &dataLayout)
Returns true if this op can be erased as a dead store to ptr.
bool loadsFromDiscardableAllocation(::mlir::Value ptr)
Returns true if this op reads from the allocation represented by ptr.
bool storesToDiscardableAllocation(::mlir::Value ptr)
Returns true if this op writes to the allocation represented by ptr.
static bool canEraseAsDeadStoreTo(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, ::mlir::Value ptr, const ::mlir::DataLayout &dataLayout)
static bool storesToDiscardableAllocation(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, ::mlir::Value ptr)
static bool loadsFromDiscardableAllocation(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, ::mlir::Value ptr)
static bool loadsFromDiscardableAllocation(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, ::mlir::Value ptr)
static bool storesToDiscardableAllocation(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, ::mlir::Value ptr)
static bool canEraseAsDeadStoreTo(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, ::mlir::Value ptr, const ::mlir::DataLayout &dataLayout)
Provides the necessary information to the RemoveUnusedDiscardableAllocations pass about operations th...
Definition Ops.cpp.inc:41
bool(* storesToDiscardableAllocation)(const Concept *impl, ::mlir::Operation *, ::mlir::Value)
bool(* loadsFromDiscardableAllocation)(const Concept *impl, ::mlir::Operation *, ::mlir::Value)
The methods defined by the interface.
bool(* canEraseAsDeadStoreTo)(const Concept *impl, ::mlir::Operation *, ::mlir::Value, const ::mlir::DataLayout &)