[llvm-commits] [llvm] r52651 - /llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp
Dan Gohman
gohman at apple.com
Mon Jun 23 16:23:49 PDT 2008
Author: djg
Date: Mon Jun 23 18:23:49 2008
New Revision: 52651
URL: http://llvm.org/viewvc/llvm-project?rev=52651&view=rev
Log:
Use use_empty() instead of getNumUses(), avoiding a use list traversal.
Modified:
llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp?rev=52651&r1=52650&r2=52651&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp Mon Jun 23 18:23:49 2008
@@ -209,7 +209,7 @@
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());
}
More information about the llvm-commits
mailing list