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

llvmlistbot at llvm.org llvmlistbot at llvm.org
Tue Jul 23 07:07:30 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())
----------------
runseny wrote:

I still use `arith::FastMathFlags::afn == flag` instead of `arith::FastMathFlags::afn & flag`. The reason is that the binary of `afn` is `1000000` (decimal is 64) , if flag is `fast` whose binary is `1111111` (decimal is 127) , the result of `&` is still true. 

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


More information about the Mlir-commits mailing list