llvm.org GIT mirror llvm / e0af6c9
Merging r283612: ------------------------------------------------------------------------ r283612 | davide | 2016-10-07 14:53:09 -0700 (Fri, 07 Oct 2016) | 5 lines [InstCombine] Don't unpack arrays that are too large (part 2). This is similar to r283599, but for store instructions. Thanks to David for pointing out! ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_39@288070 91177308-0d34-0410-b5e6-96231b3b80d8 Tom Stellard 2 years ago
2 changed file(s) with 16 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
10871087 return true;
10881088 }
10891089
1090 // Bail out if the array is too large. Ideally we would like to optimize
1091 // arrays of arbitrary size but this has a terrible impact on compile time.
1092 // The threshold here is chosen arbitrarily, maybe needs a little bit of
1093 // tuning.
1094 if (NumElements > 1024)
1095 return false;
1096
10901097 const DataLayout &DL = IC.getDataLayout();
10911098 auto EltSize = DL.getTypeAllocSize(AT->getElementType());
10921099 auto Align = SI.getAlignment();
4545 ; CHECK-NEXT: store %A__vtbl* @A__vtblZ, %A__vtbl** [[GEP]], align 8
4646 ; CHECK-NEXT: ret void
4747 store [1 x %A] [%A { %A__vtbl* @A__vtblZ }], [1 x %A]* %aa.ptr, align 8
48 ret void
49 }
50
51 define void @storeLargeArrayOfA([2000 x %A]* %aa.ptr) {
52 ; CHECK-LABEL: storeLargeArrayOfA
53 ; CHECK-NEXT: store [2000 x %A]
54 ; CHECK-NEXT: ret void
55 %i1 = insertvalue [2000 x %A] undef, %A { %A__vtbl* @A__vtblZ }, 1
56 store [2000 x %A] %i1, [2000 x %A]* %aa.ptr, align 8
4857 ret void
4958 }
5059