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

Mehdi Amini llvmlistbot at llvm.org
Thu Feb 29 12:29:36 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())) {
----------------
joker-eph wrote:

How are cycles handled?

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


More information about the Mlir-commits mailing list