54template <
typename RangeT>
56 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
59 FeltToIndexOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = {}, const ::mlir::EmptyProperties &properties = {}, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
65 template <
typename LateInst = FeltToIndexOp,
typename = std::enable_if_t<std::is_same_v<LateInst, FeltToIndexOp>>>
74 return {std::next(odsOperands.begin(), valueRange.first),
75 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
94 ::llvm::LogicalResult
verify(::mlir::Location loc);
96class FeltToIndexOp :
public ::mlir::Op<FeltToIndexOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::IndexType>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::llzk::function::NotFieldNative, ::mlir::OpTrait::OpInvariants, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::InferTypeOpInterface::Trait> {
101 template <
typename RangeT>
109 return ::llvm::StringLiteral(
"cast.toindex");
118 return {std::next(getOperation()->operand_begin(), valueRange.first),
119 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
122 ::mlir::TypedValue<::llzk::felt::FeltType>
getValue() {
123 return ::llvm::cast<::mlir::TypedValue<::llzk::felt::FeltType>>(*
getODSOperands(0).begin());
128 return getOperation()->getOpOperand(range.first);
137 return {std::next(getOperation()->result_begin(), valueRange.first),
138 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
142 return ::llvm::cast<::mlir::TypedValue<::mlir::IndexType>>(*
getODSResults(0).begin());
145 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value value);
146 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value value);
147 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value value);
148 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
149 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
152 static ::llvm::LogicalResult
inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes);
153 static ::mlir::ParseResult
parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
154 void print(::mlir::OpAsmPrinter &_odsPrinter);
155 void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
158 static ::mlir::ParseResult parseInferredOrParsedType(
159 ::mlir::OpAsmParser &parser, ::mlir::Type &opType,
bool isFirst
161 if (mlir::succeeded(isFirst ? parser.parseOptionalColon() : parser.parseOptionalComma())) {
164 if (parser.parseCustomTypeWithFallback(type)) {
165 return mlir::failure();
173 return mlir::success();
176 static void printInferredOrParsedType(::mlir::OpAsmPrinter &printer,
177 ::mlir::Operation *op, ::mlir::Type opType,
bool isFirst
179 printer << (isFirst ?
" : " :
", ");
180 printer.printStrippedAttrOrType(opType);
218template <
typename RangeT>
220 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
223 IntToFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = {}, const ::mlir::EmptyProperties &properties = {}, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
229 template <
typename LateInst = IntToFeltOp,
typename = std::enable_if_t<std::is_same_v<LateInst, IntToFeltOp>>>
238 return {std::next(odsOperands.begin(), valueRange.first),
239 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
258 ::llvm::LogicalResult
verify(::mlir::Location loc);
260class IntToFeltOp :
public ::mlir::Op<IntToFeltOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::llzk::felt::FeltType>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::InferTypeOpInterface::Trait> {
265 template <
typename RangeT>
273 return ::llvm::StringLiteral(
"cast.tofelt");
282 return {std::next(getOperation()->operand_begin(), valueRange.first),
283 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
287 return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(*
getODSOperands(0).begin());
292 return getOperation()->getOpOperand(range.first);
301 return {std::next(getOperation()->result_begin(), valueRange.first),
302 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
305 ::mlir::TypedValue<::llzk::felt::FeltType>
getResult() {
306 return ::llvm::cast<::mlir::TypedValue<::llzk::felt::FeltType>>(*
getODSResults(0).begin());
309 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value value);
310 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value value);
311 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value value);
312 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
313 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
316 static ::llvm::LogicalResult
inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes);
317 static ::mlir::ParseResult
parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
318 void print(::mlir::OpAsmPrinter &_odsPrinter);
319 void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
324 static ::mlir::ParseResult parseInferredOrParsedType(
325 ::mlir::OpAsmParser &parser, ::mlir::Type &opType,
bool isFirst
327 if (mlir::succeeded(isFirst ? parser.parseOptionalColon() : parser.parseOptionalComma())) {
330 if (parser.parseCustomTypeWithFallback(type)) {
331 return mlir::failure();
339 return mlir::success();
342 static void printInferredOrParsedType(::mlir::OpAsmPrinter &printer,
343 ::mlir::Operation *op, ::mlir::Type opType,
bool isFirst
345 printer << (isFirst ?
" : " :
", ");
346 printer.printStrippedAttrOrType(opType);
::llvm::LogicalResult verify(::mlir::Location loc)
FeltToIndexOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
FeltToIndexOpAdaptor(FeltToIndexOp op)
FeltToIndexOpGenericAdaptor(RangeT values, LateInst op)
FeltToIndexOpGenericAdaptor(RangeT values, const FeltToIndexOpGenericAdaptorBase &base)
FeltToIndexOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
FeltToIndexOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
RangeT getODSOperands(unsigned index)
::llvm::LogicalResult verifyInvariants()
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value value)
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
::mlir::OpOperand & getValueMutable()
::mlir::TypedValue<::llzk::felt::FeltType > getValue()
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
void print(::mlir::OpAsmPrinter &_odsPrinter)
::mlir::TypedValue<::mlir::IndexType > getResult()
::mlir::Operation::result_range getODSResults(unsigned index)
FeltToIndexOpAdaptor Adaptor
FeltToIndexOpGenericAdaptor< RangeT > GenericAdaptor
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location > location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type > &inferredReturnTypes)
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
::mlir::Operation::operand_range getODSOperands(unsigned index)
::llvm::LogicalResult verifyInvariantsImpl()
static constexpr ::llvm::StringLiteral getOperationName()
::llvm::LogicalResult verify(::mlir::Location loc)
IntToFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
IntToFeltOpAdaptor(IntToFeltOp op)
IntToFeltOpGenericAdaptor(RangeT values, LateInst op)
IntToFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
IntToFeltOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
IntToFeltOpGenericAdaptor(RangeT values, const IntToFeltOpGenericAdaptorBase &base)
RangeT getODSOperands(unsigned index)
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
void print(::mlir::OpAsmPrinter &_odsPrinter)
::llvm::LogicalResult verifyInvariantsImpl()
static constexpr ::llvm::StringLiteral getOperationName()
::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location > location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type > &inferredReturnTypes)
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
IntToFeltOpAdaptor Adaptor
::mlir::Operation::operand_range getODSOperands(unsigned index)
::mlir::TypedValue<::llzk::felt::FeltType > getResult()
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
IntToFeltOpGenericAdaptor< RangeT > GenericAdaptor
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value value)
static bool isCompatibleReturnTypes(::mlir::TypeRange lhs, ::mlir::TypeRange rhs)
::mlir::Operation::result_range getODSResults(unsigned index)
::llvm::LogicalResult verifyInvariants()
::mlir::TypedValue<::mlir::Type > getValue()
::mlir::OpOperand & getValueMutable()
FeltToIndexOpGenericAdaptorBase(::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
::mlir::RegionRange odsRegions
::std::optional<::mlir::OperationName > odsOpName
::mlir::DictionaryAttr odsAttrs
::mlir::DictionaryAttr getAttributes()
FeltToIndexOpGenericAdaptorBase(::mlir::Operation *op)
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
::std::optional<::mlir::OperationName > odsOpName
::mlir::DictionaryAttr odsAttrs
::mlir::RegionRange odsRegions
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
IntToFeltOpGenericAdaptorBase(::mlir::Operation *op)
::mlir::DictionaryAttr getAttributes()
IntToFeltOpGenericAdaptorBase(::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
static FeltType get(::mlir::MLIRContext *context, ::mlir::StringAttr fieldName)