[mlir] Erase or clear blocks through ConversionPatternRewriter when applicable
Multiple places in the code base were erasing Blocks or operations in them using in-place modifications (`Block::erase` or `Block::clear`) unknown to ConversionPatternRewriter. These operations could not be undone if the pattern failed and could lead to inconsistent in-memory state of the IR with dangling pointers. Use `ConversionPatternRewriter::eraseOp` and `::eraseBlock` instead. Differential Revision: https://reviews.llvm.org/D80136
Loading
Please sign in to comment