[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


================
@@ -780,6 +780,25 @@ def ConvertMathToSPIRV : Pass<"convert-math-to-spirv"> {
   let dependentDialects = ["spirv::SPIRVDialect"];
 }
 
+//===----------------------------------------------------------------------===//
+// MathToEmitC
+//===----------------------------------------------------------------------===//
+
+def ConvertMathToEmitC  : Pass<"convert-math-to-emitc", "ModuleOp"> {
+  let summary = "Convert some Math operations to EmitC Call_opaque";
+  let description = [{
+    This pass converts supported Math ops to call_opaque calls to compiler generated
+    functions implementing these operations in software.
+    Unlike convert-math-to-funcs pass, this pass uses call_opaque,
+    therefore enables us to overload the same funtion with different argument types
+  }];
+
+  let constructor = "mlir::createConvertMathToEmitCPass()";
----------------
marbre wrote:

```suggestion
```
No need to define the constructor in TableGen, please use the auto-generated one.

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


More information about the Mlir-commits mailing list