[llvm-commits] [llvm] r53397 - /llvm/branches/Apple/Gaz/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Bill Wendling isanbard at gmail.com
Thu Jul 10 01:25:27 PDT 2008


Author: void
Date: Thu Jul 10 03:25:27 2008
New Revision: 53397

URL: http://llvm.org/viewvc/llvm-project?rev=53397&view=rev
Log:
Pulling r53374 into Gaz:

hasAnyUseOfValue can check SDUse nodes of its users directly instead
of examining every operand of every user.


Modified:
    llvm/branches/Apple/Gaz/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Modified: llvm/branches/Apple/Gaz/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Gaz/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=53397&r1=53396&r2=53397&view=diff

==============================================================================
--- llvm/branches/Apple/Gaz/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/branches/Apple/Gaz/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Thu Jul 10 03:25:27 2008
@@ -4401,8 +4401,6 @@
 
   SDOperand TheValue(const_cast<SDNode *>(this), Value);
 
-  SmallPtrSet<SDNode*, 32> UsersHandled;
-
   // TODO: Only iterate over uses of a given value of the node
   for (SDNode::use_iterator UI = use_begin(), E = use_end(); UI != E; ++UI) {
     if (*UI == TheValue) {
@@ -4426,17 +4424,9 @@
 
   SDOperand TheValue(const_cast<SDNode *>(this), Value);
 
-  SmallPtrSet<SDNode*, 32> UsersHandled;
-
-  for (SDNode::use_iterator UI = use_begin(), E = use_end(); UI != E; ++UI) {
-    SDNode *User = UI->getUser();
-    if (User->getNumOperands() == 1 ||
-        UsersHandled.insert(User))     // First time we've seen this?
-      for (unsigned i = 0, e = User->getNumOperands(); i != e; ++i)
-        if (User->getOperand(i) == TheValue) {
-          return true;
-        }
-  }
+  for (SDNode::use_iterator UI = use_begin(), E = use_end(); UI != E; ++UI)
+    if (UI->getSDOperand() == TheValue)
+      return true;
 
   return false;
 }





More information about the llvm-commits mailing list