Eliminate unnecessary operands-list traversals.

llvm-svn: 63088
This commit is contained in:
Dan Gohman 2009-01-27 02:37:43 +00:00
parent c39a03f3fa
commit 2e0343e321

View File

@ -242,12 +242,9 @@ namespace {
static SDNode *findFlagUse(SDNode *N) {
unsigned FlagResNo = N->getNumValues()-1;
for (SDNode::use_iterator I = N->use_begin(), E = N->use_end(); I != E; ++I) {
SDNode *User = *I;
for (unsigned i = 0, e = User->getNumOperands(); i != e; ++i) {
SDValue Op = User->getOperand(i);
if (Op.getNode() == N && Op.getResNo() == FlagResNo)
return User;
}
SDUse &Use = I.getUse();
if (Use.getResNo() == FlagResNo)
return Use.getUser();
}
return NULL;
}