[PATCH] D76415: [mlir] Fix unsafe create operation in GreedyPatternRewriter

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 19 01:03:38 PDT 2020


mehdi_amini added inline comments.


================
Comment at: mlir/include/mlir/Transforms/FoldUtils.h:87
+      op->destroy();
+    }
   }
----------------
I think that is similar to what River mentions above, but this code is fishy: if none of the branch is taken the op just leaks.

I'd write it with early exit so that there is a clear handling of the "fallback" path.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76415/new/

https://reviews.llvm.org/D76415





More information about the llvm-commits mailing list