[llvm-commits] [llvm] r140821 - /llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp

Nick Lewycky nicholas at mxc.ca
Thu Sep 29 16:40:13 PDT 2011


Author: nicholas
Date: Thu Sep 29 18:40:12 2011
New Revision: 140821

URL: http://llvm.org/viewvc/llvm-project?rev=140821&view=rev
Log:
Fold two identical set lookups into one. No functionality change.

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

Modified: llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp?rev=140821&r1=140820&r2=140821&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp Thu Sep 29 18:40:12 2011
@@ -735,13 +735,11 @@
     worklist.pop_back();
     
     // Break use-def graph loops.
-    if (Visited.count(V)) {
+    if (!Visited.insert(V)) {
       Consensus = 0;
       break;
     }
     
-    Visited.insert(V);
-    
     // For a PHI node, push all of its incoming values.
     if (PHINode *P = dyn_cast<PHINode>(V)) {
       for (unsigned i = 0, e = P->getNumIncomingValues(); i != e; ++i)
@@ -752,7 +750,7 @@
     // For non-PHIs, determine the addressing mode being computed.
     SmallVector<Instruction*, 16> NewAddrModeInsts;
     ExtAddrMode NewAddrMode =
-      AddressingModeMatcher::Match(V, AccessTy,MemoryInst,
+      AddressingModeMatcher::Match(V, AccessTy, MemoryInst,
                                    NewAddrModeInsts, *TLI);
 
     // This check is broken into two cases with very similar code to avoid using





More information about the llvm-commits mailing list