http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58497

            Bug ID: 58497
           Summary: SLP vectorizes identical operations
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: glisse at gcc dot gnu.org

typedef float float4 __attribute__((vector_size(16)));

float4 g(int x)
{
  float4 W;
  W[0]=W[1]=W[2]=W[3]=x+1;
  return W;
}

is vectorized by SLP to:

  vect_cst_.4_11 = {x_1(D), x_1(D), x_1(D), x_1(D)};
  vect__2.3_13 = vect_cst_.4_11 + { 1, 1, 1, 1 };
  vect__3.6_14 = (vector(4) floatD.38) vect__2.3_13;

Maybe when a vector is really the same scalar copied into all slots it would be
better not to turn the scalar ops into vector ops? (turning the 4 BIT_FIELD_REF
writes into a constructor is still good though)

Reply via email to