Use use_empty() instead of getNumUses(), avoiding a use list traversal.

llvm-svn: 52651
This commit is contained in:
Dan Gohman 2008-06-23 23:23:49 +00:00
parent f2386cff4f
commit 11d367fd0c

View File

@ -209,7 +209,7 @@ bool LoopDeletion::runOnLoop(Loop* L, LPPassManager& LPM) {
for (BasicBlock::iterator BI = (*LI)->begin(), BE = (*LI)->end();
BI != BE; ) {
Instruction* I = BI++;
if (I->getNumUses() > 0 && IsLoopInvariantInst(I, L))
if (!I->use_empty() && IsLoopInvariantInst(I, L))
I->moveBefore(preheader->getTerminator());
}