forked from OSchip/llvm-project
Use use_empty() instead of getNumUses(), avoiding a use list traversal.
llvm-svn: 52651
This commit is contained in:
parent
ea736c5d02
commit
abd8f41c81
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue