[patch, vectorizer] Fix PR tree-optimization/36493

Ira Rosen IRAR@il.ibm.com
Mon Jun 16 12:19:00 GMT 2008


Hi,

"Richard Guenther" <richard.guenther@gmail.com> wrote on 12/06/2008
12:06:20:

> >
> > +  if (!useless_type_conversion_p (TREE_TYPE (op), TREE_TYPE
> > (scalar_dest))),
> > +    {
> > +      if (vect_print_dump_info (REPORT_DETAILS)),
> > +        fprintf (vect_dump, "operands of different types");
> > +      return false;
> > +    }
>
> This is always true.  In a GIMPLE_MODIFY_STMT the rhs type is
> trivially convertible to the lhs type.
>
> What you want to check is whether accesses through the vector pointer
> correctly alias the scalar destination.  Thus something along the line of
>
>   /* If accesses through a pointer to vectype do not alias the original
>      memory reference we have a problem.  */
>   if (get_alias_set (vectype) != get_alias_set (scalar_dest)
>       && !alias_set_subset_of (get_alias_set (vectype), get_alias_set
> (scalar_dest))
>     {
>       if (vect_print_dump_info (REPORT_DETAILS)),
>         fprintf (vect_dump, "vector type does not alias scalar type");
>       return false;
>     }
>
> which you in the end could fix by generating a ref-all pointer type in
> vect_create_data_ref_ptr (using build_pointer_type_for_mode).
>

I committed the attached patch that contains this check. I also added the
check to vectorizable_load().

Thanks,
Ira

> Otherwise the change looks ok.
>
> Richard.
>

(See attached file: pr36493.txt)
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: pr36493.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20080616/05b1a313/attachment.txt>


More information about the Gcc-patches mailing list