Skip to content

Commit 205cde6

Browse files
committed
Revert "[SROA] Avoid splitting loads/stores with irregular type"
This reverts commit 905f4eb. Breaks check-llvm on most (all?) bots, see https://reviews.llvm.org/D99435
1 parent aef5d8f commit 205cde6

File tree

2 files changed

+1
-52
lines changed

2 files changed

+1
-52
lines changed

llvm/lib/Transforms/Scalar/SROA.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -768,8 +768,7 @@ class AllocaSlices::SliceBuilder : public PtrUseVisitor<SliceBuilder> {
768768
// We allow splitting of non-volatile loads and stores where the type is an
769769
// integer type. These may be used to implement 'memcpy' or other "transfer
770770
// of bits" patterns.
771-
bool IsSplittable =
772-
Ty->isIntegerTy() && !IsVolatile && DL.typeSizeEqualsStoreSize(Ty);
771+
bool IsSplittable = Ty->isIntegerTy() && !IsVolatile;
773772

774773
insertUse(I, Offset, Size, IsSplittable);
775774
}
@@ -3990,7 +3989,6 @@ bool SROA::presplitLoadsAndStores(AllocaInst &AI, AllocaSlices &AS) {
39903989
SplitLoads.clear();
39913990

39923991
IntegerType *Ty = cast<IntegerType>(LI->getType());
3993-
assert(Ty->getBitWidth() % 8 == 0);
39943992
uint64_t LoadSize = Ty->getBitWidth() / 8;
39953993
assert(LoadSize > 0 && "Cannot have a zero-sized integer load!");
39963994

@@ -4115,7 +4113,6 @@ bool SROA::presplitLoadsAndStores(AllocaInst &AI, AllocaSlices &AS) {
41154113
for (StoreInst *SI : Stores) {
41164114
auto *LI = cast<LoadInst>(SI->getValueOperand());
41174115
IntegerType *Ty = cast<IntegerType>(LI->getType());
4118-
assert(Ty->getBitWidth() % 8 == 0);
41194116
uint64_t StoreSize = Ty->getBitWidth() / 8;
41204117
assert(StoreSize > 0 && "Cannot have a zero-sized integer store!");
41214118

llvm/test/Transforms/SROA/irregular-type.ll

Lines changed: 0 additions & 48 deletions
This file was deleted.

0 commit comments

Comments
 (0)