[PATCH] [CodeGen] Combine small-element shuffles of scalar_to_vector in terms of the wider scalar.
Ahmed Bougacha
ahmed.bougacha at gmail.com
Wed Apr 8 17:47:15 PDT 2015
Try combining to BUILD_VECTOR instead, adding to the 2-input scalar shuffle combine.
I didn't look at two bitcasts at the same time because this only fires because of http://reviews.llvm.org/D8884: otherwise, the vector_shuffle combine is way too early (and the operands are legalized to BUILD_VECTOR/SCALAR_TO_VECTOR right after), and either the operands get lowered between combine rounds, or other combines catch this without needing to peak through bitcasts (usually concat_vectors if you have two vector inputs).
This does change one ARM test, where we replace:
vmov r0, r1, d16
vmov.32 d16[0], r0
vmov.32 d16[1], r1
vext.8 q8, q8, q8, #4
with:
vmov r0, r1, d16
vmov.32 d16[0], r1
Which looks ..interesting, but is an improvement nonetheless.
-Ahmed
http://reviews.llvm.org/D8885
Files:
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
test/CodeGen/AArch64/concat_vectors-combines.ll
test/CodeGen/ARM/vector-DAGCombine.ll
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8885.23457.patch
Type: text/x-patch
Size: 5816 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150409/13f80851/attachment.bin>
More information about the llvm-commits
mailing list