Reapply r65755, but reversing "<" to ">=".

llvm-svn: 65945
This commit is contained in:
Bill Wendling 2009-03-03 12:12:58 +00:00
parent 33435e49a9
commit 3e44bf3c4b
1 changed files with 3 additions and 2 deletions

View File

@ -253,11 +253,12 @@ bool SROA::performScalarRepl(Function &F) {
// (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