[llvm] [LV][NFC] Rename getNumUsers to getNumUses (PR #155397)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 26 08:10:32 PDT 2025


================
@@ -110,13 +110,18 @@ class LLVM_ABI_FOR_TEST VPValue {
   void dump() const;
 #endif
 
-  unsigned getNumUsers() const { return Users.size(); }
-  void addUser(VPUser &User) { Users.push_back(&User); }
+  /// Returns the number of uses of this VPValue. The same user could appear
+  /// more than once in the list due to this value being used for multiple
+  /// operands in a recipe.
+  unsigned getNumUses() const { return Users.size(); }
 
-  /// Remove a single \p User from the list of users.
-  void removeUser(VPUser &User) {
+  /// Adds a use of this value to the list.
+  void addUse(VPUser &User) { Users.push_back(&User); }
----------------
david-arm wrote:

IR/Value.h only has a single UseList and it creates iterators for both uses and users from the same UseList. Also, Value.h only has an `addUse` function - `addUser` does not exist. I know in other parts of the vectoriser we've tried hard to keep consistent naming schemes and terminology with the IR equivalents, which is what I'm trying to do here. Is the problem you're worried about here that `addUse` takes a `VPUser`?

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


More information about the llvm-commits mailing list