1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

Relax an overly aggressive assert to fix PR14572.

The alloca width is based on the alloc size, not the type size.

llvm-svn: 170270
This commit is contained in:
Chandler Carruth 2012-12-15 09:26:06 +00:00
parent 63f4e5f8b9
commit 0fa6260bcf
2 changed files with 17 additions and 1 deletions

View File

@ -2607,7 +2607,7 @@ private:
TD.getTypeStoreSizeInBits(V->getType()) &&
"Non-byte-multiple bit width");
assert(V->getType()->getIntegerBitWidth() ==
TD.getTypeSizeInBits(OldAI.getAllocatedType()) &&
TD.getTypeAllocSizeInBits(OldAI.getAllocatedType()) &&
"Only alloca-wide stores can be split and recomposed");
IntegerType *NarrowTy = Type::getIntNTy(SI.getContext(), Size * 8);
V = extractInteger(TD, IRB, V, NarrowTy, BeginOffset,

View File

@ -1176,3 +1176,19 @@ entry:
%baz = load i1* %a.i1, align 1
ret void
}
define <3 x i8> @PR14572(i32 %x) {
; Ensure that a split integer store which is wider than the type size of the
; alloca (relying on the alloc size padding) doesn't trigger an assert.
; CHECK: @PR14572
entry:
%a = alloca <3 x i8>, align 4
; CHECK-NOT: alloca
%cast = bitcast <3 x i8>* %a to i32*
store i32 %x, i32* %cast, align 1
%y = load <3 x i8>* %a, align 4
ret <3 x i8> %y
; CHECK: ret <3 x i8>
}