[llvm] [ADT][NFC] Use block numbers for po_iterator (PR #177182)

Alexis Engelke via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 22 00:04:19 PDT 2026


================
@@ -91,8 +91,36 @@ class po_iterator_storage<SetType, true> {
   template <class NodeRef> void finishPostorder(NodeRef BB) {}
 };
 
-template <class GraphT,
-          class SetType = SmallPtrSet<typename GraphTraits<GraphT>::NodeRef, 8>,
+namespace po_detail {
+
+template <typename NodeRef> class NumberSet {
+  SmallVector<bool> Data;
+
+public:
+  void reserve(size_t Size) {
+    if (Size < Data.size())
----------------
aengelke wrote:

This is currently dead code. I never got around to actually calling reserve. This was not possible at that time. After #191047 it is possible, but not entirely trivial, because GraphT is not always a function but in a fair amount of cases a block (often the entry block, but not always).

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


More information about the llvm-commits mailing list