From 5a377cb27bb65ea608b63716454c9ae214ef81c9 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Tue, 3 Mar 2009 12:12:58 +0000 Subject: [PATCH] Reapply r65755, but reversing "<" to ">=". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65945 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/ScalarReplAggregates.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Transforms/Scalar/ScalarReplAggregates.cpp b/lib/Transforms/Scalar/ScalarReplAggregates.cpp index 3a4201bf81e..ee4b87227ae 100644 --- a/lib/Transforms/Scalar/ScalarReplAggregates.cpp +++ b/lib/Transforms/Scalar/ScalarReplAggregates.cpp @@ -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(AI->getAllocatedType()) || isa(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 -- 2.34.1