[Mlir-commits] [mlir] [mlir][complex] Emit fma for contracted complex.mul lowering (PR #196248)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed May 6 23:46:27 PDT 2026


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 origin/main HEAD --extensions cpp -- mlir/lib/Conversion/ComplexToLLVM/ComplexToLLVM.cpp mlir/lib/Conversion/ComplexToStandard/ComplexToStandard.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</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 4dcc9a2c2..6171b21ff 100644
--- a/mlir/lib/Conversion/ComplexToStandard/ComplexToStandard.cpp
+++ b/mlir/lib/Conversion/ComplexToStandard/ComplexToStandard.cpp
@@ -556,27 +556,26 @@ struct MulOpConversion : public OpConversionPattern<complex::MulOp> {
           arith::MulFOp::create(b, lhsImag, rhsImag, fmfValue);
       Value negLhsImagTimesRhsImag =
           arith::NegFOp::create(b, lhsImagTimesRhsImag, fmfValue);
-      real = math::FmaOp::create(b, lhsReal, rhsReal,
-                                 negLhsImagTimesRhsImag, fmfValue);
+      real = math::FmaOp::create(b, lhsReal, rhsReal, negLhsImagTimesRhsImag,
+                                 fmfValue);
 
       Value lhsImagTimesRhsReal =
           arith::MulFOp::create(b, lhsImag, rhsReal, fmfValue);
-      imag =
-          math::FmaOp::create(b, lhsReal, rhsImag, lhsImagTimesRhsReal,
-                              fmfValue);
+      imag = math::FmaOp::create(b, lhsReal, rhsImag, lhsImagTimesRhsReal,
+                                 fmfValue);
     } else {
       Value lhsRealTimesRhsReal =
           arith::MulFOp::create(b, lhsReal, rhsReal, fmfValue);
       Value lhsImagTimesRhsImag =
           arith::MulFOp::create(b, lhsImag, rhsImag, fmfValue);
-      real = arith::SubFOp::create(b, lhsRealTimesRhsReal,
-                                   lhsImagTimesRhsImag, fmfValue);
+      real = arith::SubFOp::create(b, lhsRealTimesRhsReal, lhsImagTimesRhsImag,
+                                   fmfValue);
       Value lhsImagTimesRhsReal =
           arith::MulFOp::create(b, lhsImag, rhsReal, fmfValue);
       Value lhsRealTimesRhsImag =
           arith::MulFOp::create(b, lhsReal, rhsImag, fmfValue);
-      imag = arith::AddFOp::create(b, lhsImagTimesRhsReal,
-                                   lhsRealTimesRhsImag, fmfValue);
+      imag = arith::AddFOp::create(b, lhsImagTimesRhsReal, lhsRealTimesRhsImag,
+                                   fmfValue);
     }
     rewriter.replaceOpWithNewOp<complex::CreateOp>(op, type, real, imag);
     return success();

``````````

</details>


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


More information about the Mlir-commits mailing list