Add a utility function to SDOperand for testing if a value is unused.
authorDan Gohman <gohman@apple.com>
Mon, 17 Sep 2007 17:44:31 +0000 (17:44 +0000)
committerDan Gohman <gohman@apple.com>
Mon, 17 Sep 2007 17:44:31 +0000 (17:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42038 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/SelectionDAGNodes.h

index 4f44c4f8423af29d9c4c59371bf42b3577269b8b..40a88eba0a0acf4e2557dec21f40d42cea6ef077 100644 (file)
@@ -766,6 +766,10 @@ public:
   /// hasOneUse - Return true if there is exactly one operation using this
   /// result value of the defining operator.
   inline bool hasOneUse() const;
+
+  /// use_empty - Return true if there are no operations using this
+  /// result value of the defining operator.
+  inline bool use_empty() const;
 };
 
 
@@ -1035,6 +1039,9 @@ inline unsigned SDOperand::getTargetOpcode() const {
 inline bool SDOperand::hasOneUse() const {
   return Val->hasNUsesOfValue(1, ResNo);
 }
+inline bool SDOperand::use_empty() const {
+  return !Val->hasAnyUseOfValue(ResNo);
+}
 
 /// UnarySDNode - This class is used for single-operand SDNodes.  This is solely
 /// to allow co-allocation of node operands with the node itself.