[Bug tree-optimization/101190] New: vectorizer failed to vectorize generate vashlv8hi, but use vashlv4si and extend.

crazylht at gmail dot com gcc-bugzilla@gcc.gnu.org
Thu Jun 24 08:05:13 GMT 2021


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

            Bug ID: 101190
           Summary: vectorizer failed to vectorize generate vashlv8hi, but
                    use vashlv4si and extend.
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: crazylht at gmail dot com
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu

cat test.c

void
foo (unsigned short* __restrict pdst, unsigned short* psrc)
{
  for (int i = 0; i != 8; i++)
    pdst[i] <<= psrc[i];
}

typedef short v8hi __attribute__((vector_size(16)));
v8hi
foo1 (v8hi a, v8hi b)
{
    return a << b;
}

After support vashl_optab, gcc still failed to generate vpsllvw for foo, only
success for foo1.

I wonder shouldn't foo be equal to foo1.


More information about the Gcc-bugs mailing list