summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/SROA.cpp
diff options
context:
space:
mode:
authorHiroshi Inoue <inouehrs@jp.ibm.com>2017-12-18 06:47:37 +0000
committerHiroshi Inoue <inouehrs@jp.ibm.com>2017-12-18 06:47:37 +0000
commitc6faf15459ad276ed8e44341783d4d663d8a4d2a (patch)
tree64191fc630586095f7a9a94f19dc3896bf24260a /llvm/lib/Transforms/Scalar/SROA.cpp
parent8e2837cc6e0bc07d0f2722aa277a2c433946df05 (diff)
downloadbcm5719-llvm-c6faf15459ad276ed8e44341783d4d663d8a4d2a.tar.gz
bcm5719-llvm-c6faf15459ad276ed8e44341783d4d663d8a4d2a.zip
[SROA] Disable non-whole-alloca splits by default
This patch introduce a switch to control splitting of non-whole-alloca slices with default off. The switch will be default on again after fixing an issue reported in PR35657. llvm-svn: 320958
Diffstat (limited to 'llvm/lib/Transforms/Scalar/SROA.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/SROA.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/SROA.cpp b/llvm/lib/Transforms/Scalar/SROA.cpp
index 2e5023398f2..bfe3754f076 100644
--- a/llvm/lib/Transforms/Scalar/SROA.cpp
+++ b/llvm/lib/Transforms/Scalar/SROA.cpp
@@ -124,6 +124,11 @@ static cl::opt<bool> SROARandomShuffleSlices("sroa-random-shuffle-slices",
static cl::opt<bool> SROAStrictInbounds("sroa-strict-inbounds", cl::init(false),
cl::Hidden);
+/// Hidden option to allow more aggressive splitting.
+static cl::opt<bool>
+SROASplitNonWholeAllocaSlices("sroa-split-nonwhole-alloca-slices",
+ cl::init(false), cl::Hidden);
+
namespace {
/// \brief A custom IRBuilder inserter which prefixes all names, but only in
@@ -4058,7 +4063,7 @@ bool SROA::splitAlloca(AllocaInst &AI, AllocaSlices &AS) {
uint64_t AllocaSize = DL.getTypeAllocSize(AI.getAllocatedType());
const uint64_t MaxBitVectorSize = 1024;
- if (AllocaSize <= MaxBitVectorSize) {
+ if (SROASplitNonWholeAllocaSlices && AllocaSize <= MaxBitVectorSize) {
// If a byte boundary is included in any load or store, a slice starting or
// ending at the boundary is not splittable.
SmallBitVector SplittableOffset(AllocaSize + 1, true);
OpenPOWER on IntegriCloud