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

--- Comment #6 from Tamar Christina <tnfchris at gcc dot gnu.org> ---
> Actually, what I wish is that we could allow vectorization on early break
> case for arbitrary address pointer (knowing nothing about alignment and
> bound) based on some sort of assumption specified via command option under
> -Ofast, as the mentioned example:
> 
> char * find(char *string, size_t n, char c)
> {
>     for (size_t i = 0; i < n; i++) {
>         if (string[i] == c)
>             return &string[i];
>     }
>     return 0;
> }
> 
> and example for which there is no way to do peeling to align more than one
> address pointers:
> 
> int compare(char *string1, char *string2, size_t n)
> {
>     for (size_t i = 0; i < n; i++) {
>         if (string1[i] != string2[i])
>             return string1[i] - string2[i];
>     }
>     return 0;
> }

in Alex's patch for alignment peeling we'll allow them by inserting a mutual
alignment check between all the pointers when not fully masked.  This should be
upstream soon.

For fully masked architectures we can do better by using First Faulting Loads
here, but that won't be ready for GCC 15.

Reply via email to