[SelectionDAG] Fix codegen of vector stores with non byte-sized elements.
authorJonas Paulsson <paulsson@linux.vnet.ibm.com>
Sat, 20 Jan 2018 16:05:10 +0000 (16:05 +0000)
committerJonas Paulsson <paulsson@linux.vnet.ibm.com>
Sat, 20 Jan 2018 16:05:10 +0000 (16:05 +0000)
commit7ad28863fb5cf098b3c8479cf0845263e297bbfc
tree68cdf73ac5e78bc2397c14598d73e1c60e33bc89
parente6de5a100d51ca240a26ed4ab3ca7e3aa2026927
[SelectionDAG] Fix codegen of vector stores with non byte-sized elements.

This was completely broken, but hopefully fixed by this patch.

In cases where it is needed, a vector with non byte-sized elements is stored
by extracting, zero-extending, shift:ing and or:ing the elements into an
integer of the same width as the vector, which is then stored.

Review: Eli Friedman, Ulrich Weigand
https://reviews.llvm.org/D42100#inline-369520
https://bugs.llvm.org/show_bug.cgi?id=35520

llvm-svn: 323042
llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
llvm/test/CodeGen/Generic/store_nonbytesized_vecs.ll [new file with mode: 0644]
llvm/test/CodeGen/SystemZ/vec-move-17.ll
llvm/test/CodeGen/X86/bitcast-and-setcc-512.ll
llvm/test/CodeGen/X86/bitcast-setcc-512.ll
llvm/test/CodeGen/X86/clear_upper_vector_element_bits.ll
llvm/test/CodeGen/X86/pr20011.ll
llvm/test/CodeGen/X86/trunc-store.ll
llvm/test/CodeGen/X86/vector-compare-results.ll