On 17/09/18 12:43, Richard Sandiford wrote:
OK, sounds like the cost of vec_construct is too low then.  But looking
at the port, I see you have:
/* Implement TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST.  */

int
gcn_vectorization_cost (enum vect_cost_for_stmt ARG_UNUSED (type_of_cost),
                        tree ARG_UNUSED (vectype), int ARG_UNUSED (misalign))
{
   /* Always vectorize.  */
   return 1;
}

which short-circuits the cost-model altogether.  Isn't that part
of the problem?
Well, it's possible that that's a little simplistic. ;-)

Although, actually the elementwise issue predates the existence of gcn_vectorization_cost, and the default does appear to penalize vec_construct somewhat.
Actually, the default definition doesn't seem to do much besides 
increase vec_construct, so I'm not sure now why I needed to change it? 
Hmm, more experiments to do.
Thanks for the pointer.

Andrew

Reply via email to