43 auto &propStorage = this->callee;
44 return ::llvm::cast<::mlir::SymbolRefAttr>(propStorage);
46 void setCallee(const ::mlir::SymbolRefAttr &propValue) {
47 this->callee = propValue;
53 auto &propStorage = this->mapOpGroupSizes;
54 return ::llvm::cast<::mlir::DenseI32ArrayAttr>(propStorage);
57 this->mapOpGroupSizes = propValue;
63 auto &propStorage = this->numDimsPerMap;
64 return ::llvm::dyn_cast_or_null<::mlir::DenseI32ArrayAttr>(propStorage);
67 this->numDimsPerMap = propValue;
73 auto &propStorage = this->templateParams;
74 return ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(propStorage);
77 this->templateParams = propValue;
82 auto &propStorage = this->operandSegmentSizes;
86 auto &propStorage = this->operandSegmentSizes;
87 ::llvm::copy(propValue, propStorage.begin());
91 rhs.
callee == this->callee &&
99 return !(*
this == rhs);
124 auto attr = ::llvm::cast<::mlir::SymbolRefAttr>(
getProperties().callee);
130 auto attr = ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(
getProperties().templateParams);
138 auto attr = ::llvm::cast<::mlir::DenseI32ArrayAttr>(
getProperties().mapOpGroupSizes);
145template <
typename RangeT>
147 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
158 template <
typename LateInst = CallOp,
typename = std::enable_if_t<std::is_same_v<LateInst, CallOp>>>
167 return {std::next(odsOperands.begin(), valueRange.first),
168 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
179 ::llvm::SmallVector<RangeT> tblgenTmpOperandGroups;
180 for (
int i = 0, e = sizes.size(); i < e; ++i) {
181 tblgenTmpOperandGroups.push_back(tblgenTmpOperands.take_front(sizes[i]));
182 tblgenTmpOperands = tblgenTmpOperands.drop_front(sizes[i]);
184 return tblgenTmpOperandGroups;
199 ::llvm::LogicalResult
verify(::mlir::Location loc);
201class CallOp :
public ::mlir::Op<CallOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::AttrSizedOperandSegments, ::llzk::VerifySizesForMultiAffineOps<1>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::OpTrait::MemRefsNormalizable, ::mlir::CallOpInterface::Trait, ::mlir::SymbolUserOpInterface::Trait> {
206 template <
typename RangeT>
211 static ::llvm::StringRef attrNames[] = {::llvm::StringRef(
"callee"), ::llvm::StringRef(
"mapOpGroupSizes"), ::llvm::StringRef(
"numDimsPerMap"), ::llvm::StringRef(
"templateParams"), ::llvm::StringRef(
"operandSegmentSizes")};
212 return ::llvm::ArrayRef(attrNames);
216 return getAttributeNameForIndex(0);
220 return getAttributeNameForIndex(name, 0);
224 return getAttributeNameForIndex(1);
228 return getAttributeNameForIndex(name, 1);
232 return getAttributeNameForIndex(2);
236 return getAttributeNameForIndex(name, 2);
240 return getAttributeNameForIndex(3);
244 return getAttributeNameForIndex(name, 3);
248 return (*this)->getName().getAttributeNames().back();
252 return name.getAttributeNames().back();
256 return ::llvm::StringLiteral(
"function.call");
262 return {std::next(getOperation()->operand_begin(), valueRange.first),
263 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
279 return {std::next(getOperation()->result_begin(), valueRange.first),
280 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
283 static ::llvm::LogicalResult
setPropertiesFromAttr(
Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
286 static std::optional<mlir::Attribute>
getInherentAttr(::mlir::MLIRContext *ctx,
const Properties &prop, llvm::StringRef name);
289 static ::llvm::LogicalResult
verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
290 static ::llvm::LogicalResult
readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
293 return ::llvm::cast<::mlir::SymbolRefAttr>(getProperties().callee);
298 return ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(getProperties().templateParams);
303 return ::llvm::dyn_cast_or_null<::mlir::DenseI32ArrayAttr>(getProperties().numDimsPerMap);
308 return ::llvm::cast<::mlir::DenseI32ArrayAttr>(getProperties().mapOpGroupSizes);
313 getProperties().callee = attr;
317 getProperties().templateParams = attr;
321 getProperties().numDimsPerMap = attr;
326 getProperties().mapOpGroupSizes = attr;
331 auto &attr = getProperties().templateParams;
336 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::SymbolRefAttr callee, ::mlir::ValueRange argOperands = {}, ::llvm::ArrayRef<::mlir::Attribute> templateParams = {});
337 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::SymbolRefAttr callee, ::llvm::ArrayRef<::mlir::ValueRange> mapOperands, ::mlir::DenseI32ArrayAttr numDimsPerMap, ::mlir::ValueRange argOperands = {}, ::llvm::ArrayRef<::mlir::Attribute> templateParams = {});
338 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::SymbolRefAttr callee, ::llvm::ArrayRef<::mlir::ValueRange> mapOperands, ::llvm::ArrayRef<int32_t> numDimsPerMap, ::mlir::ValueRange argOperands = {}, ::llvm::ArrayRef<::mlir::Attribute> templateParams = {});
339 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llzk::function::FuncDefOp callee, ::mlir::ValueRange argOperands = {}, ::llvm::ArrayRef<::mlir::Attribute> templateParams = {});
340 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llzk::function::FuncDefOp callee, ::llvm::ArrayRef<::mlir::ValueRange> mapOperands, ::mlir::DenseI32ArrayAttr numDimsPerMap, ::mlir::ValueRange argOperands = {}, ::llvm::ArrayRef<::mlir::Attribute> templateParams = {});
341 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llzk::function::FuncDefOp callee, ::llvm::ArrayRef<::mlir::ValueRange> mapOperands, ::llvm::ArrayRef<int32_t> numDimsPerMap, ::mlir::ValueRange argOperands = {}, ::llvm::ArrayRef<::mlir::Attribute> templateParams = {});
347 ::llvm::LogicalResult
verifySymbolUses(::mlir::SymbolTableCollection &symbolTable);
348 static ::mlir::ParseResult
parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
350 void print(::mlir::OpAsmPrinter &_odsPrinter);
352 ::mlir::StringAttr getAttributeNameForIndex(
unsigned index) {
353 return getAttributeNameForIndex((*this)->getName(), index);
356 static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name,
unsigned index) {
357 assert(index < 4 &&
"invalid attribute index");
358 assert(name.getStringRef() ==
getOperationName() &&
"invalid operation name");
359 assert(name.isRegistered() &&
"Operation isn't registered, missing a "
360 "dependent dialect loading?");
361 return name.getAttributeNames()[index];
413 ::mlir::FailureOr<::llzk::SymbolLookupResult<::llzk::function::FuncDefOp>>
439 ::llvm::iterator_range<::mlir::Region::op_iterator<::llzk::polymorphic::TemplateParamOp>> targetParamDefs
451 ::llvm::iterator_range<::mlir::Region::op_iterator<::llzk::polymorphic::TemplateParamOp>> targetParamDefs,
474 auto &propStorage = this->arg_attrs;
475 return ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(propStorage);
478 this->arg_attrs = propValue;
484 auto &propStorage = this->function_type;
485 return ::llvm::cast<::mlir::TypeAttr>(propStorage);
488 this->function_type = propValue;
494 auto &propStorage = this->res_attrs;
495 return ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(propStorage);
498 this->res_attrs = propValue;
504 auto &propStorage = this->sym_name;
505 return ::llvm::cast<::mlir::StringAttr>(propStorage);
508 this->sym_name = propValue;
519 return !(*
this == rhs);
547 auto attr = ::llvm::cast<::mlir::StringAttr>(
getProperties().sym_name);
553 auto attr = ::llvm::cast<::mlir::TypeAttr>(
getProperties().function_type);
559 auto attr = ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(
getProperties().arg_attrs);
563 ::std::optional< ::mlir::ArrayAttr >
getArgAttrs();
565 auto attr = ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(
getProperties().res_attrs);
569 ::std::optional< ::mlir::ArrayAttr >
getResAttrs();
580template <
typename RangeT>
582 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
593 template <
typename LateInst = FuncDefOp,
typename = std::enable_if_t<std::is_same_v<LateInst, FuncDefOp>>>
602 return {std::next(odsOperands.begin(), valueRange.first),
603 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
618 ::llvm::LogicalResult
verify(::mlir::Location loc);
620class FuncDefOp :
public ::mlir::Op<FuncDefOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::ZeroResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::ZeroOperands, ::mlir::OpTrait::HasParent<::mlir::ModuleOp, ::llzk::component::StructDefOp, ::llzk::polymorphic::TemplateOp>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::SymbolUserOpInterface::Trait, ::mlir::OpTrait::AffineScope, ::mlir::OpTrait::AutomaticAllocationScope, ::mlir::SymbolOpInterface::Trait, ::mlir::CallableOpInterface::Trait, ::mlir::FunctionOpInterface::Trait, ::mlir::OpTrait::IsIsolatedFromAbove> {
625 template <
typename RangeT>
630 static ::llvm::StringRef attrNames[] = {::llvm::StringRef(
"arg_attrs"), ::llvm::StringRef(
"function_type"), ::llvm::StringRef(
"res_attrs"), ::llvm::StringRef(
"sym_name")};
631 return ::llvm::ArrayRef(attrNames);
635 return getAttributeNameForIndex(0);
639 return getAttributeNameForIndex(name, 0);
643 return getAttributeNameForIndex(1);
647 return getAttributeNameForIndex(name, 1);
651 return getAttributeNameForIndex(2);
655 return getAttributeNameForIndex(name, 2);
659 return getAttributeNameForIndex(3);
663 return getAttributeNameForIndex(name, 3);
667 return ::llvm::StringLiteral(
"function.def");
676 return {std::next(getOperation()->operand_begin(), valueRange.first),
677 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
686 return {std::next(getOperation()->result_begin(), valueRange.first),
687 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
691 return (*this)->getRegion(0);
694 static ::llvm::LogicalResult
setPropertiesFromAttr(
Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
697 static std::optional<mlir::Attribute>
getInherentAttr(::mlir::MLIRContext *ctx,
const Properties &prop, llvm::StringRef name);
700 static ::llvm::LogicalResult
verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
701 static ::llvm::LogicalResult
readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
704 return ::llvm::cast<::mlir::StringAttr>(getProperties().sym_name);
709 return ::llvm::cast<::mlir::TypeAttr>(getProperties().function_type);
714 return ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(getProperties().arg_attrs);
717 ::std::optional< ::mlir::ArrayAttr >
getArgAttrs();
719 return ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(getProperties().res_attrs);
722 ::std::optional< ::mlir::ArrayAttr >
getResAttrs();
724 getProperties().sym_name = attr;
729 getProperties().function_type = attr;
734 getProperties().arg_attrs = attr;
738 getProperties().res_attrs = attr;
742 auto &attr = getProperties().arg_attrs;
748 auto &attr = getProperties().res_attrs;
753 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llvm::StringRef name, ::mlir::FunctionType type, ::llvm::ArrayRef<::mlir::NamedAttribute> attrs = {}, ::llvm::ArrayRef<::mlir::DictionaryAttr> argAttrs = {});
754 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name, ::mlir::TypeAttr function_type, ::mlir::ArrayAttr arg_attrs, ::mlir::ArrayAttr res_attrs);
755 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::StringAttr sym_name, ::mlir::TypeAttr function_type, ::mlir::ArrayAttr arg_attrs, ::mlir::ArrayAttr res_attrs);
756 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llvm::StringRef sym_name, ::mlir::FunctionType function_type, ::mlir::ArrayAttr arg_attrs, ::mlir::ArrayAttr res_attrs);
757 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef sym_name, ::mlir::FunctionType function_type, ::mlir::ArrayAttr arg_attrs, ::mlir::ArrayAttr res_attrs);
758 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
759 static ::mlir::ParseResult
parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
760 void print(::mlir::OpAsmPrinter &p);
763 ::llvm::LogicalResult
verify();
764 ::llvm::LogicalResult
verifySymbolUses(::mlir::SymbolTableCollection &symbolTable);
766 ::mlir::StringAttr getAttributeNameForIndex(
unsigned index) {
767 return getAttributeNameForIndex((*this)->getName(), index);
770 static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name,
unsigned index) {
771 assert(index < 4 &&
"invalid attribute index");
772 assert(name.getStringRef() ==
getOperationName() &&
"invalid operation name");
773 assert(name.isRegistered() &&
"Operation isn't registered, missing a "
774 "dependent dialect loading?");
775 return name.getAttributeNames()[index];
779 static FuncDefOp create(::mlir::Location location, ::llvm::StringRef name, ::mlir::FunctionType type,
780 ::llvm::ArrayRef<::mlir::NamedAttribute> attrs = {});
781 static FuncDefOp create(::mlir::Location location, ::llvm::StringRef name, ::mlir::FunctionType type,
782 ::mlir::Operation::dialect_attr_range attrs);
783 static FuncDefOp create(::mlir::Location location, ::llvm::StringRef name, ::mlir::FunctionType type,
784 ::llvm::ArrayRef<::mlir::NamedAttribute> attrs,
785 ::llvm::ArrayRef<::mlir::DictionaryAttr> argAttrs);
805 return getOperation()->hasAttr(llzk::function::AllowConstraintAttr::name);
813 return getOperation()->hasAttr(llzk::function::AllowWitnessAttr::name);
821 return getOperation()->hasAttr(llzk::function::AllowNonNativeFieldOpsAttr::name);
864 inline bool isInStruct() { return ::llzk::component::isInStruct(*
this); }
918template <
typename RangeT>
920 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
923 ReturnOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = {}, const ::mlir::EmptyProperties &properties = {}, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
925 ReturnOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) :
ReturnOpGenericAdaptor(values, attrs, (properties ? *properties.as<::
mlir::EmptyProperties *>() : ::
mlir::EmptyProperties{}), regions) {}
929 template <
typename LateInst = ReturnOp,
typename = std::enable_if_t<std::is_same_v<LateInst, ReturnOp>>>
938 return {std::next(odsOperands.begin(), valueRange.first),
939 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
954 ::llvm::LogicalResult
verify(::mlir::Location loc);
956class ReturnOp :
public ::mlir::Op<ReturnOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::ZeroResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::HasParent<::llzk::function::FuncDefOp>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::MemRefsNormalizable, ::mlir::RegionBranchTerminatorOpInterface::Trait, ::mlir::OpTrait::ReturnLike, ::mlir::OpTrait::IsTerminator> {
961 template <
typename RangeT>
969 return ::llvm::StringLiteral(
"function.return");
975 return {std::next(getOperation()->operand_begin(), valueRange.first),
976 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
990 return {std::next(getOperation()->result_begin(), valueRange.first),
991 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
994 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState);
995 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands);
996 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
999 ::llvm::LogicalResult
verify();
1001 static ::mlir::ParseResult
parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
1002 void print(::mlir::OpAsmPrinter &_odsPrinter);
1003 void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::llvm::LogicalResult verify(::mlir::Location loc)
CallOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
CallOpGenericAdaptor(RangeT values, LateInst op)
::llvm::SmallVector< RangeT > getMapOperands()
CallOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs)
CallOpGenericAdaptor(RangeT values, const CallOpGenericAdaptorBase &base)
RangeT getODSOperands(unsigned index)
CallOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
CallOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::SymbolRefAttr callee, ::mlir::ValueRange argOperands={}, ::llvm::ArrayRef<::mlir::Attribute > templateParams={})
bool calleeContainsWitnessGen()
Return true iff the callee function can contain witness generation code (this does not check if the c...
void setNumDimsPerMap(::llvm::ArrayRef< int32_t > attrValue)
bool calleeIsStructConstrain()
Return true iff the callee function name is FUNC_NAME_CONSTRAIN within a StructDefOp.
::mlir::StringAttr getTemplateParamsAttrName(::mlir::OperationName name)
::mlir::StringAttr getOperandSegmentSizesAttrName()
::mlir::CallInterfaceCallable getCallableForCallee()
Return the callee of this operation.
::mlir::LogicalResult verifyTemplateParamCompatibility(::llvm::iterator_range<::mlir::Region::op_iterator<::llzk::polymorphic::TemplateParamOp > > targetParamDefs)
Check type compatibility of each template parameter value provided in this CallOp against the declare...
::llzk::component::StructType getSingleResultTypeOfCompute()
Assuming the callee is FUNC_NAME_COMPUTE, return the single StructType result.
::mlir::SymbolRefAttr getCalleeAttr()
::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable)
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
::mlir::Operation * resolveCallableInTable(::mlir::SymbolTableCollection *symbolTable)
Required by CallOpInterface.
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
static llvm::hash_code computePropertiesHash(const Properties &prop)
bool calleeIsStructCompute()
Return true iff the callee function name is FUNC_NAME_COMPUTE within a StructDefOp.
::mlir::StringAttr getNumDimsPerMapAttrName(::mlir::OperationName name)
bool calleeIsConstrain()
Return true iff the callee function name is FUNC_NAME_CONSTRAIN (this does not check if the callee fu...
static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties)
::mlir::SymbolRefAttr getCallee()
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
::mlir::Operation * resolveCallable()
Required by CallOpInterface.
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
void setMapOpGroupSizesAttr(::mlir::DenseI32ArrayAttr attr)
::llvm::LogicalResult setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
void writeProperties(::mlir::DialectBytecodeWriter &writer)
void setMapOpGroupSizes(::llvm::ArrayRef< int32_t > attrValue)
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
::mlir::StringAttr getTemplateParamsAttrName()
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
::mlir::FunctionType getTypeSignature()
Return the FunctionType inferred from the arg operands and result types of this CallOp.
bool calleeIsCompute()
Return true iff the callee function name is FUNC_NAME_COMPUTE (this does not check if the callee func...
::mlir::StringAttr getCalleeAttrName(::mlir::OperationName name)
::llvm::ArrayRef< int32_t > getMapOpGroupSizes()
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
::mlir::MutableOperandRange getArgOperandsMutable()
void setTemplateParamsAttr(::mlir::ArrayAttr attr)
::llvm::ArrayRef< int32_t > getNumDimsPerMap()
::mlir::Operation::operand_range getArgOperands()
::mlir::Value getSelfValueFromConstrain()
Return the "self" value (i.e.
::llvm::LogicalResult verifyInvariants()
::mlir::StringAttr getMapOpGroupSizesAttrName()
::mlir::ArrayAttr getTemplateParamsAttr()
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::SymbolRefAttr callee, ::llvm::ArrayRef<::mlir::ValueRange > mapOperands, ::mlir::DenseI32ArrayAttr numDimsPerMap, ::mlir::ValueRange argOperands={}, ::llvm::ArrayRef<::mlir::Attribute > templateParams={})
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
void print(::mlir::OpAsmPrinter &_odsPrinter)
static constexpr ::llvm::StringLiteral getOperationName()
::mlir::OperandRangeRange getMapOperands()
static ::llvm::SmallVector<::mlir::ValueRange > toVectorOfValueRange(::mlir::OperandRangeRange)
Allocate consecutive storage of the ValueRange instances in the parameter so it can be passed to the ...
::llzk::component::StructType getSingleResultTypeOfWitnessGen()
Assuming the callee contains witness generation code, return the single StructType result.
FoldAdaptor::Properties Properties
void setCalleeAttr(::mlir::SymbolRefAttr attr)
::mlir::DenseI32ArrayAttr getMapOpGroupSizesAttr()
::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name)
::mlir::Attribute removeTemplateParamsAttr()
CallOpGenericAdaptor< RangeT > GenericAdaptor
::std::optional< ::mlir::ArrayAttr > getTemplateParams()
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
void setNumDimsPerMapAttr(::mlir::DenseI32ArrayAttr attr)
::mlir::FailureOr< UnificationMap > unifyTypeSignature(::mlir::FunctionType other)
Attempt type unfication between the inferred FunctionType from this CallOp (as LHS) and the given Fun...
::mlir::StringAttr getNumDimsPerMapAttrName()
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
::mlir::MutableOperandRangeRange getMapOperandsMutable()
::mlir::LogicalResult verifyTemplateParamsMatchInferred(::llvm::iterator_range<::mlir::Region::op_iterator<::llzk::polymorphic::TemplateParamOp > > targetParamDefs, const UnificationMap &unifications)
Verify that each template parameter value provided in this CallOp is consistent with the value inferr...
::mlir::StringAttr getMapOpGroupSizesAttrName(::mlir::OperationName name)
::llvm::LogicalResult verifyInvariantsImpl()
::mlir::LogicalResult verifyTemplateParamCompatibility(::mlir::Attribute paramFromCallOp, ::llzk::polymorphic::TemplateParamOp targetParam)
Check type compatibility of the given template parameter value from this CallOp against the declared ...
::mlir::Operation::result_range getODSResults(unsigned index)
::mlir::StringAttr getCalleeAttrName()
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
::mlir::Value getSelfValueFromCompute()
Return the "self" value (i.e.
void setCalleeFromCallable(::mlir::CallInterfaceCallable callee)
Set the callee for this operation.
::mlir::FailureOr<::llzk::SymbolLookupResult<::llzk::function::FuncDefOp > > getCalleeTarget(::mlir::SymbolTableCollection &tables)
Resolve and return the target FuncDefOp for this CallOp.
::mlir::DenseI32ArrayAttr getNumDimsPerMapAttr()
::mlir::Operation::operand_range getODSOperands(unsigned index)
FuncDefOpAdaptor(FuncDefOp op)
FuncDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
::llvm::LogicalResult verify(::mlir::Location loc)
FuncDefOpGenericAdaptor(RangeT values, const FuncDefOpGenericAdaptorBase &base)
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
FuncDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr)
RangeT getODSOperands(unsigned index)
FuncDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
FuncDefOpGenericAdaptor(RangeT values, LateInst op)
FuncDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
::mlir::StringAttr getFunctionTypeAttrName(::mlir::OperationName name)
FuncDefOp clone(::mlir::IRMapping &mapper)
Create a deep copy of this function and all of its blocks, remapping any operands that use values out...
::mlir::StringAttr getResAttrsAttrName(::mlir::OperationName name)
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
void setAllowWitnessAttr(bool newValue=true)
Add (resp. remove) the allow_witness attribute to (resp. from) the function def.
static llvm::hash_code computePropertiesHash(const Properties &prop)
FoldAdaptor::Properties Properties
::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable)
::mlir::Value getSelfValueFromCompute()
Return the "self" value (i.e.
::mlir::FunctionType getFunctionType()
void setArgAttrsAttr(::mlir::ArrayAttr attr)
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llvm::StringRef name, ::mlir::FunctionType type, ::llvm::ArrayRef<::mlir::NamedAttribute > attrs={}, ::llvm::ArrayRef<::mlir::DictionaryAttr > argAttrs={})
::mlir::StringAttr getSymNameAttrName()
void setAllowNonNativeFieldOpsAttr(bool newValue=true)
Add (resp. remove) the allow_non_native_field_ops attribute to (resp. from) the function def.
::mlir::Operation::result_range getODSResults(unsigned index)
::llvm::ArrayRef<::mlir::Type > getArgumentTypes()
Required by FunctionOpInterface.
void setSymNameAttr(::mlir::StringAttr attr)
::mlir::StringAttr getFunctionTypeAttrName()
bool hasAllowNonNativeFieldOpsAttr()
Return true iff the function def has the allow_non_native_field_ops attribute.
::llvm::LogicalResult verifyInvariants()
::mlir::Value getSelfValueFromConstrain()
Return the "self" value (i.e.
FuncDefOpGenericAdaptor< RangeT > GenericAdaptor
static FuncDefOp create(::mlir::Location location, ::llvm::StringRef name, ::mlir::FunctionType type, ::llvm::ArrayRef<::mlir::NamedAttribute > attrs, ::llvm::ArrayRef<::mlir::DictionaryAttr > argAttrs)
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
void print(::mlir::OpAsmPrinter &p)
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
bool nameIsCompute()
Return true iff the function name is FUNC_NAME_COMPUTE (if needed, a check that this FuncDefOp is loc...
bool hasAllowWitnessAttr()
Return true iff the function def has the allow_witness attribute.
void setResAttrsAttr(::mlir::ArrayAttr attr)
::llzk::component::StructType getSingleResultTypeOfCompute()
Assuming the name is FUNC_NAME_COMPUTE, return the single StructType result.
::mlir::Attribute removeResAttrsAttr()
::mlir::StringAttr getResAttrsAttrName()
::std::optional< ::mlir::ArrayAttr > getResAttrs()
::mlir::StringAttr getArgAttrsAttrName(::mlir::OperationName name)
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
void cloneInto(FuncDefOp dest, ::mlir::IRMapping &mapper)
Clone the internal blocks and attributes from this function into dest.
::std::optional< ::mlir::ArrayAttr > getArgAttrs()
bool nameIsProduct()
Return true iff the function name is FUNC_NAME_PRODUCT (if needed, a check that this FuncDefOp is loc...
::mlir::ArrayAttr getArgAttrsAttr()
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
::mlir::Operation::operand_range getODSOperands(unsigned index)
void writeProperties(::mlir::DialectBytecodeWriter &writer)
::llvm::StringRef getSymName()
bool nameIsConstrain()
Return true iff the function name is FUNC_NAME_CONSTRAIN (if needed, a check that this FuncDefOp is l...
static FuncDefOp create(::mlir::Location location, ::llvm::StringRef name, ::mlir::FunctionType type, ::mlir::Operation::dialect_attr_range attrs)
bool isStructCompute()
Return true iff the function is within a StructDefOp and named FUNC_NAME_COMPUTE.
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
bool isInStruct()
Return true iff the function is within a StructDefOp.
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
::mlir::StringAttr getSymNameAttrName(::mlir::OperationName name)
void setFunctionType(::mlir::FunctionType attrValue)
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
bool isDeclaration()
Required by SymbolOpInterface.
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
::llvm::ArrayRef<::mlir::Type > getResultTypes()
Required by FunctionOpInterface.
static constexpr ::llvm::StringLiteral getOperationName()
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
bool isStructConstrain()
Return true iff the function is within a StructDefOp and named FUNC_NAME_CONSTRAIN.
void setAllowConstraintAttr(bool newValue=true)
Add (resp. remove) the allow_constraint attribute to (resp. from) the function def.
void setSymName(::llvm::StringRef attrValue)
static FuncDefOp create(::mlir::Location location, ::llvm::StringRef name, ::mlir::FunctionType type, ::llvm::ArrayRef<::mlir::NamedAttribute > attrs={})
::mlir::SymbolRefAttr getFullyQualifiedName(bool requireParent=true)
Return the full name for this function from the root module, including all surrounding symbol table n...
::mlir::TypeAttr getFunctionTypeAttr()
bool hasArgPublicAttr(unsigned index)
Return true iff the argument at the given index has pub attribute.
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
::mlir::Region * getCallableRegion()
Required by FunctionOpInterface.
::llvm::LogicalResult verify()
::mlir::Region & getBody()
::mlir::StringAttr getSymNameAttr()
::mlir::ArrayAttr getResAttrsAttr()
::llvm::LogicalResult verifyInvariantsImpl()
bool isStructProduct()
Return true iff the function is within a StructDefOp and named FUNC_NAME_PRODUCT.
bool hasAllowConstraintAttr()
Return true iff the function def has the allow_constraint attribute.
void setFunctionTypeAttr(::mlir::TypeAttr attr)
::mlir::StringAttr getArgAttrsAttrName()
::mlir::Attribute removeArgAttrsAttr()
ReturnOpAdaptor(ReturnOp op)
ReturnOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
::llvm::LogicalResult verify(::mlir::Location loc)
ReturnOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
ReturnOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
RangeT getODSOperands(unsigned index)
ReturnOpGenericAdaptor(RangeT values, const ReturnOpGenericAdaptorBase &base)
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
ReturnOpGenericAdaptor(RangeT values, LateInst op)
void print(::mlir::OpAsmPrinter &_odsPrinter)
::mlir::Operation::result_range getODSResults(unsigned index)
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
::llvm::LogicalResult verifyInvariantsImpl()
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState)
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
::mlir::Operation::operand_range getODSOperands(unsigned index)
::mlir::MutableOperandRange getMutableSuccessorOperands(::mlir::RegionBranchPoint point)
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
::llvm::LogicalResult verify()
static constexpr ::llvm::StringLiteral getOperationName()
::mlir::MutableOperandRange getOperandsMutable()
ReturnOpGenericAdaptor< RangeT > GenericAdaptor
::mlir::Operation::operand_range getOperands()
::llvm::LogicalResult verifyInvariants()
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
CallOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
::mlir::SymbolRefAttr getCallee()
::mlir::DenseI32ArrayAttr getMapOpGroupSizesAttr()
::mlir::DictionaryAttr odsAttrs
::llvm::ArrayRef< int32_t > getMapOpGroupSizes()
::std::optional< ::mlir::ArrayAttr > getTemplateParams()
::mlir::DictionaryAttr getAttributes()
::mlir::DenseI32ArrayAttr getNumDimsPerMapAttr()
::mlir::SymbolRefAttr getCalleeAttr()
::std::optional<::mlir::OperationName > odsOpName
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
::llvm::ArrayRef< int32_t > getNumDimsPerMap()
::mlir::RegionRange odsRegions
const Properties & getProperties()
::mlir::ArrayAttr getTemplateParamsAttr()
::std::optional< ::mlir::ArrayAttr > getResAttrs()
::std::optional< ::mlir::ArrayAttr > getArgAttrs()
::mlir::ArrayAttr getArgAttrsAttr()
::mlir::StringAttr getSymNameAttr()
::mlir::RegionRange getRegions()
::mlir::TypeAttr getFunctionTypeAttr()
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
::mlir::DictionaryAttr odsAttrs
const Properties & getProperties()
FuncDefOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
::mlir::FunctionType getFunctionType()
::std::optional<::mlir::OperationName > odsOpName
::mlir::Region & getBody()
::llvm::StringRef getSymName()
::mlir::DictionaryAttr getAttributes()
::mlir::RegionRange odsRegions
::mlir::ArrayAttr getResAttrsAttr()
::mlir::DictionaryAttr odsAttrs
ReturnOpGenericAdaptorBase(::mlir::Operation *op)
::std::optional<::mlir::OperationName > odsOpName
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
::mlir::RegionRange odsRegions
::mlir::DictionaryAttr getAttributes()
ReturnOpGenericAdaptorBase(::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
constexpr char FUNC_NAME_COMPUTE[]
Symbol name for the witness generation (and resp.
constexpr char FUNC_NAME_CONSTRAIN[]
mlir::DenseMap< std::pair< mlir::SymbolRefAttr, Side >, mlir::Attribute > UnificationMap
Optional result from type unifications.
constexpr char FUNC_NAME_PRODUCT[]
::mlir::DenseI32ArrayAttr numDimsPerMapTy
auto getMapOpGroupSizes()
bool operator==(const Properties &rhs) const
operandSegmentSizesTy operandSegmentSizes
bool operator!=(const Properties &rhs) const
numDimsPerMapTy numDimsPerMap
void setTemplateParams(const ::mlir::ArrayAttr &propValue)
mapOpGroupSizesTy mapOpGroupSizes
void setOperandSegmentSizes(::llvm::ArrayRef< int32_t > propValue)
::mlir::ArrayAttr templateParamsTy
void setNumDimsPerMap(const ::mlir::DenseI32ArrayAttr &propValue)
templateParamsTy templateParams
void setMapOpGroupSizes(const ::mlir::DenseI32ArrayAttr &propValue)
std::array< int32_t, 2 > operandSegmentSizesTy
::mlir::DenseI32ArrayAttr mapOpGroupSizesTy
::mlir::SymbolRefAttr calleeTy
void setCallee(const ::mlir::SymbolRefAttr &propValue)
::llvm::ArrayRef< int32_t > getOperandSegmentSizes() const
bool operator==(const Properties &rhs) const
void setResAttrs(const ::mlir::ArrayAttr &propValue)
bool operator!=(const Properties &rhs) const
void setSymName(const ::mlir::StringAttr &propValue)
::mlir::ArrayAttr res_attrsTy
void setArgAttrs(const ::mlir::ArrayAttr &propValue)
void setFunctionType(const ::mlir::TypeAttr &propValue)
::mlir::ArrayAttr arg_attrsTy
::mlir::StringAttr sym_nameTy
::mlir::TypeAttr function_typeTy
function_typeTy function_type