#include "mlir/Dialect/Arith/IR/Arith.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"
namespace mlir::math {
#define GEN_PASS_DEF_MATHLEGALIZETOF32
#include "mlir/Dialect/Math/Transforms/Passes.h.inc"
}
usingnamespacemlir;
namespace {
struct LegalizeToF32RewritePattern final : ConversionPattern { … };
struct LegalizeToF32Pass final
: mlir::math::impl::MathLegalizeToF32Base<LegalizeToF32Pass> { … };
}
void mlir::math::populateLegalizeToF32TypeConverter(
TypeConverter &typeConverter) { … }
void mlir::math::populateLegalizeToF32ConversionTarget(
ConversionTarget &target, TypeConverter &typeConverter) { … }
LogicalResult LegalizeToF32RewritePattern::matchAndRewrite(
Operation *op, ArrayRef<Value> operands,
ConversionPatternRewriter &rewriter) const { … }
void mlir::math::populateLegalizeToF32Patterns(RewritePatternSet &patterns,
TypeConverter &typeConverter) { … }
void LegalizeToF32Pass::runOnOperation() { … }