LLZK 0.1.0
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
Ops.h.inc
Go to the documentation of this file.
1/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2|* *|
3|* Op Declarations *|
4|* *|
5|* Automatically generated file, do not edit! *|
6|* From: Ops.td *|
7|* *|
8\*===----------------------------------------------------------------------===*/
9
10namespace llzk {
11class NonDetOp;
12} // namespace llzk
13#ifdef GET_OP_CLASSES
14#undef GET_OP_CLASSES
15
16namespace llzk {
17
18//===----------------------------------------------------------------------===//
19// ::llzk::NonDetOp declarations
20//===----------------------------------------------------------------------===//
21
22namespace detail {
24public:
25protected:
26 ::mlir::DictionaryAttr odsAttrs;
27 ::std::optional<::mlir::OperationName> odsOpName;
28 ::mlir::RegionRange odsRegions;
29public:
30 NonDetOpGenericAdaptorBase(::mlir::DictionaryAttr attrs = {}, const ::mlir::EmptyProperties &properties = {}, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), odsRegions(regions) { if (odsAttrs)
31 odsOpName.emplace("llzk.nondet", odsAttrs.getContext());
32 }
33
34 NonDetOpGenericAdaptorBase(::mlir::Operation *op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), odsRegions(op->getRegions()) {}
35
36 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
37 return {index, 1};
38 }
39
40 ::mlir::DictionaryAttr getAttributes() {
41 return odsAttrs;
42 }
43
44};
45} // namespace detail
46template <typename RangeT>
48 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
50public:
51 NonDetOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = {}, const ::mlir::EmptyProperties &properties = {}, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
52
53 NonDetOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : NonDetOpGenericAdaptor(values, attrs, (properties ? *properties.as<::mlir::EmptyProperties *>() : ::mlir::EmptyProperties{}), regions) {}
54
55 NonDetOpGenericAdaptor(RangeT values, const NonDetOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {}
56
57 template <typename LateInst = NonDetOp, typename = std::enable_if_t<std::is_same_v<LateInst, NonDetOp>>>
58 NonDetOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
59
60 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
61 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
62 }
63
64 RangeT getODSOperands(unsigned index) {
65 auto valueRange = getODSOperandIndexAndLength(index);
66 return {std::next(odsOperands.begin(), valueRange.first),
67 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
68 }
69
70 RangeT getOperands() {
71 return odsOperands;
72 }
73
74private:
75 RangeT odsOperands;
76};
77class NonDetOpAdaptor : public NonDetOpGenericAdaptor<::mlir::ValueRange> {
78public:
81
82 ::llvm::LogicalResult verify(::mlir::Location loc);
83};
84class NonDetOp : public ::mlir::Op<NonDetOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::ZeroOperands, ::mlir::OpTrait::OpInvariants, ::mlir::OpTrait::ConstantLike, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpAsmOpInterface::Trait> {
85public:
86 using Op::Op;
87 using Op::print;
89 template <typename RangeT>
92 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
93 return {};
94 }
95
96 static constexpr ::llvm::StringLiteral getOperationName() {
97 return ::llvm::StringLiteral("llzk.nondet");
98 }
99
100 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
101 return {index, 1};
102 }
103
104 ::mlir::Operation::operand_range getODSOperands(unsigned index) {
105 auto valueRange = getODSOperandIndexAndLength(index);
106 return {std::next(getOperation()->operand_begin(), valueRange.first),
107 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
108 }
109
110 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) {
111 return {index, 1};
112 }
113
114 ::mlir::Operation::result_range getODSResults(unsigned index) {
115 auto valueRange = getODSResultIndexAndLength(index);
116 return {std::next(getOperation()->result_begin(), valueRange.first),
117 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
118 }
119
120 ::mlir::TypedValue<::mlir::Type> getRes() {
121 return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(*getODSResults(0).begin());
122 }
123
124 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res);
125 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes);
126 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
127 ::llvm::LogicalResult verifyInvariantsImpl();
128 ::llvm::LogicalResult verifyInvariants();
129 void getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn);
130 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
131 void print(::mlir::OpAsmPrinter &_odsPrinter);
132 void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
133public:
134};
135} // namespace llzk
136MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::NonDetOp)
137
138
139#endif // GET_OP_CLASSES
140
NonDetOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:51
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:46
NonDetOpAdaptor(NonDetOp op)
Definition Ops.cpp.inc:44
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:60
NonDetOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:51
NonDetOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:58
NonDetOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:53
RangeT getODSOperands(unsigned index)
Definition Ops.h.inc:64
NonDetOpGenericAdaptor(RangeT values, const NonDetOpGenericAdaptorBase &base)
Definition Ops.h.inc:55
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:104
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:114
::mlir::TypedValue<::mlir::Type > getRes()
Definition Ops.h.inc:120
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:67
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:100
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:105
NonDetOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:90
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.h.inc:110
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:96
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res)
Definition Ops.cpp.inc:50
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:80
NonDetOpAdaptor Adaptor
Definition Ops.h.inc:88
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:84
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:91
void getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn)
Definition Ops.cpp:25
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:119
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
Definition Ops.h.inc:92
::mlir::DictionaryAttr getAttributes()
Definition Ops.h.inc:40
::mlir::DictionaryAttr odsAttrs
Definition Ops.h.inc:26
NonDetOpGenericAdaptorBase(::mlir::Operation *op)
Definition Ops.h.inc:34
NonDetOpGenericAdaptorBase(::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:30
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:27
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.h.inc:36