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

Benjamin Kramer benny.kra at googlemail.com
Tue Mar 29 13:28:58 PDT 2011


Author: d0k
Date: Tue Mar 29 15:28:57 2011
New Revision: 128482

URL: http://llvm.org/viewvc/llvm-project?rev=128482&view=rev
Log:
DSE: Remove an early exit optimization that depended on the ordering of a SmallPtrSet.

Fixes PR9569 and will hopefully make selfhost on ASLR-enabled systems more deterministic.

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=128482&r1=128481&r2=128482&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Tue Mar 29 15:28:57 2011
@@ -640,28 +640,15 @@
       if (AA->doesNotAccessMemory(CS))
         continue;
       
-      unsigned NumModRef = 0, NumOther = 0;
-      
       // If the call might load from any of our allocas, then any store above
       // the call is live.
       SmallVector<Value*, 8> LiveAllocas;
       for (SmallPtrSet<Value*, 16>::iterator I = DeadStackObjects.begin(),
            E = DeadStackObjects.end(); I != E; ++I) {
-        // If we detect that our AA is imprecise, it's not worth it to scan the
-        // rest of the DeadPointers set.  Just assume that the AA will return
-        // ModRef for everything, and go ahead and bail out.
-        if (NumModRef >= 16 && NumOther == 0)
-          return MadeChange;
-
         // See if the call site touches it.
         AliasAnalysis::ModRefResult A = 
           AA->getModRefInfo(CS, *I, getPointerSize(*I, *AA));
         
-        if (A == AliasAnalysis::ModRef)
-          ++NumModRef;
-        else
-          ++NumOther;
-        
         if (A == AliasAnalysis::ModRef || A == AliasAnalysis::Ref)
           LiveAllocas.push_back(*I);
       }





More information about the llvm-commits mailing list