diff options
author | Hiroshi Inoue <inouehrs@jp.ibm.com> | 2017-11-30 08:29:51 +0000 |
---|---|---|
committer | Hiroshi Inoue <inouehrs@jp.ibm.com> | 2017-11-30 08:29:51 +0000 |
commit | 21e8ded4d2a4d90bee00ecb80abb812866fb6183 (patch) | |
tree | 4f3a18bee103f2ff1f1d8609a6c1ff5e2fe9cf13 /llvm/lib | |
parent | b9a2467501789390bc5376e0d3cb1e1f2fffb624 (diff) | |
download | bcm5719-llvm-21e8ded4d2a4d90bee00ecb80abb812866fb6183.tar.gz bcm5719-llvm-21e8ded4d2a4d90bee00ecb80abb812866fb6183.zip |
Revert rL319407: [SROA] enable splitting for non-whole-alloca loads and stores
This reverts commit rL319407 due to failures in some buildbot.
llvm-svn: 319410
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/Scalar/SROA.cpp | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/llvm/lib/Transforms/Scalar/SROA.cpp b/llvm/lib/Transforms/Scalar/SROA.cpp index d0431d48a43..bd064978b64 100644 --- a/llvm/lib/Transforms/Scalar/SROA.cpp +++ b/llvm/lib/Transforms/Scalar/SROA.cpp @@ -30,7 +30,6 @@ #include "llvm/ADT/PointerIntPair.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SetVector.h" -#include "llvm/ADT/SmallBitVector.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/Statistic.h" @@ -4048,31 +4047,21 @@ bool SROA::splitAlloca(AllocaInst &AI, AllocaSlices &AS) { // First try to pre-split loads and stores. Changed |= presplitLoadsAndStores(AI, AS); - // Now that we have identified any pre-splitting opportunities, - // mark loads and stores unsplittable except for the following case. - // We leave a slice splittable if all other slices are disjoint or fully - // included in the slice, such as whole-alloca loads and stores. - // If we fail to split these during pre-splitting, we want to force them - // to be rewritten into a partition. + // Now that we have identified any pre-splitting opportunities, mark any + // splittable (non-whole-alloca) loads and stores as unsplittable. If we fail + // to split these during pre-splitting, we want to force them to be + // rewritten into a partition. bool IsSorted = true; - - // If a byte boundary is included in any load or store, a slice starting or - // ending at the boundary is not splittable. - unsigned AllocaSize = DL.getTypeAllocSize(AI.getAllocatedType()); - SmallBitVector SplittableOffset(AllocaSize+1, true); - for (Slice &S : AS) - for (unsigned O = S.beginOffset() + 1; O < S.endOffset() && O < AllocaSize; - O++) - SplittableOffset.reset(O); - for (Slice &S : AS) { if (!S.isSplittable()) continue; - - if ((S.beginOffset() > AllocaSize || SplittableOffset[S.beginOffset()]) && - (S.endOffset() > AllocaSize || SplittableOffset[S.endOffset()])) + // FIXME: We currently leave whole-alloca splittable loads and stores. This + // used to be the only splittable loads and stores and we need to be + // confident that the above handling of splittable loads and stores is + // completely sufficient before we forcibly disable the remaining handling. + if (S.beginOffset() == 0 && + S.endOffset() >= DL.getTypeAllocSize(AI.getAllocatedType())) continue; - if (isa<LoadInst>(S.getUse()->getUser()) || isa<StoreInst>(S.getUse()->getUser())) { S.makeUnsplittable(); |