xref: /llvm-project/mlir/include/mlir/Dialect/Math/Transforms/Approximation.h (revision 8f23296bccec83cf4c455f1f4bb7f800faaefe94)
1 //===- Approximation.h - Math dialect -----------------------------*- C++-*-==//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef MLIR_DIALECT_MATH_TRANSFORMS_APPROXIMATION_H
10 #define MLIR_DIALECT_MATH_TRANSFORMS_APPROXIMATION_H
11 
12 #include "mlir/Dialect/Math/IR/Math.h"
13 #include "mlir/IR/PatternMatch.h"
14 
15 namespace mlir {
16 namespace math {
17 
18 struct ErfPolynomialApproximation : public OpRewritePattern<math::ErfOp> {
19 public:
20   using OpRewritePattern::OpRewritePattern;
21 
22   LogicalResult matchAndRewrite(math::ErfOp op,
23                                 PatternRewriter &rewriter) const final;
24 };
25 
26 } // namespace math
27 } // namespace mlir
28 
29 #endif // MLIR_DIALECT_MATH_TRANSFORMS_APPROXIMATION_H
30