]> granicus.if.org Git - llvm/commit
Struct byval: use the correct alignment for loads generated to load
authorManman Ren <manman.ren@gmail.com>
Mon, 7 Oct 2013 19:47:53 +0000 (19:47 +0000)
committerManman Ren <manman.ren@gmail.com>
Mon, 7 Oct 2013 19:47:53 +0000 (19:47 +0000)
commitfb92f4645968724d2095ef95a7034d7e20d39b3f
treeb7bd9c3c111dd3ec500bfecf292dbd551abacc74
parent116189a997a71d0e63db64ef4c6c3906078d94cf
Struct byval: use the correct alignment for loads generated to load
from struct byval to registers.

We used to pass 0 which means the alignment of PtrVT. Even when the alignment
of the struct is smaller than 4, the LOADs would have alignment of 4, and
further optimizations could combine the LOADs into a ldm, which would
cause crash.

The fix is to pass the alignment of the struct byval.

rdar://problem/15144402

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192126 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/ARM/ARMISelLowering.cpp
test/CodeGen/ARM/byval_load_align.ll [new file with mode: 0644]