diff mbox series

[AArch32] : Correct sdot RTL on aarch32

Message ID patch-14500-tamar@arm.com
State New
Headers show
Series [AArch32] : Correct sdot RTL on aarch32 | expand

Commit Message

Tamar Christina May 25, 2021, 2:58 p.m. UTC
Hi All,

The RTL Generated from <sup>dot_prod<vsi2qi> is invalid as operand3 cannot be
written to, it's a normal input.  For the expand it's just another operand
but the caller does not expect it to be written to.

Bootstrapped Regtested on arm-none-linux-gnueabihf and no issues.

Ok for master? and backport to GCC 11, 10, 9?

Thanks,
Tamar

gcc/ChangeLog:

	* config/arm/neon.md (<sup>dot_prod<vsi2qi>): Drop statements.

--- inline copy of patch -- 
diff --git a/gcc/config/arm/neon.md b/gcc/config/arm/neon.md
index 61d81646475ce3bf62ece2cec2faf0c1fe978ec1..9602e9993aeebf4ec620d105fd20f64498a3b851 100644


--

Comments

Kyrylo Tkachov June 2, 2021, 9:37 a.m. UTC | #1
> -----Original Message-----
> From: Tamar Christina <Tamar.Christina@arm.com>
> Sent: 02 June 2021 10:34
> To: Tamar Christina <Tamar.Christina@arm.com>
> Cc: Richard Earnshaw <Richard.Earnshaw@arm.com>; nd <nd@arm.com>;
> Ramana Radhakrishnan <Ramana.Radhakrishnan@arm.com>; Kyrylo
> Tkachov <Kyrylo.Tkachov@arm.com>
> Subject: RE: [PATCH][AArch32]: Correct sdot RTL on aarch32
> 
> ping
> 
> > -----Original Message-----
> > From: Gcc-patches <gcc-patches-bounces@gcc.gnu.org> On Behalf Of
> Tamar
> > Christina via Gcc-patches
> > Sent: Tuesday, May 25, 2021 3:58 PM
> > To: gcc-patches@gcc.gnu.org
> > Cc: Richard Earnshaw <Richard.Earnshaw@arm.com>; nd <nd@arm.com>;
> > Ramana Radhakrishnan <Ramana.Radhakrishnan@arm.com>
> > Subject: [PATCH][AArch32]: Correct sdot RTL on aarch32
> >
> > Hi All,
> >
> > The RTL Generated from <sup>dot_prod<vsi2qi> is invalid as operand3
> > cannot be written to, it's a normal input.  For the expand it's just another
> > operand but the caller does not expect it to be written to.
> >
> > Bootstrapped Regtested on arm-none-linux-gnueabihf and no issues.
> >
> > Ok for master? and backport to GCC 11, 10, 9?

Ok.
Thanks,
Kyrill

