[all-commits] [llvm/llvm-project] c4457e: [mlir][IR] Change block/region walkers to enumerat...
Matthias Springer via All-commits
all-commits at lists.llvm.org
Tue Dec 19 21:51:58 PST 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: c4457e10fe7946dcedbdd7a07c320ed8b764dc7c
https://github.com/llvm/llvm-project/commit/c4457e10fe7946dcedbdd7a07c320ed8b764dc7c
Author: Matthias Springer <me at m-sp.org>
Date: 2023-12-20 (Wed, 20 Dec 2023)
Changed paths:
M mlir/include/mlir/IR/Block.h
M mlir/include/mlir/IR/Region.h
M mlir/lib/Dialect/Bufferization/Transforms/OwnershipBasedBufferDeallocation.cpp
M mlir/test/IR/visitors.mlir
M mlir/test/lib/IR/TestVisitors.cpp
Log Message:
-----------
[mlir][IR] Change block/region walkers to enumerate `this` block/region (#75020)
This change makes block/region walkers consistent with operation
walkers. An operation walk enumerates the current operation. Similarly,
block/region walks should enumerate the current block/region.
Example:
```
// Current behavior:
op1->walk([](Operation *op2) { /* op1 is enumerated */ });
block1->walk([](Block *block2) { /* block1 is NOT enumerated */ });
region1->walk([](Block *block) { /* blocks of region1 are NOT enumerated */ });
region1->walk([](Region *region2) { /* region1 is NOT enumerated });
// New behavior:
op1->walk([](Operation *op2) { /* op1 is enumerated */ });
block1->walk([](Block *block2) { /* block1 IS enumerated */ });
region1->walk([](Block *block) { /* blocks of region1 ARE enumerated */ });
region1->walk([](Region *region2) { /* region1 IS enumerated });
```
More information about the All-commits
mailing list