[llvm-branch-commits] [llvm-branch] r288069 - Merging r283599:
Tom Stellard via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Nov 28 13:35:40 PST 2016
Author: tstellar
Date: Mon Nov 28 15:35:40 2016
New Revision: 288069
URL: http://llvm.org/viewvc/llvm-project?rev=288069&view=rev
Log:
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
------------------------------------------------------------------------
Modified:
llvm/branches/release_39/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
llvm/branches/release_39/test/Transforms/InstCombine/unpack-fca.ll
Modified: llvm/branches/release_39/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_39/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp?rev=288069&r1=288068&r2=288069&view=diff
==============================================================================
--- llvm/branches/release_39/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp (original)
+++ llvm/branches/release_39/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp Mon Nov 28 15:35:40 2016
@@ -579,6 +579,13 @@ static Instruction *unpackLoadToAggregat
UndefValue::get(T), NewLoad, 0, Name));
}
+ // Bail out if the array is too large. Ideally we would like to optimize
+ // arrays of arbitrary size but this has a terrible impact on compile time.
+ // The threshold here is chosen arbitrarily, maybe needs a little bit of
+ // tuning.
+ if (NumElements > 1024)
+ return nullptr;
+
const DataLayout &DL = IC.getDataLayout();
auto EltSize = DL.getTypeAllocSize(ET);
auto Align = LI.getAlignment();
Modified: llvm/branches/release_39/test/Transforms/InstCombine/unpack-fca.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_39/test/Transforms/InstCombine/unpack-fca.ll?rev=288069&r1=288068&r2=288069&view=diff
==============================================================================
--- llvm/branches/release_39/test/Transforms/InstCombine/unpack-fca.ll (original)
+++ llvm/branches/release_39/test/Transforms/InstCombine/unpack-fca.ll Mon Nov 28 15:35:40 2016
@@ -179,6 +179,14 @@ define [2 x %B] @loadArrayOfB([2 x %B]*
ret [2 x %B] %1
}
+define [2000 x %B] @loadLargeArrayOfB([2000 x %B]* %ab.ptr) {
+; CHECK-LABEL: loadLargeArrayOfB
+; CHECK-NEXT: load [2000 x %B], [2000 x %B]* %ab.ptr, align 8
+; CHECK-NEXT: ret [2000 x %B]
+ %1 = load [2000 x %B], [2000 x %B]* %ab.ptr, align 8
+ ret [2000 x %B] %1
+}
+
%struct.S = type <{ i8, %struct.T }>
%struct.T = type { i32, i32 }
More information about the llvm-branch-commits
mailing list