[llvm-commits] [llvm] r53374 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Dan Gohman
gohman at apple.com
Wed Jul 9 15:39:01 PDT 2008
Author: djg
Date: Wed Jul 9 17:39:01 2008
New Revision: 53374
URL: http://llvm.org/viewvc/llvm-project?rev=53374&view=rev
Log:
hasAnyUseOfValue can check SDUse nodes of its users directly instead
of examining every operand of every user.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=53374&r1=53373&r2=53374&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Wed Jul 9 17:39:01 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