[llvm] IR: Remove null UseList checks in hasNUses methods (PR #165929)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 31 15:00:36 PDT 2025


https://github.com/arsenm created https://github.com/llvm/llvm-project/pull/165929

None

>From 428c6d6242cc85b6929021e9fffbeaf115e2551f Mon Sep 17 00:00:00 2001
From: Matt Arsenault <Matthew.Arsenault at amd.com>
Date: Fri, 31 Oct 2025 14:59:23 -0700
Subject: [PATCH] IR: Remove null UseList checks in hasNUses methods

---
 llvm/lib/IR/Value.cpp | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/llvm/lib/IR/Value.cpp b/llvm/lib/IR/Value.cpp
index b775cbb0c7920..95d61a987f6c1 100644
--- a/llvm/lib/IR/Value.cpp
+++ b/llvm/lib/IR/Value.cpp
@@ -148,18 +148,10 @@ void Value::destroyValueName() {
 }
 
 bool Value::hasNUses(unsigned N) const {
-  if (!UseList)
-    return N == 0;
-
-  // TODO: Disallow for ConstantData and remove !UseList check?
   return hasNItems(use_begin(), use_end(), N);
 }
 
 bool Value::hasNUsesOrMore(unsigned N) const {
-  // TODO: Disallow for ConstantData and remove !UseList check?
-  if (!UseList)
-    return N == 0;
-
   return hasNItemsOrMore(use_begin(), use_end(), N);
 }
 



More information about the llvm-commits mailing list