54template <
typename RangeT>
56 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
59 EmitContainmentOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = {}, const ::mlir::EmptyProperties &properties = {}, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
65 template <
typename LateInst = EmitContainmentOp,
typename = std::enable_if_t<std::is_same_v<LateInst, EmitContainmentOp>>>
74 return {std::next(odsOperands.begin(), valueRange.first),
75 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
98 ::llvm::LogicalResult
verify(::mlir::Location loc);
100class 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> {
105 template <
typename RangeT>
113 return ::llvm::StringLiteral(
"constrain.in");
122 return {std::next(getOperation()->operand_begin(), valueRange.first),
123 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
126 ::mlir::TypedValue<::llzk::array::ArrayType>
getLhs() {
127 return ::llvm::cast<::mlir::TypedValue<::llzk::array::ArrayType>>(*
getODSOperands(0).begin());
130 ::mlir::TypedValue<::mlir::Type>
getRhs() {
131 return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(*
getODSOperands(1).begin());
136 return getOperation()->getOpOperand(range.first);
141 return getOperation()->getOpOperand(range.first);
150 return {std::next(getOperation()->result_begin(), valueRange.first),
151 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
154 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs);
155 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs);
156 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
159 ::llvm::LogicalResult
verify();
160 ::llvm::LogicalResult
verifySymbolUses(::mlir::SymbolTableCollection &symbolTable);
161 static ::mlir::ParseResult
parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
162 void print(::mlir::OpAsmPrinter &_odsPrinter);
200template <
typename RangeT>
202 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
205 EmitEqualityOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = {}, const ::mlir::EmptyProperties &properties = {}, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
211 template <
typename LateInst = EmitEqualityOp,
typename = std::enable_if_t<std::is_same_v<LateInst, EmitEqualityOp>>>
220 return {std::next(odsOperands.begin(), valueRange.first),
221 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
244 ::llvm::LogicalResult
verify(::mlir::Location loc);
246class 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> {
251 template <
typename RangeT>
259 return ::llvm::StringLiteral(
"constrain.eq");
268 return {std::next(getOperation()->operand_begin(), valueRange.first),
269 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
272 ::mlir::TypedValue<::mlir::Type>
getLhs() {
273 return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(*
getODSOperands(0).begin());
276 ::mlir::TypedValue<::mlir::Type>
getRhs() {
277 return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(*
getODSOperands(1).begin());
282 return getOperation()->getOpOperand(range.first);
287 return getOperation()->getOpOperand(range.first);
296 return {std::next(getOperation()->result_begin(), valueRange.first),
297 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
300 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs);
301 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs);
302 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
305 ::llvm::LogicalResult
verifySymbolUses(::mlir::SymbolTableCollection &symbolTable);
306 static ::mlir::ParseResult
parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
307 void print(::mlir::OpAsmPrinter &_odsPrinter);
309 static ::mlir::Type
inferRHS(::mlir::Type lhsType);
312 ::mlir::Type &rhsType, ::mlir::Type lhsType
314 if (mlir::succeeded(parser.parseOptionalComma())) {
317 if (parser.parseCustomTypeWithFallback(type)) {
318 return mlir::failure();
325 return mlir::success();
329 ::mlir::Operation *op, ::mlir::Type rhsType, ::mlir::Type lhsType
332 printer.printStrippedAttrOrType(rhsType);
EmitContainmentOpAdaptor(EmitContainmentOp op)
::llvm::LogicalResult verify(::mlir::Location loc)
EmitContainmentOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
EmitContainmentOpGenericAdaptor(RangeT values, const EmitContainmentOpGenericAdaptorBase &base)
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
EmitContainmentOpGenericAdaptor(RangeT values, LateInst op)
RangeT getODSOperands(unsigned index)
EmitContainmentOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
EmitContainmentOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
::llvm::LogicalResult verifyInvariantsImpl()
EmitContainmentOpGenericAdaptor< RangeT > GenericAdaptor
::llvm::LogicalResult verifyInvariants()
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()
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable)
static constexpr ::llvm::StringLiteral getOperationName()
::mlir::TypedValue<::mlir::Type > getRhs()
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
::mlir::Operation::operand_range getODSOperands(unsigned index)
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()
::llvm::LogicalResult verify(::mlir::Location loc)
EmitEqualityOpAdaptor(EmitEqualityOp op)
EmitEqualityOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
EmitEqualityOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
EmitEqualityOpGenericAdaptor(RangeT values, const EmitEqualityOpGenericAdaptorBase &base)
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
EmitEqualityOpGenericAdaptor(RangeT values, LateInst op)
EmitEqualityOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
RangeT getODSOperands(unsigned index)
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
static void printInferredOrParsedType(::mlir::OpAsmPrinter &printer, ::mlir::Operation *op, ::mlir::Type rhsType, ::mlir::Type lhsType)
static constexpr ::llvm::StringLiteral getOperationName()
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
EmitEqualityOpAdaptor Adaptor
::mlir::OpOperand & getRhsMutable()
::mlir::Type inferRHS(::mlir::Type lhsType)
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
::mlir::TypedValue<::mlir::Type > getLhs()
::mlir::Operation::operand_range getODSOperands(unsigned index)
::mlir::Operation::result_range getODSResults(unsigned index)
void print(::mlir::OpAsmPrinter &_odsPrinter)
::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable)
::mlir::ParseResult parseInferredOrParsedType(::mlir::OpAsmParser &parser, ::mlir::Type &rhsType, ::mlir::Type lhsType)
::llvm::LogicalResult verifyInvariants()
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs)
::llvm::LogicalResult verifyInvariantsImpl()
::mlir::OpOperand & getLhsMutable()
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
::mlir::TypedValue<::mlir::Type > getRhs()
EmitEqualityOpGenericAdaptor< RangeT > GenericAdaptor
::mlir::RegionRange odsRegions
EmitContainmentOpGenericAdaptorBase(::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
EmitContainmentOpGenericAdaptorBase(::mlir::Operation *op)
::mlir::DictionaryAttr getAttributes()
::std::optional<::mlir::OperationName > odsOpName
::mlir::DictionaryAttr odsAttrs
::mlir::DictionaryAttr getAttributes()
::std::optional<::mlir::OperationName > odsOpName
::mlir::DictionaryAttr odsAttrs
EmitEqualityOpGenericAdaptorBase(::mlir::Operation *op)
::mlir::RegionRange odsRegions
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
EmitEqualityOpGenericAdaptorBase(::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})