[Mlir-commits] [mlir] [mlir][complex] Canonicalize complex.div by one (PR #85513)

Mehdi Amini llvmlistbot at llvm.org
Thu Mar 21 23:53:41 PDT 2024


================
@@ -369,6 +369,29 @@ OpFoldResult MulOp::fold(FoldAdaptor adaptor) {
   return {};
 }
 
+//===----------------------------------------------------------------------===//
+// DivOp
+//===----------------------------------------------------------------------===//
+
+OpFoldResult DivOp::fold(FoldAdaptor adaptor) {
+  auto constant = getRhs().getDefiningOp<ConstantOp>();
----------------
joker-eph wrote:

The folder is supposed to read the constant from the provided adaptor.

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


More information about the Mlir-commits mailing list