[PATCH] [CodeGen] Combine shuffle from concat+bitcast scalar to avoid the smaller vector type.
Ahmed Bougacha
ahmed.bougacha at gmail.com
Tue Apr 7 17:07:19 PDT 2015
Hi spatel, qcolombet,
Code that deals with small vectors but worries about performance (is hardware-aware) often passes the vectors around (on some targets as scalars, thanks to type coercion), but immediately shuffles them into a native-width vector, to do proper operations that we can't reasonably do a horrible job at. Promoting small vector types leads to some really nasty stuff, and people actively try to avoid that now ;)
Anyway, this means a pretty common pattern is this:
(vector_shuffle (v8i8 concat_vectors (v2i8 bitcast (i16)), undef..), M)
which we'll usually end up scalarizing. Instead, we can turn it into:
(vector_shuffle (v8i8 bitcast (v4i16 scalar_to_vector (i16))), M)
which lets us deal with native-width types all the time (this should be the foremost canonicalization goal whenever dealing with vectors IMHO, but I digress).
http://reviews.llvm.org/D8884
Files:
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
test/CodeGen/AArch64/concat_vectors-combines.ll
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8884.23382.patch
Type: text/x-patch
Size: 4633 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150408/4a3f5ea8/attachment.bin>
More information about the llvm-commits
mailing list