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

Pete Cooper peter_cooper at apple.com
Thu Nov 10 12:22:09 PST 2011


Author: pete
Date: Thu Nov 10 14:22:08 2011
New Revision: 144312

URL: http://llvm.org/viewvc/llvm-project?rev=144312&view=rev
Log:
Fixed bug in DeadStoreElimination commit r144239

Size of data being pointed to wasn't always being checked so some small writes were killing big writes

Fixes <rdar://problem/10426753>

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=144312&r1=144311&r2=144312&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Thu Nov 10 14:22:08 2011
@@ -380,7 +380,7 @@
   if (isObjectPointerWithTrustworthySize(UO2)) {
     uint64_t ObjectSize =
       TD.getTypeAllocSize(cast<PointerType>(UO2->getType())->getElementType());
-    if (ObjectSize == Later.Size)
+    if (ObjectSize == Later.Size && ObjectSize >= Earlier.Size)
       return OverwriteComplete;
   }
 





More information about the llvm-commits mailing list