[llvm-branch-commits] [llvm-branch] r95912 - in /llvm/branches/Apple/Hermes: lib/Transforms/Scalar/DeadStoreElimination.cpp test/Transforms/DeadStoreElimination/crash.ll

Bill Wendling isanbard at gmail.com
Thu Feb 11 11:45:18 PST 2010


Author: void
Date: Thu Feb 11 13:45:18 2010
New Revision: 95912

URL: http://llvm.org/viewvc/llvm-project?rev=95912&view=rev
Log:
$ svn merge -c 95852 https://llvm.org/svn/llvm-project/llvm/trunk
--- Merging r95852 into '.':
U    test/Transforms/DeadStoreElimination/crash.ll
U    lib/Transforms/Scalar/DeadStoreElimination.cpp


Modified:
    llvm/branches/Apple/Hermes/lib/Transforms/Scalar/DeadStoreElimination.cpp
    llvm/branches/Apple/Hermes/test/Transforms/DeadStoreElimination/crash.ll

Modified: llvm/branches/Apple/Hermes/lib/Transforms/Scalar/DeadStoreElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Hermes/lib/Transforms/Scalar/DeadStoreElimination.cpp?rev=95912&r1=95911&r2=95912&view=diff

==============================================================================
--- llvm/branches/Apple/Hermes/lib/Transforms/Scalar/DeadStoreElimination.cpp (original)
+++ llvm/branches/Apple/Hermes/lib/Transforms/Scalar/DeadStoreElimination.cpp Thu Feb 11 13:45:18 2010
@@ -44,8 +44,14 @@
 
     virtual bool runOnFunction(Function &F) {
       bool Changed = false;
+      
+      DominatorTree &DT = getAnalysis<DominatorTree>();
+      
       for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I)
-        Changed |= runOnBasicBlock(*I);
+        // Only check non-dead blocks.  Dead blocks may have strange pointer
+        // cycles that will confuse alias analysis.
+        if (DT.isReachableFromEntry(I))
+          Changed |= runOnBasicBlock(*I);
       return Changed;
     }
     

Modified: llvm/branches/Apple/Hermes/test/Transforms/DeadStoreElimination/crash.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Hermes/test/Transforms/DeadStoreElimination/crash.ll?rev=95912&r1=95911&r2=95912&view=diff

==============================================================================
--- llvm/branches/Apple/Hermes/test/Transforms/DeadStoreElimination/crash.ll (original)
+++ llvm/branches/Apple/Hermes/test/Transforms/DeadStoreElimination/crash.ll Thu Feb 11 13:45:18 2010
@@ -41,3 +41,17 @@
 }
 
 declare void @llvm.memcpy.i64(i8* nocapture, i8* nocapture, i64, i32) nounwind
+
+
+; rdar://7635088
+define i32 @test3() {
+entry:
+  ret i32 0
+  
+dead:
+  %P2 = getelementptr i32 *%P2, i32 52
+  %Q2 = getelementptr i32 *%Q2, i32 52
+  store i32 4, i32* %P2
+  store i32 4, i32* %Q2
+  br label %dead
+}
\ No newline at end of file





More information about the llvm-branch-commits mailing list