On Sun, 9 Sep 2012, Marc Glisse wrote:

Hello,

this patch lets the compiler try to rewrite:

(vec_concat (vec_select x [a]) (vec_select x [b]))

as:

vec_select x [a b]

or even just "x" if appropriate.

In a first iteration I was restricting it to b-a==1, but it seemed better not to: it helps for {v[1],v[0]} and doesn't change anything for unknown patterns.

Note that I am planning to do a similar optimization at tree level, but it shouldn't make this one useless because such patterns can be created during rtl passes. The testcase may need an additional -fno-tree-xxx to still be useful at that point though.

Since the tree-ssa patch was reviewed faster, assume there is a -fno-tree-forwprop in dg-options for the testcase.

bootstrap+testsuite on x86_64-linux-gnu.

2012-09-09  Marc Glisse  <marc.gli...@inria.fr>

gcc/
        * simplify-rtx.c (simplify_binary_operation_1): Handle vec_concat
        of vec_selects from the same vector.

gcc/testsuite/
        * gcc.target/i386/vect-rebuild.c: New testcase.

http://gcc.gnu.org/ml/gcc-patches/2012-09/msg00540.html

--
Marc Glisse

Reply via email to