17 MlirOperationState state = mlirOperationStateGet(mlirStringRefCreateFromCString(
"bool.and"), location);
18 mlirOperationStateEnableResultTypeInference(&state);
19 mlirOperationStateAddOperands(&state, 1, &lhs);
20 mlirOperationStateAddOperands(&state, 1, &rhs);
26 return llvm::isa<AndBoolOp>(unwrap(inp));
30 auto range = llvm::cast<AndBoolOp>(unwrap(op)).getODSOperandIndexAndLength(0);
31 assert(range.second == 1 &&
"expected fixed operand segment size");
33 static_cast<uintptr_t
>(range.first) <=
static_cast<uintptr_t
>(std::numeric_limits<intptr_t>::max()) &&
34 "operand index exceeds intptr_t range"
36 return mlirOperationGetOperand(op,
static_cast<intptr_t
>(range.first));
40 auto range = llvm::cast<AndBoolOp>(unwrap(op)).getODSOperandIndexAndLength(0);
41 assert(range.second == 1 &&
"expected fixed operand segment size");
43 static_cast<uintptr_t
>(range.first) <=
static_cast<uintptr_t
>(std::numeric_limits<intptr_t>::max()) &&
44 "operand index exceeds intptr_t range"
46 mlirOperationSetOperand(op,
static_cast<intptr_t
>(range.first), value);
50 auto range = llvm::cast<AndBoolOp>(unwrap(op)).getODSOperandIndexAndLength(1);
51 assert(range.second == 1 &&
"expected fixed operand segment size");
53 static_cast<uintptr_t
>(range.first) <=
static_cast<uintptr_t
>(std::numeric_limits<intptr_t>::max()) &&
54 "operand index exceeds intptr_t range"
56 return mlirOperationGetOperand(op,
static_cast<intptr_t
>(range.first));
60 auto range = llvm::cast<AndBoolOp>(unwrap(op)).getODSOperandIndexAndLength(1);
61 assert(range.second == 1 &&
"expected fixed operand segment size");
63 static_cast<uintptr_t
>(range.first) <=
static_cast<uintptr_t
>(std::numeric_limits<intptr_t>::max()) &&
64 "operand index exceeds intptr_t range"
66 mlirOperationSetOperand(op,
static_cast<intptr_t
>(range.first), value);
70 return mlirOperationGetResult(op, 0);
73MlirOperation
llzkBool_AssertOpBuild(MlirOpBuilder builder, MlirLocation location, MlirValue condition, MlirIdentifier msg) {
74 MlirOperationState state = mlirOperationStateGet(mlirStringRefCreateFromCString(
"bool.assert"), location);
75 mlirOperationStateAddOperands(&state, 1, &condition);
77 llvm::SmallVector<MlirNamedAttribute, 1> attributes;
78 if (!mlirAttributeIsNull(
reinterpret_cast<MlirAttribute&
>(msg))) {
79 attributes.push_back(mlirNamedAttributeGet(mlirIdentifierGet(ctx, mlirStringRefCreateFromCString(
"msg")),
reinterpret_cast<MlirAttribute&
>(msg)));
81 mlirOperationStateAddAttributes(&state, attributes.size(), attributes.data());
87 return llvm::isa<AssertOp>(unwrap(inp));
91 auto range = llvm::cast<AssertOp>(unwrap(op)).getODSOperandIndexAndLength(0);
92 assert(range.second == 1 &&
"expected fixed operand segment size");
94 static_cast<uintptr_t
>(range.first) <=
static_cast<uintptr_t
>(std::numeric_limits<intptr_t>::max()) &&
95 "operand index exceeds intptr_t range"
97 return mlirOperationGetOperand(op,
static_cast<intptr_t
>(range.first));
101 auto range = llvm::cast<AssertOp>(unwrap(op)).getODSOperandIndexAndLength(0);
102 assert(range.second == 1 &&
"expected fixed operand segment size");
104 static_cast<uintptr_t
>(range.first) <=
static_cast<uintptr_t
>(std::numeric_limits<intptr_t>::max()) &&
105 "operand index exceeds intptr_t range"
107 mlirOperationSetOperand(op,
static_cast<intptr_t
>(range.first), value);
111 return mlirOperationGetAttributeByName(op, mlirStringRefCreateFromCString(
"msg"));
115 mlirOperationSetAttributeByName(op, mlirStringRefCreateFromCString(
"msg"), attr);
118MlirOperation
llzkBool_CmpOpBuild(MlirOpBuilder builder, MlirLocation location, MlirValue lhs, MlirValue rhs, MlirAttribute predicate) {
119 MlirOperationState state = mlirOperationStateGet(mlirStringRefCreateFromCString(
"bool.cmp"), location);
120 mlirOperationStateEnableResultTypeInference(&state);
121 mlirOperationStateAddOperands(&state, 1, &lhs);
122 mlirOperationStateAddOperands(&state, 1, &rhs);
124 llvm::SmallVector<MlirNamedAttribute, 1> attributes;
125 if (!mlirAttributeIsNull(predicate)) {
126 attributes.push_back(mlirNamedAttributeGet(mlirIdentifierGet(ctx, mlirStringRefCreateFromCString(
"predicate")), predicate));
128 mlirOperationStateAddAttributes(&state, attributes.size(), attributes.data());
134 return llvm::isa<CmpOp>(unwrap(inp));
138 auto range = llvm::cast<CmpOp>(unwrap(op)).getODSOperandIndexAndLength(0);
139 assert(range.second == 1 &&
"expected fixed operand segment size");
141 static_cast<uintptr_t
>(range.first) <=
static_cast<uintptr_t
>(std::numeric_limits<intptr_t>::max()) &&
142 "operand index exceeds intptr_t range"
144 return mlirOperationGetOperand(op,
static_cast<intptr_t
>(range.first));
148 auto range = llvm::cast<CmpOp>(unwrap(op)).getODSOperandIndexAndLength(0);
149 assert(range.second == 1 &&
"expected fixed operand segment size");
151 static_cast<uintptr_t
>(range.first) <=
static_cast<uintptr_t
>(std::numeric_limits<intptr_t>::max()) &&
152 "operand index exceeds intptr_t range"
154 mlirOperationSetOperand(op,
static_cast<intptr_t
>(range.first), value);
158 auto range = llvm::cast<CmpOp>(unwrap(op)).getODSOperandIndexAndLength(1);
159 assert(range.second == 1 &&
"expected fixed operand segment size");
161 static_cast<uintptr_t
>(range.first) <=
static_cast<uintptr_t
>(std::numeric_limits<intptr_t>::max()) &&
162 "operand index exceeds intptr_t range"
164 return mlirOperationGetOperand(op,
static_cast<intptr_t
>(range.first));
168 auto range = llvm::cast<CmpOp>(unwrap(op)).getODSOperandIndexAndLength(1);
169 assert(range.second == 1 &&
"expected fixed operand segment size");
171 static_cast<uintptr_t
>(range.first) <=
static_cast<uintptr_t
>(std::numeric_limits<intptr_t>::max()) &&
172 "operand index exceeds intptr_t range"
174 mlirOperationSetOperand(op,
static_cast<intptr_t
>(range.first), value);
178 return mlirOperationGetAttributeByName(op, mlirStringRefCreateFromCString(
"predicate"));
182 mlirOperationSetAttributeByName(op, mlirStringRefCreateFromCString(
"predicate"), attr);
186 return mlirOperationGetResult(op, 0);
190 MlirOperationState state = mlirOperationStateGet(mlirStringRefCreateFromCString(
"bool.not"), location);
191 mlirOperationStateEnableResultTypeInference(&state);
192 mlirOperationStateAddOperands(&state, 1, &operand);
198 return llvm::isa<NotBoolOp>(unwrap(inp));
202 auto range = llvm::cast<NotBoolOp>(unwrap(op)).getODSOperandIndexAndLength(0);
203 assert(range.second == 1 &&
"expected fixed operand segment size");
205 static_cast<uintptr_t
>(range.first) <=
static_cast<uintptr_t
>(std::numeric_limits<intptr_t>::max()) &&
206 "operand index exceeds intptr_t range"
208 return mlirOperationGetOperand(op,
static_cast<intptr_t
>(range.first));
212 auto range = llvm::cast<NotBoolOp>(unwrap(op)).getODSOperandIndexAndLength(0);
213 assert(range.second == 1 &&
"expected fixed operand segment size");
215 static_cast<uintptr_t
>(range.first) <=
static_cast<uintptr_t
>(std::numeric_limits<intptr_t>::max()) &&
216 "operand index exceeds intptr_t range"
218 mlirOperationSetOperand(op,
static_cast<intptr_t
>(range.first), value);
222 return mlirOperationGetResult(op, 0);
226 MlirOperationState state = mlirOperationStateGet(mlirStringRefCreateFromCString(
"bool.or"), location);
227 mlirOperationStateEnableResultTypeInference(&state);
228 mlirOperationStateAddOperands(&state, 1, &lhs);
229 mlirOperationStateAddOperands(&state, 1, &rhs);
235 return llvm::isa<OrBoolOp>(unwrap(inp));
239 auto range = llvm::cast<OrBoolOp>(unwrap(op)).getODSOperandIndexAndLength(0);
240 assert(range.second == 1 &&
"expected fixed operand segment size");
242 static_cast<uintptr_t
>(range.first) <=
static_cast<uintptr_t
>(std::numeric_limits<intptr_t>::max()) &&
243 "operand index exceeds intptr_t range"
245 return mlirOperationGetOperand(op,
static_cast<intptr_t
>(range.first));
249 auto range = llvm::cast<OrBoolOp>(unwrap(op)).getODSOperandIndexAndLength(0);
250 assert(range.second == 1 &&
"expected fixed operand segment size");
252 static_cast<uintptr_t
>(range.first) <=
static_cast<uintptr_t
>(std::numeric_limits<intptr_t>::max()) &&
253 "operand index exceeds intptr_t range"
255 mlirOperationSetOperand(op,
static_cast<intptr_t
>(range.first), value);
259 auto range = llvm::cast<OrBoolOp>(unwrap(op)).getODSOperandIndexAndLength(1);
260 assert(range.second == 1 &&
"expected fixed operand segment size");
262 static_cast<uintptr_t
>(range.first) <=
static_cast<uintptr_t
>(std::numeric_limits<intptr_t>::max()) &&
263 "operand index exceeds intptr_t range"
265 return mlirOperationGetOperand(op,
static_cast<intptr_t
>(range.first));
269 auto range = llvm::cast<OrBoolOp>(unwrap(op)).getODSOperandIndexAndLength(1);
270 assert(range.second == 1 &&
"expected fixed operand segment size");
272 static_cast<uintptr_t
>(range.first) <=
static_cast<uintptr_t
>(std::numeric_limits<intptr_t>::max()) &&
273 "operand index exceeds intptr_t range"
275 mlirOperationSetOperand(op,
static_cast<intptr_t
>(range.first), value);
279 return mlirOperationGetResult(op, 0);
283 MlirOperationState state = mlirOperationStateGet(mlirStringRefCreateFromCString(
"bool.xor"), location);
284 mlirOperationStateEnableResultTypeInference(&state);
285 mlirOperationStateAddOperands(&state, 1, &lhs);
286 mlirOperationStateAddOperands(&state, 1, &rhs);
292 return llvm::isa<XorBoolOp>(unwrap(inp));
296 auto range = llvm::cast<XorBoolOp>(unwrap(op)).getODSOperandIndexAndLength(0);
297 assert(range.second == 1 &&
"expected fixed operand segment size");
299 static_cast<uintptr_t
>(range.first) <=
static_cast<uintptr_t
>(std::numeric_limits<intptr_t>::max()) &&
300 "operand index exceeds intptr_t range"
302 return mlirOperationGetOperand(op,
static_cast<intptr_t
>(range.first));
306 auto range = llvm::cast<XorBoolOp>(unwrap(op)).getODSOperandIndexAndLength(0);
307 assert(range.second == 1 &&
"expected fixed operand segment size");
309 static_cast<uintptr_t
>(range.first) <=
static_cast<uintptr_t
>(std::numeric_limits<intptr_t>::max()) &&
310 "operand index exceeds intptr_t range"
312 mlirOperationSetOperand(op,
static_cast<intptr_t
>(range.first), value);
316 auto range = llvm::cast<XorBoolOp>(unwrap(op)).getODSOperandIndexAndLength(1);
317 assert(range.second == 1 &&
"expected fixed operand segment size");
319 static_cast<uintptr_t
>(range.first) <=
static_cast<uintptr_t
>(std::numeric_limits<intptr_t>::max()) &&
320 "operand index exceeds intptr_t range"
322 return mlirOperationGetOperand(op,
static_cast<intptr_t
>(range.first));
326 auto range = llvm::cast<XorBoolOp>(unwrap(op)).getODSOperandIndexAndLength(1);
327 assert(range.second == 1 &&
"expected fixed operand segment size");
329 static_cast<uintptr_t
>(range.first) <=
static_cast<uintptr_t
>(std::numeric_limits<intptr_t>::max()) &&
330 "operand index exceeds intptr_t range"
332 mlirOperationSetOperand(op,
static_cast<intptr_t
>(range.first), value);
336 return mlirOperationGetResult(op, 0);
MlirOperation llzkBool_AssertOpBuild(MlirOpBuilder builder, MlirLocation location, MlirValue condition, MlirIdentifier msg)
Build a llzk::boolean::AssertOp Operation.
MlirOperation llzkBool_XorBoolOpBuild(MlirOpBuilder builder, MlirLocation location, MlirValue lhs, MlirValue rhs)
Build a llzk::boolean::XorBoolOp Operation.
void llzkBool_XorBoolOpSetLhs(MlirOperation op, MlirValue value)
Set Lhs operand of llzk::boolean::XorBoolOp Operation.
MlirValue llzkBool_NotBoolOpGetOperand(MlirOperation op)
Get Operand operand from llzk::boolean::NotBoolOp Operation.
bool llzkOperationIsA_Bool_CmpOp(MlirOperation inp)
Returns true if the Operation is a llzk::boolean::CmpOp.
MlirValue llzkBool_OrBoolOpGetLhs(MlirOperation op)
Get Lhs operand from llzk::boolean::OrBoolOp Operation.
MlirValue llzkBool_AssertOpGetCondition(MlirOperation op)
Get Condition operand from llzk::boolean::AssertOp Operation.
bool llzkOperationIsA_Bool_AssertOp(MlirOperation inp)
Returns true if the Operation is a llzk::boolean::AssertOp.
MlirValue llzkBool_XorBoolOpGetResult(MlirOperation op)
Get Result result from llzk::boolean::XorBoolOp Operation.
MlirValue llzkBool_CmpOpGetResult(MlirOperation op)
Get Result result from llzk::boolean::CmpOp Operation.
MlirOperation llzkBool_OrBoolOpBuild(MlirOpBuilder builder, MlirLocation location, MlirValue lhs, MlirValue rhs)
Build a llzk::boolean::OrBoolOp Operation.
void llzkBool_XorBoolOpSetRhs(MlirOperation op, MlirValue value)
Set Rhs operand of llzk::boolean::XorBoolOp Operation.
MlirValue llzkBool_AndBoolOpGetRhs(MlirOperation op)
Get Rhs operand from llzk::boolean::AndBoolOp Operation.
bool llzkOperationIsA_Bool_XorBoolOp(MlirOperation inp)
Returns true if the Operation is a llzk::boolean::XorBoolOp.
MlirOperation llzkBool_CmpOpBuild(MlirOpBuilder builder, MlirLocation location, MlirValue lhs, MlirValue rhs, MlirAttribute predicate)
Build a llzk::boolean::CmpOp Operation.
void llzkBool_CmpOpSetPredicate(MlirOperation op, MlirAttribute attr)
Set Predicate attribute of llzk::boolean::CmpOp Operation.
bool llzkOperationIsA_Bool_NotBoolOp(MlirOperation inp)
Returns true if the Operation is a llzk::boolean::NotBoolOp.
void llzkBool_NotBoolOpSetOperand(MlirOperation op, MlirValue value)
Set Operand operand of llzk::boolean::NotBoolOp Operation.
MlirAttribute llzkBool_AssertOpGetMsg(MlirOperation op)
Get Msg attribute from llzk::boolean::AssertOp Operation.
MlirValue llzkBool_OrBoolOpGetResult(MlirOperation op)
Get Result result from llzk::boolean::OrBoolOp Operation.
MlirValue llzkBool_OrBoolOpGetRhs(MlirOperation op)
Get Rhs operand from llzk::boolean::OrBoolOp Operation.
void llzkBool_AndBoolOpSetLhs(MlirOperation op, MlirValue value)
Set Lhs operand of llzk::boolean::AndBoolOp Operation.
void llzkBool_AndBoolOpSetRhs(MlirOperation op, MlirValue value)
Set Rhs operand of llzk::boolean::AndBoolOp Operation.
MlirOperation llzkBool_NotBoolOpBuild(MlirOpBuilder builder, MlirLocation location, MlirValue operand)
Build a llzk::boolean::NotBoolOp Operation.
MlirValue llzkBool_AndBoolOpGetLhs(MlirOperation op)
Get Lhs operand from llzk::boolean::AndBoolOp Operation.
void llzkBool_OrBoolOpSetLhs(MlirOperation op, MlirValue value)
Set Lhs operand of llzk::boolean::OrBoolOp Operation.
void llzkBool_AssertOpSetCondition(MlirOperation op, MlirValue value)
Set Condition operand of llzk::boolean::AssertOp Operation.
MlirValue llzkBool_CmpOpGetLhs(MlirOperation op)
Get Lhs operand from llzk::boolean::CmpOp Operation.
MlirValue llzkBool_XorBoolOpGetRhs(MlirOperation op)
Get Rhs operand from llzk::boolean::XorBoolOp Operation.
MlirValue llzkBool_AndBoolOpGetResult(MlirOperation op)
Get Result result from llzk::boolean::AndBoolOp Operation.
void llzkBool_OrBoolOpSetRhs(MlirOperation op, MlirValue value)
Set Rhs operand of llzk::boolean::OrBoolOp Operation.
MlirAttribute llzkBool_CmpOpGetPredicate(MlirOperation op)
Get Predicate attribute from llzk::boolean::CmpOp Operation.
MlirValue llzkBool_NotBoolOpGetResult(MlirOperation op)
Get Result result from llzk::boolean::NotBoolOp Operation.
void llzkBool_AssertOpSetMsg(MlirOperation op, MlirAttribute attr)
Set Msg attribute of llzk::boolean::AssertOp Operation.
bool llzkOperationIsA_Bool_OrBoolOp(MlirOperation inp)
Returns true if the Operation is a llzk::boolean::OrBoolOp.
MlirValue llzkBool_CmpOpGetRhs(MlirOperation op)
Get Rhs operand from llzk::boolean::CmpOp Operation.
MlirValue llzkBool_XorBoolOpGetLhs(MlirOperation op)
Get Lhs operand from llzk::boolean::XorBoolOp Operation.
bool llzkOperationIsA_Bool_AndBoolOp(MlirOperation inp)
Returns true if the Operation is a llzk::boolean::AndBoolOp.
MlirOperation llzkBool_AndBoolOpBuild(MlirOpBuilder builder, MlirLocation location, MlirValue lhs, MlirValue rhs)
Build a llzk::boolean::AndBoolOp Operation.
void llzkBool_CmpOpSetRhs(MlirOperation op, MlirValue value)
Set Rhs operand of llzk::boolean::CmpOp Operation.
void llzkBool_CmpOpSetLhs(MlirOperation op, MlirValue value)
Set Lhs operand of llzk::boolean::CmpOp Operation.
MlirContext mlirOpBuilderGetContext(MlirOpBuilder builder)
Returns the MLIR context associated with builder.
MlirOperation mlirOpBuilderInsert(MlirOpBuilder builder, MlirOperation op)
Inserts op at the current insertion point of builder and returns it.