[Mlir-commits] [llvm] [mlir] [mlir][EmitC] Add MathToEmitC pass for math function lowering to EmitC (PR #113799)

Marius Brehler llvmlistbot at llvm.org
Mon Oct 28 03:02:38 PDT 2024


================
@@ -0,0 +1,25 @@
+//===- MathToEmitC.h - Math to EmitC Pass -----------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef MLIR_CONVERSION_MATHTOEMITC_MATHTOEMITC_H
+#define MLIR_CONVERSION_MATHTOEMITC_MATHTOEMITC_H
+
+#include "mlir/IR/BuiltinOps.h"
+#include "mlir/Pass/Pass.h"
+#include <memory>
+
+namespace mlir {
+
+#define GEN_PASS_DECL_CONVERTMATHTOEMITC
+#include "mlir/Conversion/Passes.h.inc"
+
+std::unique_ptr<OperationPass<mlir::ModuleOp>> createConvertMathToEmitCPass();
+
+} // namespace mlir
----------------
marbre wrote:

For most conversions to EmitC, we splited into `*ToEmitC.h` and `ToEmitCPass.h`, see for example https://github.com/llvm/llvm-project/tree/main/mlir/include/mlir/Conversion/ArithToEmitC and https://github.com/llvm/llvm-project/tree/main/mlir/include/mlir/Conversion/FuncToEmitC. I think this would be nice to have here as well.

https://github.com/llvm/llvm-project/pull/113799


More information about the Mlir-commits mailing list