[X86] Fold (trunc (i32 (zextload i16))) into vbroadcast.
authorAhmed Bougacha <ahmed.bougacha@gmail.com>
Fri, 6 Nov 2015 23:16:48 +0000 (23:16 +0000)
committerAhmed Bougacha <ahmed.bougacha@gmail.com>
Fri, 6 Nov 2015 23:16:48 +0000 (23:16 +0000)
commit0e74be10346eaf68c3af03144023339df795dccd
tree010aa05d00b48ee2cc9d1782727dad061d8c604c
parent3ba3c016463bc5a8e506aa06df9d08236cbf6f31
[X86] Fold (trunc (i32 (zextload i16))) into vbroadcast.

When matching non-LSB-extracting truncating broadcasts, we now insert
the necessary SRL. If the scalar resulted from a load, the SRL will be
folded into it, creating a narrower, offset, load.

However, i16 loads aren't Desirable, so we get i16->i32 zextloads.
We already catch i16 aextloads; catch these as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252363 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86InstrSSE.td
test/CodeGen/X86/vector-shuffle-128-v8.ll
test/CodeGen/X86/vector-shuffle-256-v16.ll