[AArch64] Remove backend support for widen-sub

Richard Sandiford richard.sandiford@arm.com
Thu Jan 21 13:19:22 GMT 2021


Joel Hutton via Gcc-patches <gcc-patches@gcc.gnu.org> writes:
> Hi all, 
>
> This patch removes support for the widening subtract operation in the aarch64 backend as it is causing a performance regression.
>
> In the following example:
>
> #include <stdint.h>
> extern void wdiff( int16_t d[16], uint8_t *restrict pix1, uint8_t *restrict pix2)
> {
>    for( int y = 0; y < 4; y++ )
>   {    
>     for( int x = 0; x < 4; x++ )
>       d[x + y*4] = pix1[x] - pix2[x];
>     pix1 += 16;  
>     pix2 += 16;
>  }
>
> The widening minus pattern is recognized and substituted, but cannot be used due to the input vector type chosen in slp vectorization. This results in an attempt to do an 8 byte->8 short widening subtract operation, which is not supported. 
>
> The issue is documented in PR 98772.

IMO removing just the sub patterns is too arbitrary.  Like you say,
the PR affects all widening instructions. but it happens that the
first encountered regression used subtraction.

I think we should try to fix the PR instead.  The widening operations
can only be used for SLP if the group_size is at least double the
number of elements in the vectype, so one idea (not worked through)
is to make the vect_build_slp_tree family of routines undo pattern
recognition for widening operations if the group size is less than that.

Richi would know better than me though.

Thanks,
Richard

>
>
> [AArch64] Remove backend support for widen-sub
>
> This patch removes support for the widening subtract operation in the aarch64 backend as it is causing a performance regression.
>
> gcc/ChangeLog:
>
>         * config/aarch64/aarch64-simd.md    
>         (vec_widen_<su>subl_lo_<mode>): Removed.
>         (vec_widen_<su>subl_hi_<mode>): Removed.
>
> gcc/testsuite/ChangeLog:
>
>         * gcc.target/aarch64/vect-widen-sub.c: Removed.


More information about the Gcc-patches mailing list