> I'm really struggling to reproduce this locally, even I go back to
> r16-3343 or r16-2382.  I see RTL like the above, and like Jakub quotes
> in the PR, but don't see CSE mishandling it.  Not sure what I'm doing
> wrong.

For me what worked is to build from trunk on cfarm424 and test there.

> That means I haven't been able to experiment and so have to ask stupid
> questions instead :)  But I'm not sure I understand the condition in
> the patch.  Why is NUNITS != 1 different?  The V8QI gen_lowpart is
> zero-extending the constant in the same way that a DI subreg would,
> and a DI (const_int 3) is interchangeable with:
>
>    (const_vector:V8QI [
>                   (const_int 3 [0x3])
>                   (const_int 0 [0]) repeated x7])

Yes, thinking more about it, it's not really clear.  The reasoning was to 
prevent clobbering of other elements but, in isolation, we don't even know that 
there are other elements.  So, even though it works, it's rather a band-aid.

A problem closer to the root could be that we do
  rtx y = simplify_gen_vec_select (SET_DEST (x), i);
which, for element 0, collapses to the simple QImode constant we're seeing.
In doing so, we forget the broader vec_select context.
IMHO we shouldn't simplify here but rather keep vec_select even for element 0. 
I'll experiment with that.


-- 
Regards
 Robin

Reply via email to