69template <
typename RangeT>
71 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
73 static constexpr int odsIndex_lhs = 0;
74 static constexpr int odsIndex_rhs = 1;
84 template <
typename LateInst = EmitContainmentOp,
typename = std::enable_if_t<std::is_same_v<LateInst, EmitContainmentOp>>>
93 return {std::next(odsOperands.begin(), valueRange.first),
94 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
117 ::llvm::LogicalResult
verify(::mlir::Location loc);
119class EmitContainmentOp :
public ::mlir::Op<EmitContainmentOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::ZeroResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::llzk::function::ConstraintGen, ::mlir::OpTrait::OpInvariants, ::llzk::constrain::ConstraintOpInterface::Trait, ::mlir::SymbolUserOpInterface::Trait> {
124 template <
typename RangeT>
135 return ::llvm::StringLiteral(
"constrain.in");
144 return {std::next(getOperation()->operand_begin(), valueRange.first),
145 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
148 ::mlir::TypedValue<::llzk::array::ArrayType>
getLhs() {
149 return ::llvm::cast<::mlir::TypedValue<::llzk::array::ArrayType>>(*
getODSOperands(0).begin());
152 ::mlir::TypedValue<::mlir::Type>
getRhs() {
153 return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(*
getODSOperands(1).begin());
158 return getOperation()->getOpOperand(range.first);
163 return getOperation()->getOpOperand(range.first);
172 return {std::next(getOperation()->result_begin(), valueRange.first),
173 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
176 static ::llvm::LogicalResult
setPropertiesFromAttr(
Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
179 static std::optional<mlir::Attribute>
getInherentAttr(::mlir::MLIRContext *ctx,
const Properties &prop, llvm::StringRef name);
182 static ::llvm::LogicalResult
verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
183 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs);
184 static EmitContainmentOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs);
186 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs);
187 static EmitContainmentOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs);
188 static EmitContainmentOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs);
189 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
190 static EmitContainmentOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
191 static EmitContainmentOp
create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
192 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands,
const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {});
193 static EmitContainmentOp
create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands,
const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {});
194 static EmitContainmentOp
create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands,
const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {});
197 ::llvm::LogicalResult
verify();
198 ::llvm::LogicalResult
verifySymbolUses(::mlir::SymbolTableCollection &symbolTable);
199 static ::mlir::ParseResult
parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
200 void print(::mlir::OpAsmPrinter &_odsPrinter);
246template <
typename RangeT>
248 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
250 static constexpr int odsIndex_lhs = 0;
251 static constexpr int odsIndex_rhs = 1;
261 template <
typename LateInst = EmitEqualityOp,
typename = std::enable_if_t<std::is_same_v<LateInst, EmitEqualityOp>>>
270 return {std::next(odsOperands.begin(), valueRange.first),
271 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
294 ::llvm::LogicalResult
verify(::mlir::Location loc);
296class EmitEqualityOp :
public ::mlir::Op<EmitEqualityOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::ZeroResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::llzk::function::ConstraintGen, ::mlir::OpTrait::OpInvariants, ::mlir::OpTrait::IsCommutative, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable, ::llzk::constrain::ConstraintOpInterface::Trait, ::mlir::SymbolUserOpInterface::Trait> {
301 template <
typename RangeT>
312 return ::llvm::StringLiteral(
"constrain.eq");
321 return {std::next(getOperation()->operand_begin(), valueRange.first),
322 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
325 ::mlir::TypedValue<::mlir::Type>
getLhs() {
326 return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(*
getODSOperands(0).begin());
329 ::mlir::TypedValue<::mlir::Type>
getRhs() {
330 return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(*
getODSOperands(1).begin());
335 return getOperation()->getOpOperand(range.first);
340 return getOperation()->getOpOperand(range.first);
349 return {std::next(getOperation()->result_begin(), valueRange.first),
350 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
353 static ::llvm::LogicalResult
setPropertiesFromAttr(
Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
356 static std::optional<mlir::Attribute>
getInherentAttr(::mlir::MLIRContext *ctx,
const Properties &prop, llvm::StringRef name);
359 static ::llvm::LogicalResult
verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
360 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs);
361 static EmitEqualityOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs);
362 static EmitEqualityOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs);
363 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs);
364 static EmitEqualityOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs);
365 static EmitEqualityOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs);
366 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
367 static EmitEqualityOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
368 static EmitEqualityOp
create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
369 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands,
const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {});
370 static EmitEqualityOp
create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands,
const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {});
371 static EmitEqualityOp
create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands,
const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {});
374 ::llvm::LogicalResult
verifySymbolUses(::mlir::SymbolTableCollection &symbolTable);
375 static ::mlir::ParseResult
parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
376 void print(::mlir::OpAsmPrinter &_odsPrinter);
379 static ::mlir::Type inferRHS(::mlir::Type lhsType);
381 static ::mlir::ParseResult parseInferredOrParsedType(::mlir::OpAsmParser &parser,
382 ::mlir::Type &rhsType, ::mlir::Type lhsType
384 if (mlir::succeeded(parser.parseOptionalComma())) {
387 if (parser.parseCustomTypeWithFallback(type)) {
388 return mlir::failure();
393 rhsType = inferRHS(lhsType);
395 return mlir::success();
398 static void printInferredOrParsedType(::mlir::OpAsmPrinter &printer,
399 ::mlir::Operation *op, ::mlir::Type rhsType, ::mlir::Type lhsType
402 printer.printStrippedAttrOrType(rhsType);
EmitContainmentOpAdaptor(EmitContainmentOp op)
EmitContainmentOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
::llvm::LogicalResult verify(::mlir::Location loc)
EmitContainmentOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr)
EmitContainmentOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions={})
EmitContainmentOpGenericAdaptor(RangeT values, const EmitContainmentOpGenericAdaptorBase &base)
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
EmitContainmentOpGenericAdaptor(RangeT values, LateInst op)
EmitContainmentOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
RangeT getODSOperands(unsigned index)
static EmitContainmentOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs)
::llvm::LogicalResult verifyInvariantsImpl()
EmitContainmentOpGenericAdaptor< RangeT > GenericAdaptor
::llvm::LogicalResult verifyInvariants()
static constexpr int odsIndex_lhs
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs)
::mlir::Operation::result_range getODSResults(unsigned index)
::llvm::LogicalResult verify()
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
static constexpr int odsIndex_rhs
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable)
static constexpr ::llvm::StringLiteral getOperationName()
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
::mlir::TypedValue<::mlir::Type > getRhs()
FoldAdaptor::Properties Properties
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
::mlir::Operation::operand_range getODSOperands(unsigned index)
static llvm::hash_code computePropertiesHash(const Properties &prop)
void print(::mlir::OpAsmPrinter &_odsPrinter)
EmitContainmentOpAdaptor Adaptor
::mlir::OpOperand & getRhsMutable()
::mlir::TypedValue<::llzk::array::ArrayType > getLhs()
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
::mlir::OpOperand & getLhsMutable()
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
EmitEqualityOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
::llvm::LogicalResult verify(::mlir::Location loc)
EmitEqualityOpAdaptor(EmitEqualityOp op)
EmitEqualityOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
EmitEqualityOpGenericAdaptor(RangeT values, const EmitEqualityOpGenericAdaptorBase &base)
EmitEqualityOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions={})
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
EmitEqualityOpGenericAdaptor(RangeT values, LateInst op)
RangeT getODSOperands(unsigned index)
EmitEqualityOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr)
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
static constexpr ::llvm::StringLiteral getOperationName()
FoldAdaptor::Properties Properties
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
EmitEqualityOpAdaptor Adaptor
::mlir::OpOperand & getRhsMutable()
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
static llvm::hash_code computePropertiesHash(const Properties &prop)
::mlir::TypedValue<::mlir::Type > getLhs()
::mlir::Operation::operand_range getODSOperands(unsigned index)
::mlir::Operation::result_range getODSResults(unsigned index)
static constexpr int odsIndex_rhs
void print(::mlir::OpAsmPrinter &_odsPrinter)
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable)
static constexpr int odsIndex_lhs
::llvm::LogicalResult verifyInvariants()
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs)
::llvm::LogicalResult verifyInvariantsImpl()
static EmitEqualityOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs)
::mlir::OpOperand & getLhsMutable()
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
::mlir::TypedValue<::mlir::Type > getRhs()
EmitEqualityOpGenericAdaptor< RangeT > GenericAdaptor
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
::mlir::RegionRange odsRegions
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
::mlir::EmptyProperties Properties
const Properties & getProperties()
::mlir::DictionaryAttr getAttributes()
::std::optional<::mlir::OperationName > odsOpName
EmitContainmentOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
::mlir::DictionaryAttr odsAttrs
::mlir::DictionaryAttr getAttributes()
::std::optional<::mlir::OperationName > odsOpName
::mlir::DictionaryAttr odsAttrs
EmitEqualityOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
::mlir::RegionRange odsRegions
::mlir::EmptyProperties Properties
const Properties & getProperties()
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Common interface for operations that produce a constraint.