llvm.org GIT mirror llvm / 7e79c45
Merging r283599: ------------------------------------------------------------------------ r283599 | davide | 2016-10-07 13:57:42 -0700 (Fri, 07 Oct 2016) | 4 lines [InstCombine] Don't unpack arrays that are too large Differential Revision: https://reviews.llvm.org/D25376 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_39@288069 91177308-0d34-0410-b5e6-96231b3b80d8 Tom Stellard 2 years ago
2 changed file(s) with 15 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
578578 UndefValue::get(T), NewLoad, 0, Name));
579579 }
580580
581 // Bail out if the array is too large. Ideally we would like to optimize
582 // arrays of arbitrary size but this has a terrible impact on compile time.
583 // The threshold here is chosen arbitrarily, maybe needs a little bit of
584 // tuning.
585 if (NumElements > 1024)
586 return nullptr;
587
581588 const DataLayout &DL = IC.getDataLayout();
582589 auto EltSize = DL.getTypeAllocSize(ET);
583590 auto Align = LI.getAlignment();
178178 ret [2 x %B] %1
179179 }
180180
181 define [2000 x %B] @loadLargeArrayOfB([2000 x %B]* %ab.ptr) {
182 ; CHECK-LABEL: loadLargeArrayOfB
183 ; CHECK-NEXT: load [2000 x %B], [2000 x %B]* %ab.ptr, align 8
184 ; CHECK-NEXT: ret [2000 x %B]
185 %1 = load [2000 x %B], [2000 x %B]* %ab.ptr, align 8
186 ret [2000 x %B] %1
187 }
188
181189 %struct.S = type <{ i8, %struct.T }>
182190 %struct.T = type { i32, i32 }
183191