On Wed, 17 Oct 2018, H.J. Lu wrote:

We may simplify

 (subreg (vec_merge (vec_duplicate X) (vector) (const_int 1)) 0)

to X when mode of X is the same as of mode of subreg.

Hello,

we already have code to simplify vec_select(vec_merge):

    /* If we select elements in a vec_merge that all come from the same
       operand, select from that operand directly.  */

It would make sense to me to make the subreg transform as similar to it as possible, in particular you don't need to special case vec_duplicate, the transformation would see that everything comes from the first vector, produce (subreg (vec_duplicate X) 0), and let another transformation optimize that.

(I had tried at some point to canonicalize subreg to vec_select to avoid repeating such transformations, but it was rejected as a very bad idea)

--
Marc Glisse

Reply via email to