[IRTranslator] Use the alloc size instead of the store size when translating allocas
authorQuentin Colombet <quentin.colombet@gmail.com>
Fri, 3 May 2019 01:23:56 +0000 (01:23 +0000)
committerQuentin Colombet <quentin.colombet@gmail.com>
Fri, 3 May 2019 01:23:56 +0000 (01:23 +0000)
commitc9256cc6ba93d8152d8d320e69fba05390e7676b
treeea610743a93e8b96d2c41fe5ab14fb9a52d21516
parent72383538485d2d399b988b14ce871b5326db7a69
[IRTranslator] Use the alloc size instead of the store size when translating allocas

We use to incorrectly use the store size instead of the alloc size when
creating the stack slot for allocas.
On aarch64 this can be demonstrated by allocating weirdly sized types.

For instance, in the added test case, we use an alloca for i19. We used
to allocate a slot of size 24-bit (19 rounded up to the next byte),
whereas we really want to use a full 32-bit slot for this type.

llvm-svn: 359856
llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
llvm/test/CodeGen/AArch64/GlobalISel/irtranslator-weird-alloca-size.ll [new file with mode: 0644]