[Mlir-commits] [mlir] [MLIR][RemoveDeadValues] Mark arguments of a public function Live (PR #162038)
Mehdi Amini
llvmlistbot at llvm.org
Mon Oct 6 11:10:24 PDT 2025
================
@@ -39,6 +39,20 @@ struct ForwardIterator {
}
};
+/// This iterator enumerates the elements in "backward" order.
+struct BackwardIterator {
+ template <typename T>
+ static auto makeIterable(T &range) {
+ if constexpr (std::is_same<T, Operation>()) {
+ /// Make operations iterable: return the list of regions.
+ return llvm::reverse(range.getRegions());
+ } else {
+ /// Regions and block are already iterable.
+ return llvm::reverse(range);
+ }
+ }
+};
----------------
joker-eph wrote:
> My intention is to visit basic block and CFG in reverse order.
Reverse order from what? The order of basic blocks isn't indicative of any execution order. The only constraint is on the first basic block to be the "entry" into the region.
https://github.com/llvm/llvm-project/pull/162038
More information about the Mlir-commits
mailing list