When expanding unaligned loads and stores do not make
authorDuncan Sands <baldrick@free.fr>
Fri, 12 Dec 2008 21:47:02 +0000 (21:47 +0000)
committerDuncan Sands <baldrick@free.fr>
Fri, 12 Dec 2008 21:47:02 +0000 (21:47 +0000)
commit05e11fab87102a230551327bfc8434ffad7a88d4
tree3e88df0eabd2607ebd857167823fb7ddf08f233c
parentd350e02e19e1b79c3fd6dc70ee3c01ab75c631c1
When expanding unaligned loads and stores do not make
use of illegal integer types: instead, use a stack slot
and copying via integer registers.  The existing code
is still used if the bitconvert is to a legal integer
type.

This fires on the PPC testcases 2007-09-08-unaligned.ll
and vec_misaligned.ll.  It looks like equivalent code
is generated with these changes, just permuted, but
it's hard to tell.

With these changes, nothing in LegalizeDAG produces
illegal integer types anymore.  This is a prerequisite
for removing the LegalizeDAG type legalization code.

While there I noticed that the existing code doesn't
handle trunc store of f64 to f32: it turns this into
an i64 store, which represents a 4 byte stack smash.
I added a FIXME about this.  Hopefully someone more
motivated than I am will take care of it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60964 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/LegalizeDAG.cpp