[Mlir-commits] [mlir] [mlir][complex] Support fast math flag in converting complex.atan2 op (PR #82101)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Sat Feb 17 00:45:02 PST 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 118a2a52fd465b7576c54bd102ee2e417a3b9a71 fe9279263ba827f1084eb8bb41ab8aba59d24212 -- mlir/lib/Conversion/ComplexToStandard/ComplexToStandard.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/mlir/lib/Conversion/ComplexToStandard/ComplexToStandard.cpp b/mlir/lib/Conversion/ComplexToStandard/ComplexToStandard.cpp
index 19cca46da5..b31bd93eba 100644
--- a/mlir/lib/Conversion/ComplexToStandard/ComplexToStandard.cpp
+++ b/mlir/lib/Conversion/ComplexToStandard/ComplexToStandard.cpp
@@ -103,8 +103,8 @@ struct Atan2OpConversion : public OpConversionPattern<complex::Atan2Op> {
     Value lhsSquared = b.create<complex::MulOp>(type, lhs, lhs, fmf.getValue());
     Value rhsSquaredPlusLhsSquared =
         b.create<complex::AddOp>(type, rhsSquared, lhsSquared, fmf.getValue());
-    Value sqrtOfRhsSquaredPlusLhsSquared =
-        b.create<complex::SqrtOp>(type, rhsSquaredPlusLhsSquared, fmf.getValue());
+    Value sqrtOfRhsSquaredPlusLhsSquared = b.create<complex::SqrtOp>(
+        type, rhsSquaredPlusLhsSquared, fmf.getValue());
 
     Value zero =
         b.create<arith::ConstantOp>(elementType, b.getZeroAttr(elementType));
@@ -112,17 +112,19 @@ struct Atan2OpConversion : public OpConversionPattern<complex::Atan2Op> {
                                             b.getFloatAttr(elementType, 1));
     Value i = b.create<complex::CreateOp>(type, zero, one);
     Value iTimesLhs = b.create<complex::MulOp>(i, lhs, fmf.getValue());
-    Value rhsPlusILhs = b.create<complex::AddOp>(rhs, iTimesLhs, fmf.getValue());
+    Value rhsPlusILhs =
+        b.create<complex::AddOp>(rhs, iTimesLhs, fmf.getValue());
 
-    Value divResult =
-        b.create<complex::DivOp>(rhsPlusILhs, sqrtOfRhsSquaredPlusLhsSquared, fmf.getValue());
+    Value divResult = b.create<complex::DivOp>(
+        rhsPlusILhs, sqrtOfRhsSquaredPlusLhsSquared, fmf.getValue());
     Value logResult = b.create<complex::LogOp>(divResult, fmf.getValue());
 
     Value negativeOne = b.create<arith::ConstantOp>(
         elementType, b.getFloatAttr(elementType, -1));
     Value negativeI = b.create<complex::CreateOp>(type, zero, negativeOne);
 
-    rewriter.replaceOpWithNewOp<complex::MulOp>(op, negativeI, logResult, fmf.getValue());
+    rewriter.replaceOpWithNewOp<complex::MulOp>(op, negativeI, logResult,
+                                                fmf.getValue());
     return success();
   }
 };

``````````

</details>


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


More information about the Mlir-commits mailing list