[llvm-commits] CVS: llvm/lib/Transforms/Scalar/ADCE.cpp

Chris Lattner lattner at cs.uiuc.edu
Sun Dec 12 14:22:30 PST 2004



Changes in directory llvm/lib/Transforms/Scalar:

ADCE.cpp updated: 1.84 -> 1.85
---
Log message:

Remove some more set operations


---
Diffs of the changes:  (+2 -6)

Index: llvm/lib/Transforms/Scalar/ADCE.cpp
diff -u llvm/lib/Transforms/Scalar/ADCE.cpp:1.84 llvm/lib/Transforms/Scalar/ADCE.cpp:1.85
--- llvm/lib/Transforms/Scalar/ADCE.cpp:1.84	Sun Dec 12 16:16:13 2004
+++ llvm/lib/Transforms/Scalar/ADCE.cpp	Sun Dec 12 16:22:18 2004
@@ -283,10 +283,8 @@
 
     BasicBlock *BB = I->getParent();
     if (!ReachableBBs.count(BB)) continue;
-    if (!AliveBlocks.count(BB)) {     // Basic block not alive yet...
-      AliveBlocks.insert(BB);         // Block is now ALIVE!
+    if (AliveBlocks.insert(BB).second)     // Basic block not alive yet.
       markBlockAlive(BB);             // Make it so now!
-    }
 
     // PHI nodes are a special case, because the incoming values are actually
     // defined in the predecessor nodes of this block, meaning that the PHI
@@ -294,10 +292,8 @@
     //
     if (PHINode *PN = dyn_cast<PHINode>(I))
       for (pred_iterator PI = pred_begin(BB), PE = pred_end(BB); PI != PE; ++PI)
-        if (!AliveBlocks.count(*PI)) {
-          AliveBlocks.insert(BB);         // Block is now ALIVE!
+        if (AliveBlocks.insert(*PI).second) // Block is now ALIVE!
           markBlockAlive(*PI);
-        }
 
     // Loop over all of the operands of the live instruction, making sure that
     // they are known to be alive as well...






More information about the llvm-commits mailing list