[Mlir-commits] [mlir] [mlir][complex] Make complex MulOp commutative (PR #215257)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Mon Aug 10 05:04:40 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir
Author: Bryth (matteo-rm)
<details>
<summary>Changes</summary>
This PR makes complex multiplication commutative. This is consistent with Arith's MulFOp, and Complex addition also being commutative.
---
Full diff: https://github.com/llvm/llvm-project/pull/215257.diff
1 Files Affected:
- (modified) mlir/include/mlir/Dialect/Complex/IR/ComplexOps.td (+1-1)
``````````diff
diff --git a/mlir/include/mlir/Dialect/Complex/IR/ComplexOps.td b/mlir/include/mlir/Dialect/Complex/IR/ComplexOps.td
index 828379ded14b3..9a5140a28c388 100644
--- a/mlir/include/mlir/Dialect/Complex/IR/ComplexOps.td
+++ b/mlir/include/mlir/Dialect/Complex/IR/ComplexOps.td
@@ -367,7 +367,7 @@ def Log1pOp : ComplexUnaryOp<"log1p", [SameOperandsAndResultType]> {
// MulOp
//===----------------------------------------------------------------------===//
-def MulOp : ComplexArithmeticOp<"mul"> {
+def MulOp : ComplexArithmeticOp<"mul", [Commutative]> {
let summary = "complex multiplication";
let description = [{
The `mul` operation takes two complex numbers and returns their product:
``````````
</details>
https://github.com/llvm/llvm-project/pull/215257
More information about the Mlir-commits
mailing list