https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116258

            Bug ID: 116258
           Summary: PAREN_EXPR lowering for vectors is bad
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

Take:
```
#define vect8 __attribute__((vector_size(8)))
#define vect16 __attribute__((vector_size(16)))
#if 1
#define h(a) __builtin_assoc_barrier((a))
#else
#define h(a) (a)
#endif

 vect16 float  f( vect16 float  x, vect16 float vconstants0)
{
  vect16 float  t = (x * (vconstants0[0]));
  return (x + h(t));
}


```

This produces so many shuffles for no reason. If we remove the
__builtin_assoc_barrier, then it produces better code.

I Noticed this for PR 116257 while looking into a way of partly reverting the
patch to back using GCC vector extensions and maybe produce slightly better
code.

I think we should lowering it only if there is no move for the mode or it is
BLKmode.

Reply via email to