[Mlir-commits] [mlir] [MLIR][GPUToNVVM] support fastMath and other non-supported mathOp (PR #99890)

Mehdi Amini llvmlistbot at llvm.org
Mon Jul 22 10:05:13 PDT 2024


================
@@ -90,9 +91,13 @@ struct OpToFuncCallLowering : public ConvertOpToLLVMPattern<SourceOp> {
     return LLVM::LLVMFunctionType::get(resultType, operandTypes);
   }
 
-  StringRef getFunctionName(Type type) const {
-    if (isa<Float32Type>(type))
-      return f32Func;
+  StringRef getFunctionName(Type type, arith::FastMathFlags flag) const {
+    if (isa<Float32Type>(type)) {
+      if (arith::FastMathFlags::fast == flag && !f32FastFunc.empty())
----------------
joker-eph wrote:

```suggestion
      if ((arith::FastMathFlags::afn & flag) && !f32FastFunc.empty())
```

We only need afn I believe (please add such test)

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


More information about the Mlir-commits mailing list