Instcombine: destructor loads of structs that do not contains padding
authorMehdi Amini <mehdi.amini@apple.com>
Tue, 15 Dec 2015 01:44:07 +0000 (01:44 +0000)
committerMehdi Amini <mehdi.amini@apple.com>
Tue, 15 Dec 2015 01:44:07 +0000 (01:44 +0000)
commit257fee7c73127582dd81693b8c14dbb3ba0108c8
tree1330cf632bca5caa9ab24fa404bc203377f1bed8
parentf2829c933c47e297b99b45a5453d751de31a9f12
Instcombine: destructor loads of structs that do not contains padding

For non padded structs, we can just proceed and deaggregate them.
We don't want ot do this when there is padding in the struct as to not
lose information about this padding (the subsequents passes would then
try hard to preserve the padding, which is undesirable).

Also update extractvalue.ll and cast.ll so that they use structs with padding.

Remove the FIXME in the extractvalue of laod case as the non padded case is
handled when processing the load, and we don't want to do it on the padded
case.

Patch by: Amaury SECHET <deadalnix@gmail.com>

Differential Revision: http://reviews.llvm.org/D14483

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255600 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/DataLayout.h
lib/IR/DataLayout.cpp
lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
lib/Transforms/InstCombine/InstructionCombining.cpp
test/Transforms/InstCombine/cast.ll
test/Transforms/InstCombine/extractvalue.ll
test/Transforms/InstCombine/unpack-fca.ll