> -----Original Message-----
> From: Alex Coplan <alex.cop...@arm.com>
> Sent: 07 April 2021 14:15
> To: gcc-patches@gcc.gnu.org
> Cc: ni...@redhat.com; Richard Earnshaw <richard.earns...@arm.com>;
> Ramana Radhakrishnan <ramana.radhakrish...@arm.com>; Kyrylo
> Tkachov <kyrylo.tkac...@arm.com>; Richard Sandiford
> <richard.sandif...@arm.com>
> Subject: [PATCH v2] arm: Various MVE vec_duplicate fixes [PR99647]
> 
> Hi,
> 
> Here is a v2 of my previous attempt:
> https://gcc.gnu.org/pipermail/gcc-patches/2021-April/567724.html
> to fix this PR.
> 
> ---
> 
> This patch fixes various issues with vec_duplicate in the MVE patterns.
> Currently there are two patterns named *mve_mov<mode>. The second of
> these is really a vector duplicate rather than a move, so I've renamed
> it accordingly.
> 
> As it stands, there are several issues with this pattern:
> 1. The MVE_types iterator has an entry for TImode, but
>    vec_duplicate:TI is invalid.
> 2. The mode of the operand to vec_duplicate is SImode, but it should
>    vary according to the vector mode iterator.
> 3. The second alternative of this pattern is bogus: it allows matching
>    symbol_refs (the cause of the PR) and const_ints (which means that it
>    matches (vec_duplicate (const_int ...)) which is non-canonical: such
>    rtxes should be const_vectors instead and handled by the main vector
>    move pattern).
> 
> This patch fixes all of these issues, and removes the redundant
> *mve_vec_duplicate<mode> pattern.
> 
> Testing:
>  * Bootstrapped and regtested on arm-linux-gnueabihf, no regressions.
>  * Tested an arm-eabi cross configured with --with-float=hard
>    --with-arch=armv8.1-m.main+mve, no regressions.
> 
> OK for trunk and eventual backport to GCC 10?

Ok.
Thanks,
Kyrill

> 
> Thanks,
> Alex
> 
> gcc/ChangeLog:
> 
>       PR target/99647
>       * config/arm/iterators.md (MVE_vecs): New.
>       (V_elem): Also handle V2DF.
>       * config/arm/mve.md (*mve_mov<mode>): Rename to ...
>       (*mve_vdup<mode>): ... this. Remove second alternative since
>       vec_duplicate of const_int is not canonical RTL, and we don't
>       want to match symbol_refs. Fix up modes.
>       (*mve_vec_duplicate<mode>): Delete (pattern is redundant).
> 
> gcc/testsuite/ChangeLog:
> 
>       PR target/99647
>       * gcc.c-torture/compile/pr99647.c: New test.

Reply via email to