#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/Arith/Utils/Utils.h"
#include "mlir/Dialect/Math/IR/Math.h"
#include "mlir/Dialect/Math/Transforms/Passes.h"
#include "mlir/IR/Diagnostics.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/IR/TypeUtilities.h"
#include "mlir/Transforms/DialectConversion.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SetVector.h"
namespace mlir::math {
#define GEN_PASS_DEF_MATHEXTENDTOSUPPORTEDTYPES
#include "mlir/Dialect/Math/Transforms/Passes.h.inc"
}
usingnamespacemlir;
namespace {
struct ExtendToSupportedTypesRewritePattern final : ConversionPattern { … };
struct ExtendToSupportedTypesPass
: mlir::math::impl::MathExtendToSupportedTypesBase<
ExtendToSupportedTypesPass> { … };
}
void mlir::math::populateExtendToSupportedTypesTypeConverter(
TypeConverter &typeConverter, const SetVector<Type> &sourceTypes,
Type targetType) { … }
void mlir::math::populateExtendToSupportedTypesConversionTarget(
ConversionTarget &target, TypeConverter &typeConverter) { … }
LogicalResult ExtendToSupportedTypesRewritePattern::matchAndRewrite(
Operation *op, ArrayRef<Value> operands,
ConversionPatternRewriter &rewriter) const { … }
void mlir::math::populateExtendToSupportedTypesPatterns(
RewritePatternSet &patterns, const TypeConverter &typeConverter) { … }
void ExtendToSupportedTypesPass::runOnOperation() { … }