This iterator is similar to ForwardIterator but enumerates blocks according to their successor relationship. As a first use case, this new iterator is utilized in the dialect conversion framework.
Depends On: D144887
Paths
| Differential D144888
[mlir][IR] Add ForwardDominanceIterator for IR walkers ClosedPublic Authored by springerm on Feb 27 2023, 8:50 AM.
Details Summary This iterator is similar to ForwardIterator but enumerates blocks according to their successor relationship. As a first use case, this new iterator is utilized in the dialect conversion framework. Depends On: D144887
Diff Detail
Event Timelinespringerm added a parent revision: D144887: [mlir][IR][NFC] Move `walk` definitions to header file.Feb 27 2023, 8:50 AM Comment Actions This does not yet handle the case correctly when a block is taken from remainingBlocks: a block without predecessors must be selected. In case there is no such block, there is loop and any block can be taken. It would be more efficient to pre-compute a topologic sorting instead if following successors during the traversal. This would also allow for removing blocks during the traversal. Comment Actions ForwardDominanceIterator does not enumerate unreachable blocks. They do not post-dominate the entry block. Comment Actions
Oh right, for the forward traversal we could use llvm::depth_first.
rriddle added inline comments. This revision is now accepted and ready to land.Mar 12 2023, 11:46 PM Closed by commit rGb884f4ef0a2d: [mlir][IR] Add ForwardDominanceIterator for IR walkers (authored by springerm). · Explain WhyMar 13 2023, 2:03 AM This revision was automatically updated to reflect the committed changes. springerm marked an inline comment as done.
Revision Contents
Diff 500823 mlir/include/mlir/IR/Iterators.h
mlir/include/mlir/IR/Visitors.h
mlir/lib/IR/CMakeLists.txt
mlir/lib/IR/Iterators.cpp
mlir/lib/Transforms/Utils/DialectConversion.cpp
mlir/test/IR/visitors.mlir
mlir/test/lib/IR/TestVisitors.cpp
|
Please don't use using namespace in headers