SRThreshold is meant to be inclusive.
authorEvan Cheng <evan.cheng@apple.com>
Fri, 6 Mar 2009 00:56:43 +0000 (00:56 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Fri, 6 Mar 2009 00:56:43 +0000 (00:56 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66227 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/ScalarReplAggregates.cpp

index 441b448c010760fcbc4ac4ac27099c90540199d3..710bdfb6f7e2e32dcafb31e629a8f0e5a561bd85 100644 (file)
@@ -260,7 +260,7 @@ bool SROA::performScalarRepl(Function &F) {
     if ((isa<StructType>(AI->getAllocatedType()) ||
          isa<ArrayType>(AI->getAllocatedType())) &&
         // Do not promote any struct into more than "32" separate vars.
-        getNumSAElements(AI->getAllocatedType()) < SRThreshold/4) {
+        getNumSAElements(AI->getAllocatedType()) <= SRThreshold/4) {
       // Check that all of the users of the allocation are capable of being
       // transformed.
       switch (isSafeAllocaToScalarRepl(AI)) {