[Mlir-commits] [mlir] [MLIR][RemoveDeadValues] Mark arguments of a public function Live (PR #162038)

Mehdi Amini llvmlistbot at llvm.org
Mon Oct 6 06:56:34 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:

Which do you need to do this? Are you somehow trying to make an assumption about the order in which the regions are executed at runtime? 
The order of the region on the op are not indicative of anything related to this.

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


More information about the Mlir-commits mailing list