[Mlir-commits] [mlir] [mlir][complex] Support Fastmath flag in conversion of complex.div to standard (PR #82729)

Kai Sasaki llvmlistbot at llvm.org
Fri Feb 23 14:29:48 PST 2024


================
@@ -206,11 +207,13 @@ struct TrigonometricOpConversion : public OpConversionPattern<TrigonometricOp> {
     // implementation in the subclass to combine them.
     Value half = rewriter.create<arith::ConstantOp>(
         loc, elementType, rewriter.getFloatAttr(elementType, 0.5));
-    Value exp = rewriter.create<math::ExpOp>(loc, imag);
-    Value scaledExp = rewriter.create<arith::MulFOp>(loc, half, exp);
-    Value reciprocalExp = rewriter.create<arith::DivFOp>(loc, half, exp);
-    Value sin = rewriter.create<math::SinOp>(loc, real);
-    Value cos = rewriter.create<math::CosOp>(loc, real);
+    Value exp = rewriter.create<math::ExpOp>(loc, imag, fmf.getValue());
+    Value scaledExp =
+        rewriter.create<arith::MulFOp>(loc, half, exp, fmf.getValue());
+    Value reciprocalExp =
+        rewriter.create<arith::DivFOp>(loc, half, exp, fmf.getValue());
+    Value sin = rewriter.create<math::SinOp>(loc, real, fmf.getValue());
+    Value cos = rewriter.create<math::CosOp>(loc, real, fmf.getValue());
----------------
Lewuathe wrote:

Do you mean we can simply pass the 'fmf' instead of 'fmf.gerValue()' here?

I think it's also the case for the following change.

https://github.com/llvm/llvm-project/pull/82101/files

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


More information about the Mlir-commits mailing list