================ @@ -98,13 +118,18 @@ void walkAndApplyPatterns(Operation *op, regionIt = region->begin(); if (regionIt != region->end()) blockIt = regionIt->begin(); + if (!llvm::hasSingleElement(*region)) + findReachableBlocks(*region, reachableBlocks); } // Advance the iterator to the next reachable operation. void advance() { assert(regionIt != region->end()); hasVisitedRegions = false; if (blockIt == regionIt->end()) { regionIt++; + while (regionIt != region->end() && + !reachableBlocks.contains(&*regionIt)) + regionIt++; ---------------- kuhar wrote:
```suggestion ++regionIt; ``` Per https://llvm.org/docs/CodingStandards.html#prefer-preincrement https://github.com/llvm/llvm-project/pull/154038 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits