/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\ |* *| |* Interface Declarations *| |* *| |* Automatically generated file, do not edit! *| |* *| \*===----------------------------------------------------------------------===*/ namespace mlir { /// Allows operations to participate in range analysis for scalar integer values by /// providing a methods that allows them to specify lower and upper bounds on their /// result(s) given lower and upper bounds on their input(s) if known. class InferIntRangeInterface; } // namespace mlir namespace mlir { /// Allows operations to participate in range analysis for scalar integer values by /// providing a methods that allows them to specify lower and upper bounds on their /// result(s) given lower and upper bounds on their input(s) if known. namespace detail { struct InferIntRangeInterfaceInterfaceTraits { struct Concept { /// The methods defined by the interface. void (*inferResultRanges)(const Concept *impl, ::mlir::Operation *, ::llvm::ArrayRef<::mlir::ConstantIntRanges>, ::mlir::SetIntRangeFn); void (*inferResultRangesFromOptional)(const Concept *impl, ::mlir::Operation *, ::llvm::ArrayRef<::mlir::IntegerValueRange>, ::mlir::SetIntLatticeFn); }; template class Model : public Concept { public: using Interface = ::mlir::InferIntRangeInterface; Model() : Concept{inferResultRanges, inferResultRangesFromOptional} {} static inline void inferResultRanges(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, ::llvm::ArrayRef<::mlir::ConstantIntRanges> argRanges, ::mlir::SetIntRangeFn setResultRanges); static inline void inferResultRangesFromOptional(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, ::llvm::ArrayRef<::mlir::IntegerValueRange> argRanges, ::mlir::SetIntLatticeFn setResultRanges); }; template class FallbackModel : public Concept { public: using Interface = ::mlir::InferIntRangeInterface; FallbackModel() : Concept{inferResultRanges, inferResultRangesFromOptional} {} static inline void inferResultRanges(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, ::llvm::ArrayRef<::mlir::ConstantIntRanges> argRanges, ::mlir::SetIntRangeFn setResultRanges); static inline void inferResultRangesFromOptional(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, ::llvm::ArrayRef<::mlir::IntegerValueRange> argRanges, ::mlir::SetIntLatticeFn setResultRanges); }; template class ExternalModel : public FallbackModel { public: using ConcreteEntity = ConcreteOp; void inferResultRanges(::mlir::Operation *tablegen_opaque_val, ::llvm::ArrayRef<::mlir::ConstantIntRanges> argRanges, ::mlir::SetIntRangeFn setResultRanges) const; void inferResultRangesFromOptional(::mlir::Operation *tablegen_opaque_val, ::llvm::ArrayRef<::mlir::IntegerValueRange> argRanges, ::mlir::SetIntLatticeFn setResultRanges) const; }; }; template struct InferIntRangeInterfaceTrait; } // namespace detail class InferIntRangeInterface : public ::mlir::OpInterface { public: using ::mlir::OpInterface::OpInterface; template struct Trait : public detail::InferIntRangeInterfaceTrait {}; /// Infer the bounds on the results of this op given the bounds on its arguments. /// For each result value or block argument (that isn't a branch argument, /// since the dataflow analysis handles those case), the method should call /// `setValueRange` with that `Value` as an argument. When implemented, /// `setValueRange` should be called on all result values for the operation. /// When operations take non-integer inputs, the /// `inferResultRangesFromOptional` method should be implemented instead. /// /// When called on an op that also implements the RegionBranchOpInterface /// or BranchOpInterface, this method should not attempt to infer the values /// of the branch results, as this will be handled by the analyses that use /// this interface. /// /// This function will only be called when at least one result of the op is a /// scalar integer value or the op has a region. void inferResultRanges(::llvm::ArrayRef<::mlir::ConstantIntRanges> argRanges, ::mlir::SetIntRangeFn setResultRanges); /// Infer the bounds on the results of this op given the lattice representation /// of the bounds for its arguments. For each result value or block argument /// (that isn't a branch argument, since the dataflow analysis handles /// those case), the method should call `setValueRange` with that `Value` /// as an argument. When implemented, `setValueRange` should be called on /// all result values for the operation. /// /// This method allows for more precise implementations when operations /// want to reason about inputs which may be undefined during the analysis. void inferResultRangesFromOptional(::llvm::ArrayRef<::mlir::IntegerValueRange> argRanges, ::mlir::SetIntLatticeFn setResultRanges); }; } // namespace mlir namespace mlir::detail { template struct InferIntRangeInterfaceTrait : public ::mlir::OpInterface::Trait { /// Infer the bounds on the results of this op given the bounds on its arguments. /// For each result value or block argument (that isn't a branch argument, /// since the dataflow analysis handles those case), the method should call /// `setValueRange` with that `Value` as an argument. When implemented, /// `setValueRange` should be called on all result values for the operation. /// When operations take non-integer inputs, the /// `inferResultRangesFromOptional` method should be implemented instead. /// /// When called on an op that also implements the RegionBranchOpInterface /// or BranchOpInterface, this method should not attempt to infer the values /// of the branch results, as this will be handled by the analyses that use /// this interface. /// /// This function will only be called when at least one result of the op is a /// scalar integer value or the op has a region. void inferResultRanges(::llvm::ArrayRef<::mlir::ConstantIntRanges> argRanges, ::mlir::SetIntRangeFn setResultRanges) { ::mlir::intrange::detail::defaultInferResultRangesFromOptional((*static_cast(this)), argRanges, setResultRanges); } /// Infer the bounds on the results of this op given the lattice representation /// of the bounds for its arguments. For each result value or block argument /// (that isn't a branch argument, since the dataflow analysis handles /// those case), the method should call `setValueRange` with that `Value` /// as an argument. When implemented, `setValueRange` should be called on /// all result values for the operation. /// /// This method allows for more precise implementations when operations /// want to reason about inputs which may be undefined during the analysis. void inferResultRangesFromOptional(::llvm::ArrayRef<::mlir::IntegerValueRange> argRanges, ::mlir::SetIntLatticeFn setResultRanges) { ::mlir::intrange::detail::defaultInferResultRanges((*static_cast(this)), argRanges, setResultRanges); } }; } // namespace mlir::detail namespace mlir { template void detail::InferIntRangeInterfaceInterfaceTraits::Model::inferResultRanges(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, ::llvm::ArrayRef<::mlir::ConstantIntRanges> argRanges, ::mlir::SetIntRangeFn setResultRanges) { return (llvm::cast(tablegen_opaque_val)).inferResultRanges(argRanges, setResultRanges); } template void detail::InferIntRangeInterfaceInterfaceTraits::Model::inferResultRangesFromOptional(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, ::llvm::ArrayRef<::mlir::IntegerValueRange> argRanges, ::mlir::SetIntLatticeFn setResultRanges) { return (llvm::cast(tablegen_opaque_val)).inferResultRangesFromOptional(argRanges, setResultRanges); } template void detail::InferIntRangeInterfaceInterfaceTraits::FallbackModel::inferResultRanges(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, ::llvm::ArrayRef<::mlir::ConstantIntRanges> argRanges, ::mlir::SetIntRangeFn setResultRanges) { return static_cast(impl)->inferResultRanges(tablegen_opaque_val, argRanges, setResultRanges); } template void detail::InferIntRangeInterfaceInterfaceTraits::FallbackModel::inferResultRangesFromOptional(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, ::llvm::ArrayRef<::mlir::IntegerValueRange> argRanges, ::mlir::SetIntLatticeFn setResultRanges) { return static_cast(impl)->inferResultRangesFromOptional(tablegen_opaque_val, argRanges, setResultRanges); } template void detail::InferIntRangeInterfaceInterfaceTraits::ExternalModel::inferResultRanges(::mlir::Operation *tablegen_opaque_val, ::llvm::ArrayRef<::mlir::ConstantIntRanges> argRanges, ::mlir::SetIntRangeFn setResultRanges) const { ::mlir::intrange::detail::defaultInferResultRangesFromOptional((llvm::cast(tablegen_opaque_val)), argRanges, setResultRanges); } template void detail::InferIntRangeInterfaceInterfaceTraits::ExternalModel::inferResultRangesFromOptional(::mlir::Operation *tablegen_opaque_val, ::llvm::ArrayRef<::mlir::IntegerValueRange> argRanges, ::mlir::SetIntLatticeFn setResultRanges) const { ::mlir::intrange::detail::defaultInferResultRanges((llvm::cast(tablegen_opaque_val)), argRanges, setResultRanges); } } // namespace mlir