16MlirOperation
llzkRam_LoadOpBuild(MlirOpBuilder builder, MlirLocation location, MlirType valType, MlirValue addr) {
17 MlirOperationState state = mlirOperationStateGet(mlirStringRefCreateFromCString(
"ram.load"), location);
18 mlirOperationStateAddResults(&state, 1, &valType);
19 mlirOperationStateAddOperands(&state, 1, &addr);
25 return llvm::isa<LoadOp>(unwrap(inp));
29 auto range = llvm::cast<LoadOp>(unwrap(op)).getODSOperandIndexAndLength(0);
30 assert(range.second == 1 &&
"expected fixed operand segment size");
32 static_cast<uintptr_t
>(range.first) <=
static_cast<uintptr_t
>(std::numeric_limits<intptr_t>::max()) &&
33 "operand index exceeds intptr_t range"
35 return mlirOperationGetOperand(op,
static_cast<intptr_t
>(range.first));
39 auto range = llvm::cast<LoadOp>(unwrap(op)).getODSOperandIndexAndLength(0);
40 assert(range.second == 1 &&
"expected fixed operand segment size");
42 static_cast<uintptr_t
>(range.first) <=
static_cast<uintptr_t
>(std::numeric_limits<intptr_t>::max()) &&
43 "operand index exceeds intptr_t range"
45 mlirOperationSetOperand(op,
static_cast<intptr_t
>(range.first), value);
49 return mlirOperationGetResult(op, 0);
52MlirOperation
llzkRam_StoreOpBuild(MlirOpBuilder builder, MlirLocation location, MlirValue addr, MlirValue val) {
53 MlirOperationState state = mlirOperationStateGet(mlirStringRefCreateFromCString(
"ram.store"), location);
54 mlirOperationStateAddOperands(&state, 1, &addr);
55 mlirOperationStateAddOperands(&state, 1, &val);
61 return llvm::isa<StoreOp>(unwrap(inp));
65 auto range = llvm::cast<StoreOp>(unwrap(op)).getODSOperandIndexAndLength(0);
66 assert(range.second == 1 &&
"expected fixed operand segment size");
68 static_cast<uintptr_t
>(range.first) <=
static_cast<uintptr_t
>(std::numeric_limits<intptr_t>::max()) &&
69 "operand index exceeds intptr_t range"
71 return mlirOperationGetOperand(op,
static_cast<intptr_t
>(range.first));
75 auto range = llvm::cast<StoreOp>(unwrap(op)).getODSOperandIndexAndLength(0);
76 assert(range.second == 1 &&
"expected fixed operand segment size");
78 static_cast<uintptr_t
>(range.first) <=
static_cast<uintptr_t
>(std::numeric_limits<intptr_t>::max()) &&
79 "operand index exceeds intptr_t range"
81 mlirOperationSetOperand(op,
static_cast<intptr_t
>(range.first), value);
85 auto range = llvm::cast<StoreOp>(unwrap(op)).getODSOperandIndexAndLength(1);
86 assert(range.second == 1 &&
"expected fixed operand segment size");
88 static_cast<uintptr_t
>(range.first) <=
static_cast<uintptr_t
>(std::numeric_limits<intptr_t>::max()) &&
89 "operand index exceeds intptr_t range"
91 return mlirOperationGetOperand(op,
static_cast<intptr_t
>(range.first));
95 auto range = llvm::cast<StoreOp>(unwrap(op)).getODSOperandIndexAndLength(1);
96 assert(range.second == 1 &&
"expected fixed operand segment size");
98 static_cast<uintptr_t
>(range.first) <=
static_cast<uintptr_t
>(std::numeric_limits<intptr_t>::max()) &&
99 "operand index exceeds intptr_t range"
101 mlirOperationSetOperand(op,
static_cast<intptr_t
>(range.first), value);
MlirOperation mlirOpBuilderInsert(MlirOpBuilder builder, MlirOperation op)
Inserts op at the current insertion point of builder and returns it.
MlirValue llzkRam_LoadOpGetVal(MlirOperation op)
Get Val result from llzk::ram::LoadOp Operation.
void llzkRam_StoreOpSetVal(MlirOperation op, MlirValue value)
Set Val operand of llzk::ram::StoreOp Operation.
bool llzkOperationIsA_Ram_StoreOp(MlirOperation inp)
Returns true if the Operation is a llzk::ram::StoreOp.
MlirOperation llzkRam_StoreOpBuild(MlirOpBuilder builder, MlirLocation location, MlirValue addr, MlirValue val)
Build a llzk::ram::StoreOp Operation.
MlirValue llzkRam_LoadOpGetAddr(MlirOperation op)
Get Addr operand from llzk::ram::LoadOp Operation.
void llzkRam_StoreOpSetAddr(MlirOperation op, MlirValue value)
Set Addr operand of llzk::ram::StoreOp Operation.
MlirOperation llzkRam_LoadOpBuild(MlirOpBuilder builder, MlirLocation location, MlirType valType, MlirValue addr)
Build a llzk::ram::LoadOp Operation.
bool llzkOperationIsA_Ram_LoadOp(MlirOperation inp)
Returns true if the Operation is a llzk::ram::LoadOp.
void llzkRam_LoadOpSetAddr(MlirOperation op, MlirValue value)
Set Addr operand of llzk::ram::LoadOp Operation.
MlirValue llzkRam_StoreOpGetAddr(MlirOperation op)
Get Addr operand from llzk::ram::StoreOp Operation.
MlirValue llzkRam_StoreOpGetVal(MlirOperation op)
Get Val operand from llzk::ram::StoreOp Operation.