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

Simon Camphausen llvmlistbot at llvm.org
Tue Oct 29 07:06:25 PDT 2024


================
@@ -0,0 +1,133 @@
+// RUN: mlir-opt --split-input-file -convert-math-to-emitc -verify-diagnostics %s | FileCheck %s
+
+// CHECK-LABEL:   emitc.include "math.h"
+
+// CHECK-LABEL:   func.func @absf_to_call_opaque(
+// CHECK-SAME:                                   %[[VAL_0:.*]]: f32) {
+// CHECK:           %[[VAL_1:.*]] = emitc.call_opaque "fabs"(%[[VAL_0]]) : (f32) -> f32
+// CHECK:           return
+// CHECK:         }
+func.func @absf_to_call_opaque(%arg0: f32) {
+    %1 = math.absf %arg0 : f32
----------------
simon-camp wrote:

Add the f64 variants for the tests please

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


More information about the Mlir-commits mailing list