of examining every operand of every user.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53374
91177308-0d34-0410-b5e6-
96231b3b80d8
SDOperand TheValue(const_cast<SDNode *>(this), Value);
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) {
// 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) {
SDOperand TheValue(const_cast<SDNode *>(this), Value);
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;