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.
Depends On D80135
This was because originally ensureTerminator wasn't tracked, so this could now be removed entirely. The create<AffineTerminatorOp> below would also need to be removed.