> >
> > Thanks,
> > Tamar
> >
> > gcc/ChangeLog:
> >
> > 	* config/arm/neon.md (<sup>dot_prod<vsi2qi>): Drop statements.
> >
> > --- inline copy of patch --
> > diff --git a/gcc/config/arm/neon.md b/gcc/config/arm/neon.md index
> >
> 61d81646475ce3bf62ece2cec2faf0c1fe978ec1..9602e9993aeebf4ec620d10
> 5fd
> > 20f64498a3b851 100644
> > --- a/gcc/config/arm/neon.md
> > +++ b/gcc/config/arm/neon.md
> > @@ -3067,13 +3067,7 @@ (define_expand "<sup>dot_prod<vsi2qi>"
> >  		     DOTPROD)
> >  		    (match_operand:VCVTI 3 "register_operand")))]
> >    "TARGET_DOTPROD"
> > -{
> > -  emit_insn (
> > -    gen_neon_<sup>dot<vsi2qi> (operands[3], operands[3], operands[1],
> > -				 operands[2]));
> > -  emit_insn (gen_rtx_SET (operands[0], operands[3]));
> > -  DONE;
> > -})
> > +)
> >
> >  ;; Auto-vectorizer pattern for usdot
> >  (define_expand "usdot_prod<vsi2qi>"
> >
> >
> > --
Christophe Lyon July 15, 2021, 8:38 a.m. UTC | #2
Hi Tamar,


On Tue, May 25, 2021 at 5:41 PM Tamar Christina via Gcc-patches <
gcc-patches@gcc.gnu.org> wrote:

> Hi All,
>
> The RTL Generated from <sup>dot_prod<vsi2qi> is invalid as operand3 cannot
> be
> written to, it's a normal input.  For the expand it's just another operand
> but the caller does not expect it to be written to.
>
> Bootstrapped Regtested on arm-none-linux-gnueabihf and no issues.
>
> Ok for master? and backport to GCC 11, 10, 9?
>
> Thanks,
> Tamar
>
> gcc/ChangeLog:
>
>         * config/arm/neon.md (<sup>dot_prod<vsi2qi>): Drop statements.
>
> --- inline copy of patch --
> diff --git a/gcc/config/arm/neon.md b/gcc/config/arm/neon.md
> index
> 61d81646475ce3bf62ece2cec2faf0c1fe978ec1..9602e9993aeebf4ec620d105fd20f64498a3b851
> 100644
> --- a/gcc/config/arm/neon.md
> +++ b/gcc/config/arm/neon.md
> @@ -3067,13 +3067,7 @@ (define_expand "<sup>dot_prod<vsi2qi>"
>                      DOTPROD)
>                     (match_operand:VCVTI 3 "register_operand")))]
>    "TARGET_DOTPROD"
> -{
> -  emit_insn (
> -    gen_neon_<sup>dot<vsi2qi> (operands[3], operands[3], operands[1],
> -                                operands[2]));
> -  emit_insn (gen_rtx_SET (operands[0], operands[3]));
> -  DONE;
> -})
> +)
>
>  ;; Auto-vectorizer pattern for usdot
>  (define_expand "usdot_prod<vsi2qi>"
>
>
This patch is causing ICEs on arm-eabi (and probably arm-linux-gnueabi but
trunk build is currently broken):

 FAIL: gcc.target/arm/simd/vect-dot-s8.c (internal compiler error)
FAIL: gcc.target/arm/simd/vect-dot-s8.c (test for excess errors)
Excess errors:
/gcc/testsuite/gcc.target/arm/simd/vect-dot-qi.h:15:1: error:
unrecognizable insn:
(insn 29 28 30 5 (set (reg:V4SI 132 [ vect_patt_31.15 ])
        (plus:V4SI (unspec:V4SI [
                    (reg:V16QI 182)
                    (reg:V16QI 183)
                ] UNSPEC_DOT_S)
            (reg:V4SI 184))) -1
     (nil))
during RTL pass: vregs
/gcc/testsuite/gcc.target/arm/simd/vect-dot-qi.h:15:1: internal compiler
error: in extract_insn, at recog.c:2769
0x5fc656 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
        /gcc/rtl-error.c:108
0x5fc672 _fatal_insn_not_found(rtx_def const*, char const*, int, char
const*)
        /gcc/rtl-error.c:116
0xcbbe07 extract_insn(rtx_insn*)
        /gcc/recog.c:2769
0x9e2e95 instantiate_virtual_regs_in_insn
        /gcc/function.c:1611
0x9e2e95 instantiate_virtual_regs
        /gcc/function.c:1985
0x9e2e95 execute
        /gcc/function.c:2034

Can you check?

Thanks,

Christophe
Tamar Christina July 15, 2021, 1:05 p.m. UTC | #3
Hi Christophe,

Sorry about that, the ICEs should be fixed now and the execution tests are being fixed now.

They were being hidden by a model bug which kept saying everything passed even when failed ☹

Regards,
Tamar

From: Christophe Lyon <christophe.lyon.oss@gmail.com>
Sent: Thursday, July 15, 2021 9:39 AM
To: Tamar Christina <Tamar.Christina@arm.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>; Richard Earnshaw <Richard.Earnshaw@arm.com>; nd <nd@arm.com>; Ramana Radhakrishnan <Ramana.Radhakrishnan@arm.com>
Subject: Re: [PATCH][AArch32]: Correct sdot RTL on aarch32

Hi Tamar,


On Tue, May 25, 2021 at 5:41 PM Tamar Christina via Gcc-patches <gcc-patches@gcc.gnu.org<mailto:gcc-patches@gcc.gnu.org>> wrote:
Hi All,

The RTL Generated from <sup>dot_prod<vsi2qi> is invalid as operand3 cannot be
written to, it's a normal input.  For the expand it's just another operand
but the caller does not expect it to be written to.

Bootstrapped Regtested on arm-none-linux-gnueabihf and no issues.

Ok for master? and backport to GCC 11, 10, 9?

Thanks,
Tamar

gcc/ChangeLog:

        * config/arm/neon.md (<sup>dot_prod<vsi2qi>): Drop statements.

--- inline copy of patch --
diff --git a/gcc/config/arm/neon.md b/gcc/config/arm/neon.md
index 61d81646475ce3bf62ece2cec2faf0c1fe978ec1..9602e9993aeebf4ec620d105fd20f64498a3b851 100644
--- a/gcc/config/arm/neon.md
+++ b/gcc/config/arm/neon.md
@@ -3067,13 +3067,7 @@ (define_expand "<sup>dot_prod<vsi2qi>"
                     DOTPROD)
                    (match_operand:VCVTI 3 "register_operand")))]
   "TARGET_DOTPROD"
