diff options
author | Dan Gohman <gohman@apple.com> | 2008-06-23 23:23:49 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-06-23 23:23:49 +0000 |
commit | cb41e6bf52e51b2cbf6871f63785af1c12a5fe70 (patch) | |
tree | e1f94f7398c9e288ff1be30b86712b27b5f9223c /lib/Transforms/Scalar | |
parent | b3db9c90d24682340f043a8151063128fe3b220b (diff) | |
download | llvm-cb41e6bf52e51b2cbf6871f63785af1c12a5fe70.tar.gz llvm-cb41e6bf52e51b2cbf6871f63785af1c12a5fe70.tar.bz2 llvm-cb41e6bf52e51b2cbf6871f63785af1c12a5fe70.tar.xz |
Use use_empty() instead of getNumUses(), avoiding a use list traversal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52651 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar')
-rw-r--r-- | lib/Transforms/Scalar/LoopDeletion.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/LoopDeletion.cpp b/lib/Transforms/Scalar/LoopDeletion.cpp index 3c0e8662a2..f68a5f7125 100644 --- a/lib/Transforms/Scalar/LoopDeletion.cpp +++ b/lib/Transforms/Scalar/LoopDeletion.cpp @@ -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()); } |