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

            Bug ID: 92098
           Summary: After r262333, the following code cannot be vectorized
                    on powerpc64le.
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: helijia at gcc dot gnu.org
  Target Milestone: ---

Created attachment 47035
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47035&action=edit
dump file(Includes dump files that can be vectorized and not vectorized)

For the following code
---
#define NIL 0

typedef struct {
  unsigned int hash_size;
  unsigned short * head, * prev;
  unsigned int w_size;
} deflate_state;

void slide_hash(deflate_state *s)
{
    unsigned n, m;
    unsigned short *p;
    unsigned int wsize = s->w_size;

    n = s->hash_size;
    p = &s->head[n];
    do {
        m = *--p;
        *p = (unsigned short)(m >= wsize ? m - wsize : NIL);
    } while (--n);
}
---

The compile command I used is 
cc1 a.c -Ofast  -fdump-tree-vect-details-all -fdump-tree-slp-details-all

we found r262333 will cause it can not be vectorized.  Because

a.c:20:5: note:   vect_is_simple_use: vectype vector(4) unsigned intD.4
a.c:20:5: note:   not vectorized: relevant stmt not supported: patt_37 =
wsize_12 <= m_16;
a.c:20:5: note:  bad operation or unsupported loop bound.

But before the commit this code can be vectorized.

Attachment is the file I dumped

Reply via email to