[Mlir-commits] [mlir] [mlir]use correct iterator when eraseOp (PR #83444)

Matthias Springer llvmlistbot at llvm.org
Thu Feb 29 14:24:54 PST 2024


================
@@ -229,14 +229,14 @@ void RewriterBase::eraseOp(Operation *op) {
       // until the region is empty. (The block graph could be disconnected.)
       while (!r.empty()) {
         SmallVector<Block *> erasedBlocks;
-        for (Block *b : llvm::post_order(&r.front())) {
+        for (Block &b : llvm::reverse(r.getBlocks())) {
----------------
matthias-springer wrote:

They are not. That’s what I meant by best effort. There is a ‘dropAllUses’ to handle such cases. 

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


More information about the Mlir-commits mailing list