[Mlir-commits] [mlir] [mlir][arith] Canonicalize `addf(negf(x), y)` to `subf(y, x)` (PR #209277)

Victor Perez llvmlistbot at llvm.org
Wed Jul 15 06:52:55 PDT 2026


================
@@ -521,6 +521,24 @@ def UIToFPOfExtUI :
     Pat<(Arith_UIToFPOp (Arith_ExtUIOp $x, $nneg1), $nneg2),
         (Arith_UIToFPOp $x, $nneg1)>;
 
+//===----------------------------------------------------------------------===//
+// AddFOp
+//===----------------------------------------------------------------------===//
+
+// addf(negf(x), y) -> subf(y, x)
+// addf(y, negf(x)) -> subf(y, x)
----------------
victor-eds wrote:

Fixed (`addf(x, negf(y)) -> subf(x, y)` actually)

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


More information about the Mlir-commits mailing list