-{
-  emit_insn (
-    gen_neon_<sup>dot<vsi2qi> (operands[3], operands[3], operands[1],
-                                operands[2]));
-  emit_insn (gen_rtx_SET (operands[0], operands[3]));
-  DONE;
-})
+)

 ;; Auto-vectorizer pattern for usdot
 (define_expand "usdot_prod<vsi2qi>"

This patch is causing ICEs on arm-eabi (and probably arm-linux-gnueabi but trunk build is currently broken):

 FAIL: gcc.target/arm/simd/vect-dot-s8.c (internal compiler error)
FAIL: gcc.target/arm/simd/vect-dot-s8.c (test for excess errors)
Excess errors:
/gcc/testsuite/gcc.target/arm/simd/vect-dot-qi.h:15:1: error: unrecognizable insn:
(insn 29 28 30 5 (set (reg:V4SI 132 [ vect_patt_31.15 ])
        (plus:V4SI (unspec:V4SI [
                    (reg:V16QI 182)
                    (reg:V16QI 183)
                ] UNSPEC_DOT_S)
            (reg:V4SI 184))) -1
     (nil))
during RTL pass: vregs
/gcc/testsuite/gcc.target/arm/simd/vect-dot-qi.h:15:1: internal compiler error: in extract_insn, at recog.c:2769
0x5fc656 _fatal_insn(char const*, rtx_def const*, char const*, int, char const*)
        /gcc/rtl-error.c:108
0x5fc672 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
        /gcc/rtl-error.c:116
0xcbbe07 extract_insn(rtx_insn*)
        /gcc/recog.c:2769
0x9e2e95 instantiate_virtual_regs_in_insn
        /gcc/function.c:1611
0x9e2e95 instantiate_virtual_regs
        /gcc/function.c:1985
0x9e2e95 execute
        /gcc/function.c:2034

Can you check?

Thanks,

Christophe
diff mbox series

Patch

diff --git a/gcc/config/arm/neon.md b/gcc/config/arm/neon.md
index 61d81646475ce3bf62ece2cec2faf0c1fe978ec1..9602e9993aeebf4ec620d105fd20f64498a3b851 100644
--- a/gcc/config/arm/neon.md
+++ b/gcc/config/arm/neon.md
@@ -3067,13 +3067,7 @@  (define_expand "<sup>dot_prod<vsi2qi>"
 		     DOTPROD)
 		    (match_operand:VCVTI 3 "register_operand")))]
   "TARGET_DOTPROD"
-{
-  emit_insn (
-    gen_neon_<sup>dot<vsi2qi> (operands[3], operands[3], operands[1],
-				 operands[2]));
-  emit_insn (gen_rtx_SET (operands[0], operands[3]));
-  DONE;
-})
+)
 
 ;; Auto-vectorizer pattern for usdot
 (define_expand "usdot_prod<vsi2qi>"