[llvm] [VPlan] Add incoming_[blocks,values] iterators to VPPhiAccessors (NFC) (PR #138472)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 6 13:34:44 PDT 2025


================
@@ -1224,6 +1224,42 @@ class VPPhiAccessors {
     return getAsRecipe()->getNumOperands();
   }
 
+  /// Returns an interator range over the incoming values.
+  VPUser::const_operand_range incoming_values() const {
+    return make_range(getAsRecipe()->op_begin(),
+                      getAsRecipe()->op_begin() + getNumIncoming());
+  }
+
+  using const_incoming_block_iterator =
+      mapped_iterator<detail::index_iterator,
+                      std::function<const VPBasicBlock *(size_t)>>;
----------------
fhahn wrote:

I don't think llvm::function_ref will work, as we need to capture the enclosing object

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


More information about the llvm-commits mailing list