[llvm-commits] [llvm] r65945 - /llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp

Bill Wendling isanbard at gmail.com
Tue Mar 3 04:13:13 PST 2009


Author: void
Date: Tue Mar  3 06:12:58 2009
New Revision: 65945

URL: http://llvm.org/viewvc/llvm-project?rev=65945&view=rev
Log:
Reapply r65755, but reversing "<" to ">=".

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

Modified: llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp?rev=65945&r1=65944&r2=65945&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp Tue Mar  3 06:12:58 2009
@@ -253,11 +253,12 @@
     // (allocations OF arrays are ok though), and an allocation of a scalar
     // value cannot be decomposed at all.
     uint64_t AllocaSize = TD->getTypePaddedSize(AI->getAllocatedType());
+
+    // Do not promote any struct whose size is too big.
+    if (AllocaSize >= SRThreshold) continue;
         
     if ((isa<StructType>(AI->getAllocatedType()) ||
          isa<ArrayType>(AI->getAllocatedType())) &&
-        // Do not promote any struct whose size is too big.
-        AllocaSize < SRThreshold &&
         // Do not promote any struct into more than "32" separate vars.
         getNumSAElements(AI->getAllocatedType()) < SRThreshold/4) {
       // Check that all of the users of the allocation are capable of being





More information about the llvm-commits mailing list