#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/Math/IR/Math.h"
#include "mlir/Dialect/Math/Transforms/Passes.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"
namespace mlir::math {
#define GEN_PASS_DEF_MATHUPLIFTTOFMA
#include "mlir/Dialect/Math/Transforms/Passes.h.inc"
}
usingnamespacemlir;
template <typename Op>
static bool isValidForFMA(Op op) { … }
namespace {
struct UpliftFma final : OpRewritePattern<arith::AddFOp> { … };
struct MathUpliftToFMA final
: math::impl::MathUpliftToFMABase<MathUpliftToFMA> { … };
}
void mlir::populateUpliftToFMAPatterns(RewritePatternSet &patterns) { … }