[llvm] [VPlan] Extract reverse operation for reverse accesses (PR #146525)

Mel Chen via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 5 02:01:23 PST 2025


================
@@ -150,11 +150,21 @@ class LLVM_ABI_FOR_TEST VPValue {
 
   bool hasOneUse() const { return getNumUsers() == 1; }
 
+  /// Returns true if the value has exactly one unique user, ignoring multiple
+  /// uses by the same user.
+  bool hasOneUser() const {
+    if (getNumUsers() == 0)
+      return false;
+    if (hasOneUse())
+      return true;
+    return std::equal(std::next(user_begin()), user_end(), user_begin());
+  }
+
----------------
Mel-Chen wrote:

c76d928182a1676d8d7db77090c1c9e969c7ebcf
Updated, thanks.

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


More information about the llvm-commits mailing list