Add support for expanding trunc stores. Consider
authorDuncan Sands <baldrick@free.fr>
Tue, 30 Oct 2007 12:50:39 +0000 (12:50 +0000)
committerDuncan Sands <baldrick@free.fr>
Tue, 30 Oct 2007 12:50:39 +0000 (12:50 +0000)
commit01405f928418e1c1268dd0e7a4b9dd68e0cb146c
tree9d357668a77767bf82ba8b289bb88f1c97dea367
parentba3b1d10fd9bc3034a5947da7cc6e32a70ce23d4
Add support for expanding trunc stores.  Consider
storing an i170 on a 32 bit machine.  This is first
promoted to a trunc-i170 store of an i256.  On a
little-endian machine this expands to a store of
an i128 and a trunc-i42 store of an i128.  The
trunc-i42 store is further expanded to a trunc-i42
store of an i64, then to a store of an i32 and a
trunc-i10 store of an i32.  At this point the operand
type is legal (i32) and expansion stops (legalization
of the trunc-i10 needs to be handled in LegalizeDAG.cpp).
On big-endian machines the high bits are stored first,
and some bit-fiddling is needed in order to generate
aligned stores.

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