/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
|*                                                                            *|
|* Dialect Interface Declarations                                             *|
|*                                                                            *|
|* Automatically generated file, do not edit!                                 *|
|*                                                                            *|
\*===----------------------------------------------------------------------===*/

namespace mlir {

/// Define a fold interface to allow for dialects to control specific aspects
/// of the folding behavior for operations they define.
class DialectFoldInterface : public ::mlir::DialectInterface::Base<DialectFoldInterface> {
public:
  
  /// Registered fallback fold for the dialect. Like the fold hook of each
  /// operation, it attempts to fold the operation with the specified constant
  /// operand values - the elements in "operands" will correspond directly to
  /// the operands of the operation, but may be null if non-constant.  If
  /// folding is successful, this fills in the `results` vector.  If not, this
  /// returns failure and `results` is unspecified.
  virtual ::mlir::LogicalResult fold(::mlir::Operation * op, ::mlir::ArrayRef<Attribute> operands, ::mlir::SmallVectorImpl<OpFoldResult> & results) const {
    return failure();
  }

  /// Registered hook to check if the given region, which is attached to an
  /// operation that is *not* isolated from above, should be used when
  /// materializing constants. The folder will generally materialize constants
  /// into the top-level isolated region, this allows for materializing into a
  /// lower level ancestor region if it is more profitable/correct.
  virtual bool shouldMaterializeInto(::mlir::Region * region) const {
    return false;
  }

  DialectFoldInterface(::mlir::Dialect *dialect) : Base(dialect) {}
};

} // namespace mlir
