[llvm-commits] [llvm] r46555 - /llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp

Nick Lewycky nicholas at mxc.ca
Wed Jan 30 00:01:28 PST 2008


Author: nicholas
Date: Wed Jan 30 02:01:28 2008
New Revision: 46555

URL: http://llvm.org/viewvc/llvm-project?rev=46555&view=rev
Log:
Remove a couple more cases of "getNumUses() == 0". No need to walk the linked
list just to see if whether the list is empty.

Modified:
    llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp?rev=46555&r1=46554&r2=46555&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Wed Jan 30 02:01:28 2008
@@ -327,7 +327,7 @@
     if (LoadInst* L = dyn_cast<LoadInst>(BBI)) {
       // However, if this load is unused, we can go ahead and remove it, and
       // not have to worry about it making our pointer undead!
-      if (L->getNumUses() == 0) {
+      if (L->use_empty()) {
         MD.removeInstruction(L);
         
         // DCE instructions only used to calculate that load
@@ -350,7 +350,7 @@
       deadPointers.erase(A);
       
       // Dead alloca's can be DCE'd when we reach them
-      if (A->getNumUses() == 0) {
+      if (A->use_empty()) {
         MD.removeInstruction(A);
         
         // DCE instructions only used to calculate that load





More information about the llvm-commits mailing list