public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: [Patch, testsuite] fix failure in test gcc.dg/vect/slp-perm-8.c
       [not found] <4f97e516.e3063c0a.17ba.0b21SMTPIN_ADDED@mx.google.com>
@ 2012-04-25 11:57 ` Richard Guenther
       [not found]   ` <B393A6715F47FC43935D96EA15105EFF25D62F6D04@GEORGE.Emea.Arm.com>
  0 siblings, 1 reply; 8+ messages in thread
From: Richard Guenther @ 2012-04-25 11:57 UTC (permalink / raw)
  To: Greta Yorsh; +Cc: gcc-patches, mikestump, ro, Richard Earnshaw

On Wed, Apr 25, 2012 at 1:51 PM, Greta Yorsh <Greta.Yorsh@arm.com> wrote:
> The test gcc.dg/vect/slp-perm-8.c fails on arm-none-eabi with neon enabled:
> FAIL: gcc.dg/vect/slp-perm-8.c scan-tree-dump-times vect "vectorized 1
> loops" 2
>
> The test expects 2 loops to be vectorized, while gcc successfully vectorizes
> 3 loops in this test using neon on arm. This patch adjusts the expected
> output. Fixed test passes on qemu for arm and powerpc.
>
> OK for trunk?

I think the proper fix is to instead of

  for (i = 0; i < N; i++)
    {
      input[i] = i;
      output[i] = 0;
      if (input[i] > 256)
        abort ();
    }

use

  for (i = 0; i < N; i++)
    {
      input[i] = i;
      output[i] = 0;
      __asm__ volatile ("");
    }

to prevent vectorization of initialization loops.

> Thanks,
> Greta
>
> gcc/testsuite/ChangeLog
>
> 2012-04-23  Greta Yorsh  <Greta.Yorsh@arm.com>
>
>        * gcc.dg/vect/slp-perm-8.c (dg-final): Adjust expected number
>        of vectorized loops for arm with neon.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [Patch, testsuite] fix failure in test gcc.dg/vect/slp-perm-8.c
       [not found]     ` <CAFiYyc1nn9=JkQZm+pJWM5ahfwGdw_Ga96to1hpKC_G5HHrvHQ@mail.gmail.com>
@ 2012-04-25 14:27       ` Greta Yorsh
       [not found]       ` <4f9809c3.e308b40a.7a8a.ffffea4dSMTPIN_ADDED@mx.google.com>
  1 sibling, 0 replies; 8+ messages in thread
From: Greta Yorsh @ 2012-04-25 14:27 UTC (permalink / raw)
  To: 'Richard Guenther'; +Cc: gcc-patches, mikestump, ro, Richard Earnshaw

[-- Attachment #1: Type: text/plain, Size: 2504 bytes --]

Richard Guenther wrote:
> On Wed, Apr 25, 2012 at 3:34 PM, Greta Yorsh <Greta.Yorsh@arm.com>
> wrote:
> > Richard Guenther wrote:
> >> On Wed, Apr 25, 2012 at 1:51 PM, Greta Yorsh <Greta.Yorsh@arm.com>
> >> wrote:
> >> > The test gcc.dg/vect/slp-perm-8.c fails on arm-none-eabi with neon
> >> enabled:
> >> > FAIL: gcc.dg/vect/slp-perm-8.c scan-tree-dump-times vect
> "vectorized
> >> 1
> >> > loops" 2
> >> >
> >> > The test expects 2 loops to be vectorized, while gcc successfully
> >> vectorizes
> >> > 3 loops in this test using neon on arm. This patch adjusts the
> >> expected
> >> > output. Fixed test passes on qemu for arm and powerpc.
> >> >
> >> > OK for trunk?
> >>
> >> I think the proper fix is to instead of
> >>
> >>   for (i = 0; i < N; i++)
> >>     {
> >>       input[i] = i;
> >>       output[i] = 0;
> >>       if (input[i] > 256)
> >>         abort ();
> >>     }
> >>
> >> use
> >>
> >>   for (i = 0; i < N; i++)
> >>     {
> >>       input[i] = i;
> >>       output[i] = 0;
> >>       __asm__ volatile ("");
> >>     }
> >>
> >> to prevent vectorization of initialization loops.
> >
> > Actually, it looks like both arm and powerpc vectorize this
> initialization loop (line 31), because the control flow is hoisted
> outside the loop by previous optimizations. In addition, arm with neon
> vectorizes the second loop (line 39), but powerpc does not:
> >
> > 39: not vectorized: relevant stmt not supported: D.2163_8 = i_40 * 9;
> >
> > If this is the expected behaviour for powerpc, then the patch I
> proposed is still needed to fix the test failure on arm. Also, there
> would be no need to disable vectorization of the initialization loop,
> right?
> 
> Ah, I thought that was what changed.  Btw, the if () abort () tries to
> disable
> vectorization but does not succeed in doing so.
> 
> Richard.

Here is an updated patch. It prevents vectorization of the initialization
loop, as Richard suggested, and updates the expected number of vectorized
loops accordingly. This patch assumes that the second loop in main (line 39)
should only be vectorized on arm with neon.  The test passes for arm and
powerpc.

OK for trunk?

Thank you,
Greta

gcc/testsuite/ChangeLog

2012-04-25  Greta Yorsh  <Greta.Yorsh@arm.com>

        * gcc.dg/vect/slp-perm-8.c (main): Prevent
        vectorization of initialization loop. 
        (dg-final): Adjust the expected number of 
        vectorized loops.





[-- Attachment #2: test-slp-perm-8.v3.patch.txt --]
[-- Type: text/plain, Size: 1044 bytes --]

diff --git a/gcc/testsuite/gcc.dg/vect/slp-perm-8.c b/gcc/testsuite/gcc.dg/vect/slp-perm-8.c
index d211ef9..aaa6cbb 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-perm-8.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-perm-8.c
@@ -32,8 +32,7 @@ int main (int argc, const char* argv[])
     {
       input[i] = i;
       output[i] = 0;
-      if (input[i] > 256)
-        abort ();
+      __asm__ volatile ("");
     }
 
   for (i = 0; i < N / 3; i++)
@@ -52,7 +51,8 @@ int main (int argc, const char* argv[])
   return 0;
 }
 
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_perm_byte } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target { vect_perm_byte && arm_neon_ok } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_perm_byte && {! arm_neon_ok } } } } } */
 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_perm_byte } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Patch, testsuite] fix failure in test gcc.dg/vect/slp-perm-8.c
       [not found]       ` <4f9809c3.e308b40a.7a8a.ffffea4dSMTPIN_ADDED@mx.google.com>
@ 2012-04-25 14:32         ` Richard Guenther
  2012-04-25 14:51           ` Greta Yorsh
  2012-04-25 16:30           ` Richard Earnshaw
  0 siblings, 2 replies; 8+ messages in thread
From: Richard Guenther @ 2012-04-25 14:32 UTC (permalink / raw)
  To: Greta Yorsh; +Cc: gcc-patches, mikestump, ro, Richard Earnshaw

On Wed, Apr 25, 2012 at 4:27 PM, Greta Yorsh <Greta.Yorsh@arm.com> wrote:
> Richard Guenther wrote:
>> On Wed, Apr 25, 2012 at 3:34 PM, Greta Yorsh <Greta.Yorsh@arm.com>
>> wrote:
>> > Richard Guenther wrote:
>> >> On Wed, Apr 25, 2012 at 1:51 PM, Greta Yorsh <Greta.Yorsh@arm.com>
>> >> wrote:
>> >> > The test gcc.dg/vect/slp-perm-8.c fails on arm-none-eabi with neon
>> >> enabled:
>> >> > FAIL: gcc.dg/vect/slp-perm-8.c scan-tree-dump-times vect
>> "vectorized
>> >> 1
>> >> > loops" 2
>> >> >
>> >> > The test expects 2 loops to be vectorized, while gcc successfully
>> >> vectorizes
>> >> > 3 loops in this test using neon on arm. This patch adjusts the
>> >> expected
>> >> > output. Fixed test passes on qemu for arm and powerpc.
>> >> >
>> >> > OK for trunk?
>> >>
>> >> I think the proper fix is to instead of
>> >>
>> >>   for (i = 0; i < N; i++)
>> >>     {
>> >>       input[i] = i;
>> >>       output[i] = 0;
>> >>       if (input[i] > 256)
>> >>         abort ();
>> >>     }
>> >>
>> >> use
>> >>
>> >>   for (i = 0; i < N; i++)
>> >>     {
>> >>       input[i] = i;
>> >>       output[i] = 0;
>> >>       __asm__ volatile ("");
>> >>     }
>> >>
>> >> to prevent vectorization of initialization loops.
>> >
>> > Actually, it looks like both arm and powerpc vectorize this
>> initialization loop (line 31), because the control flow is hoisted
>> outside the loop by previous optimizations. In addition, arm with neon
>> vectorizes the second loop (line 39), but powerpc does not:
>> >
>> > 39: not vectorized: relevant stmt not supported: D.2163_8 = i_40 * 9;
>> >
>> > If this is the expected behaviour for powerpc, then the patch I
>> proposed is still needed to fix the test failure on arm. Also, there
>> would be no need to disable vectorization of the initialization loop,
>> right?
>>
>> Ah, I thought that was what changed.  Btw, the if () abort () tries to
>> disable
>> vectorization but does not succeed in doing so.
>>
>> Richard.
>
> Here is an updated patch. It prevents vectorization of the initialization
> loop, as Richard suggested, and updates the expected number of vectorized
> loops accordingly. This patch assumes that the second loop in main (line 39)
> should only be vectorized on arm with neon.  The test passes for arm and
> powerpc.
>
> OK for trunk?

If arm cannot handle 9 * i then the approrpiate condition would be
vect_int_mult, not arm_neon_ok.

Ok with that change.

Richard.

> Thank you,
> Greta
>
> gcc/testsuite/ChangeLog
>
> 2012-04-25  Greta Yorsh  <Greta.Yorsh@arm.com>
>
>        * gcc.dg/vect/slp-perm-8.c (main): Prevent
>        vectorization of initialization loop.
>        (dg-final): Adjust the expected number of
>        vectorized loops.
>
>
>
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [Patch, testsuite] fix failure in test gcc.dg/vect/slp-perm-8.c
  2012-04-25 14:32         ` Richard Guenther
@ 2012-04-25 14:51           ` Greta Yorsh
  2012-04-25 16:30           ` Richard Earnshaw
  1 sibling, 0 replies; 8+ messages in thread
From: Greta Yorsh @ 2012-04-25 14:51 UTC (permalink / raw)
  To: 'Richard Guenther'; +Cc: gcc-patches, mikestump, ro, Richard Earnshaw



> -----Original Message-----
> From: Richard Guenther [mailto:richard.guenther@gmail.com]
> Sent: 25 April 2012 15:32
> To: Greta Yorsh
> Cc: gcc-patches@gcc.gnu.org; mikestump@comcast.net; ro@cebitec.uni-
> bielefeld.de; Richard Earnshaw
> Subject: Re: [Patch, testsuite] fix failure in test gcc.dg/vect/slp-
> perm-8.c
> 
> On Wed, Apr 25, 2012 at 4:27 PM, Greta Yorsh <Greta.Yorsh@arm.com>
> wrote:
> > Richard Guenther wrote:
> >> On Wed, Apr 25, 2012 at 3:34 PM, Greta Yorsh <Greta.Yorsh@arm.com>
> >> wrote:
> >> > Richard Guenther wrote:
> >> >> On Wed, Apr 25, 2012 at 1:51 PM, Greta Yorsh
> <Greta.Yorsh@arm.com>
> >> >> wrote:
> >> >> > The test gcc.dg/vect/slp-perm-8.c fails on arm-none-eabi with
> neon
> >> >> enabled:
> >> >> > FAIL: gcc.dg/vect/slp-perm-8.c scan-tree-dump-times vect
> >> "vectorized
> >> >> 1
> >> >> > loops" 2
> >> >> >
> >> >> > The test expects 2 loops to be vectorized, while gcc
> successfully
> >> >> vectorizes
> >> >> > 3 loops in this test using neon on arm. This patch adjusts the
> >> >> expected
> >> >> > output. Fixed test passes on qemu for arm and powerpc.
> >> >> >
> >> >> > OK for trunk?
> >> >>
> >> >> I think the proper fix is to instead of
> >> >>
> >> >>   for (i = 0; i < N; i++)
> >> >>     {
> >> >>       input[i] = i;
> >> >>       output[i] = 0;
> >> >>       if (input[i] > 256)
> >> >>         abort ();
> >> >>     }
> >> >>
> >> >> use
> >> >>
> >> >>   for (i = 0; i < N; i++)
> >> >>     {
> >> >>       input[i] = i;
> >> >>       output[i] = 0;
> >> >>       __asm__ volatile ("");
> >> >>     }
> >> >>
> >> >> to prevent vectorization of initialization loops.
> >> >
> >> > Actually, it looks like both arm and powerpc vectorize this
> >> initialization loop (line 31), because the control flow is hoisted
> >> outside the loop by previous optimizations. In addition, arm with
> neon
> >> vectorizes the second loop (line 39), but powerpc does not:
> >> >
> >> > 39: not vectorized: relevant stmt not supported: D.2163_8 = i_40 *
> 9;
> >> >
> >> > If this is the expected behaviour for powerpc, then the patch I
> >> proposed is still needed to fix the test failure on arm. Also, there
> >> would be no need to disable vectorization of the initialization
> loop,
> >> right?
> >>
> >> Ah, I thought that was what changed.  Btw, the if () abort () tries
> to
> >> disable
> >> vectorization but does not succeed in doing so.
> >>
> >> Richard.
> >
> > Here is an updated patch. It prevents vectorization of the
> initialization
> > loop, as Richard suggested, and updates the expected number of
> vectorized
> > loops accordingly. This patch assumes that the second loop in main
> (line 39)
> > should only be vectorized on arm with neon.  The test passes for arm
> and
> > powerpc.
> >
> > OK for trunk?
> 
> If arm cannot handle 9 * i then the approrpiate condition would be
> vect_int_mult, not arm_neon_ok.

It's the other way around: arm can handle this multiplication, but powerpc
does not handle it for some reason. 

Thank you,
Greta



> 
> Ok with that change.
> 
> Richard.
> 
> > Thank you,
> > Greta
> >
> > gcc/testsuite/ChangeLog
> >
> > 2012-04-25  Greta Yorsh  <Greta.Yorsh@arm.com>
> >
> >        * gcc.dg/vect/slp-perm-8.c (main): Prevent
> >        vectorization of initialization loop.
> >        (dg-final): Adjust the expected number of
> >        vectorized loops.
> >
> >
> >
> >




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Patch, testsuite] fix failure in test gcc.dg/vect/slp-perm-8.c
  2012-04-25 14:32         ` Richard Guenther
  2012-04-25 14:51           ` Greta Yorsh
@ 2012-04-25 16:30           ` Richard Earnshaw
  2012-05-30 17:46             ` Greta Yorsh
       [not found]             ` <4fc65d12.6ae1440a.6ecf.ffffbbabSMTPIN_ADDED@mx.google.com>
  1 sibling, 2 replies; 8+ messages in thread
From: Richard Earnshaw @ 2012-04-25 16:30 UTC (permalink / raw)
  To: Richard Guenther; +Cc: Greta Yorsh, gcc-patches, mikestump, ro

On 25/04/12 15:31, Richard Guenther wrote:
> On Wed, Apr 25, 2012 at 4:27 PM, Greta Yorsh <Greta.Yorsh@arm.com> wrote:
>> Richard Guenther wrote:
>>> On Wed, Apr 25, 2012 at 3:34 PM, Greta Yorsh <Greta.Yorsh@arm.com>
>>> wrote:
>>>> Richard Guenther wrote:
>>>>> On Wed, Apr 25, 2012 at 1:51 PM, Greta Yorsh <Greta.Yorsh@arm.com>
>>>>> wrote:
>>>>>> The test gcc.dg/vect/slp-perm-8.c fails on arm-none-eabi with neon
>>>>> enabled:
>>>>>> FAIL: gcc.dg/vect/slp-perm-8.c scan-tree-dump-times vect
>>> "vectorized
>>>>> 1
>>>>>> loops" 2
>>>>>>
>>>>>> The test expects 2 loops to be vectorized, while gcc successfully
>>>>> vectorizes
>>>>>> 3 loops in this test using neon on arm. This patch adjusts the
>>>>> expected
>>>>>> output. Fixed test passes on qemu for arm and powerpc.
>>>>>>
>>>>>> OK for trunk?
>>>>>
>>>>> I think the proper fix is to instead of
>>>>>
>>>>>   for (i = 0; i < N; i++)
>>>>>     {
>>>>>       input[i] = i;
>>>>>       output[i] = 0;
>>>>>       if (input[i] > 256)
>>>>>         abort ();
>>>>>     }
>>>>>
>>>>> use
>>>>>
>>>>>   for (i = 0; i < N; i++)
>>>>>     {
>>>>>       input[i] = i;
>>>>>       output[i] = 0;
>>>>>       __asm__ volatile ("");
>>>>>     }
>>>>>
>>>>> to prevent vectorization of initialization loops.
>>>>
>>>> Actually, it looks like both arm and powerpc vectorize this
>>> initialization loop (line 31), because the control flow is hoisted
>>> outside the loop by previous optimizations. In addition, arm with neon
>>> vectorizes the second loop (line 39), but powerpc does not:
>>>>
>>>> 39: not vectorized: relevant stmt not supported: D.2163_8 = i_40 * 9;
>>>>
>>>> If this is the expected behaviour for powerpc, then the patch I
>>> proposed is still needed to fix the test failure on arm. Also, there
>>> would be no need to disable vectorization of the initialization loop,
>>> right?
>>>
>>> Ah, I thought that was what changed.  Btw, the if () abort () tries to
>>> disable
>>> vectorization but does not succeed in doing so.
>>>
>>> Richard.
>>
>> Here is an updated patch. It prevents vectorization of the initialization
>> loop, as Richard suggested, and updates the expected number of vectorized
>> loops accordingly. This patch assumes that the second loop in main (line 39)
>> should only be vectorized on arm with neon.  The test passes for arm and
>> powerpc.
>>
>> OK for trunk?
> 
> If arm cannot handle 9 * i then the approrpiate condition would be
> vect_int_mult, not arm_neon_ok.
> 

The issue is that arm has (well, should be marked has having)
vect_char_mult.  The difference in count of vectorized loops is based on
that.

R.

> Ok with that change.
> 
> Richard.
> 
>> Thank you,
>> Greta
>>
>> gcc/testsuite/ChangeLog
>>
>> 2012-04-25  Greta Yorsh  <Greta.Yorsh@arm.com>
>>
>>        * gcc.dg/vect/slp-perm-8.c (main): Prevent
>>        vectorization of initialization loop.
>>        (dg-final): Adjust the expected number of
>>        vectorized loops.
>>
>>
>>
>>
> 


^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [Patch, testsuite] fix failure in test gcc.dg/vect/slp-perm-8.c
  2012-04-25 16:30           ` Richard Earnshaw
@ 2012-05-30 17:46             ` Greta Yorsh
       [not found]             ` <4fc65d12.6ae1440a.6ecf.ffffbbabSMTPIN_ADDED@mx.google.com>
  1 sibling, 0 replies; 8+ messages in thread
From: Greta Yorsh @ 2012-05-30 17:46 UTC (permalink / raw)
  To: 'Richard Earnshaw', Richard Guenther; +Cc: gcc-patches, mikestump, ro

[-- Attachment #1: Type: text/plain, Size: 4516 bytes --]

I'm attaching an updated version of the patch, addressing the comments from
http://gcc.gnu.org/ml/gcc-patches/2012-04/msg01615.html

This patch adds arm32 to targets that support vect_char_mult. In addition,
the test is updated to prevent vectorization of the initialization loop. The
expected number of vectorized loops is adjusted accordingly. 

No regression with check-gcc on qemu for arm-none-eabi cortex-a9 neon softfp
arm/thumb.

OK for trunk?

Thanks,
Greta

ChangeLog

gcc/testsuite

2012-05-30  Greta Yorsh  <Greta.Yorsh at arm.com>

        * gcc.dg/vect/slp-perm-8.c (main): Prevent vectorization
        of the initialization loop.
        (dg-final): Adjust the expected number of vectorized loops
        depending on vect_char_mult target selector.
        * lib/target-supports.exp (check_effective_target_vect_char_mult):
Add
	  arm32 to targets


> -----Original Message-----
> From: Richard Earnshaw [mailto:rearnsha@arm.com]
> Sent: 25 April 2012 17:30
> To: Richard Guenther
> Cc: Greta Yorsh; gcc-patches@gcc.gnu.org; mikestump@comcast.net;
> ro@cebitec.uni-bielefeld.de
> Subject: Re: [Patch, testsuite] fix failure in test gcc.dg/vect/slp-
> perm-8.c
> 
> On 25/04/12 15:31, Richard Guenther wrote:
> > On Wed, Apr 25, 2012 at 4:27 PM, Greta Yorsh <Greta.Yorsh@arm.com>
> wrote:
> >> Richard Guenther wrote:
> >>> On Wed, Apr 25, 2012 at 3:34 PM, Greta Yorsh <Greta.Yorsh@arm.com>
> >>> wrote:
> >>>> Richard Guenther wrote:
> >>>>> On Wed, Apr 25, 2012 at 1:51 PM, Greta Yorsh
> <Greta.Yorsh@arm.com>
> >>>>> wrote:
> >>>>>> The test gcc.dg/vect/slp-perm-8.c fails on arm-none-eabi with
> neon
> >>>>> enabled:
> >>>>>> FAIL: gcc.dg/vect/slp-perm-8.c scan-tree-dump-times vect
> >>> "vectorized
> >>>>> 1
> >>>>>> loops" 2
> >>>>>>
> >>>>>> The test expects 2 loops to be vectorized, while gcc
> successfully
> >>>>> vectorizes
> >>>>>> 3 loops in this test using neon on arm. This patch adjusts the
> >>>>> expected
> >>>>>> output. Fixed test passes on qemu for arm and powerpc.
> >>>>>>
> >>>>>> OK for trunk?
> >>>>>
> >>>>> I think the proper fix is to instead of
> >>>>>
> >>>>>   for (i = 0; i < N; i++)
> >>>>>     {
> >>>>>       input[i] = i;
> >>>>>       output[i] = 0;
> >>>>>       if (input[i] > 256)
> >>>>>         abort ();
> >>>>>     }
> >>>>>
> >>>>> use
> >>>>>
> >>>>>   for (i = 0; i < N; i++)
> >>>>>     {
> >>>>>       input[i] = i;
> >>>>>       output[i] = 0;
> >>>>>       __asm__ volatile ("");
> >>>>>     }
> >>>>>
> >>>>> to prevent vectorization of initialization loops.
> >>>>
> >>>> Actually, it looks like both arm and powerpc vectorize this
> >>> initialization loop (line 31), because the control flow is hoisted
> >>> outside the loop by previous optimizations. In addition, arm with
> neon
> >>> vectorizes the second loop (line 39), but powerpc does not:
> >>>>
> >>>> 39: not vectorized: relevant stmt not supported: D.2163_8 = i_40 *
> 9;
> >>>>
> >>>> If this is the expected behaviour for powerpc, then the patch I
> >>> proposed is still needed to fix the test failure on arm. Also,
> there
> >>> would be no need to disable vectorization of the initialization
> loop,
> >>> right?
> >>>
> >>> Ah, I thought that was what changed.  Btw, the if () abort () tries
> to
> >>> disable
> >>> vectorization but does not succeed in doing so.
> >>>
> >>> Richard.
> >>
> >> Here is an updated patch. It prevents vectorization of the
> initialization
> >> loop, as Richard suggested, and updates the expected number of
> vectorized
> >> loops accordingly. This patch assumes that the second loop in main
> (line 39)
> >> should only be vectorized on arm with neon.  The test passes for arm
> and
> >> powerpc.
> >>
> >> OK for trunk?
> >
> > If arm cannot handle 9 * i then the approrpiate condition would be
> > vect_int_mult, not arm_neon_ok.
> >
> 
> The issue is that arm has (well, should be marked has having)
> vect_char_mult.  The difference in count of vectorized loops is based
> on
> that.
> 
> R.
> 
> > Ok with that change.
> >
> > Richard.
> >
> >> Thank you,
> >> Greta
> >>
> >> gcc/testsuite/ChangeLog
> >>
> >> 2012-04-25  Greta Yorsh  <Greta.Yorsh@arm.com>
> >>
> >>        * gcc.dg/vect/slp-perm-8.c (main): Prevent
> >>        vectorization of initialization loop.
> >>        (dg-final): Adjust the expected number of
> >>        vectorized loops.
> >>
> >>
> >>
> >>
> >
> 

[-- Attachment #2: test-slp-perm-8.patch.txt --]
[-- Type: text/plain, Size: 1598 bytes --]

diff --git a/gcc/testsuite/gcc.dg/vect/slp-perm-8.c b/gcc/testsuite/gcc.dg/vect/slp-perm-8.c
index d211ef9..c4854d5 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-perm-8.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-perm-8.c
@@ -32,8 +32,7 @@ int main (int argc, const char* argv[])
     {
       input[i] = i;
       output[i] = 0;
-      if (input[i] > 256)
-        abort ();
+      __asm__ volatile ("");
     }
 
   for (i = 0; i < N / 3; i++)
@@ -52,7 +51,8 @@ int main (int argc, const char* argv[])
   return 0;
 }
 
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_perm_byte } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target { vect_perm_byte && vect_char_mult } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_perm_byte && {! vect_char_mult } } } } } */
 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_perm_byte } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
 
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index b93dc5c..d249404 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -3462,7 +3462,8 @@ proc check_effective_target_vect_char_mult { } {
 	set et_vect_char_mult_saved 0
 	if { [istarget ia64-*-*]
 	     || [istarget i?86-*-*]
-	     || [istarget x86_64-*-*] } {
+	     || [istarget x86_64-*-*]
+            || [check_effective_target_arm32] } {
 	   set et_vect_char_mult_saved 1
 	}
     }

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Patch, testsuite] fix failure in test gcc.dg/vect/slp-perm-8.c
       [not found]             ` <4fc65d12.6ae1440a.6ecf.ffffbbabSMTPIN_ADDED@mx.google.com>
@ 2012-05-31  9:01               ` Richard Guenther
  0 siblings, 0 replies; 8+ messages in thread
From: Richard Guenther @ 2012-05-31  9:01 UTC (permalink / raw)
  To: Greta Yorsh; +Cc: Richard Earnshaw, gcc-patches, mikestump, ro

On Wed, May 30, 2012 at 7:46 PM, Greta Yorsh <Greta.Yorsh@arm.com> wrote:
> I'm attaching an updated version of the patch, addressing the comments from
> http://gcc.gnu.org/ml/gcc-patches/2012-04/msg01615.html
>
> This patch adds arm32 to targets that support vect_char_mult. In addition,
> the test is updated to prevent vectorization of the initialization loop. The
> expected number of vectorized loops is adjusted accordingly.
>
> No regression with check-gcc on qemu for arm-none-eabi cortex-a9 neon softfp
> arm/thumb.
>
> OK for trunk?

Ok.

Thanks,
Richard.

> Thanks,
> Greta
>
> ChangeLog
>
> gcc/testsuite
>
> 2012-05-30  Greta Yorsh  <Greta.Yorsh at arm.com>
>
>        * gcc.dg/vect/slp-perm-8.c (main): Prevent vectorization
>        of the initialization loop.
>        (dg-final): Adjust the expected number of vectorized loops
>        depending on vect_char_mult target selector.
>        * lib/target-supports.exp (check_effective_target_vect_char_mult):
> Add
>          arm32 to targets
>
>
>> -----Original Message-----
>> From: Richard Earnshaw [mailto:rearnsha@arm.com]
>> Sent: 25 April 2012 17:30
>> To: Richard Guenther
>> Cc: Greta Yorsh; gcc-patches@gcc.gnu.org; mikestump@comcast.net;
>> ro@cebitec.uni-bielefeld.de
>> Subject: Re: [Patch, testsuite] fix failure in test gcc.dg/vect/slp-
>> perm-8.c
>>
>> On 25/04/12 15:31, Richard Guenther wrote:
>> > On Wed, Apr 25, 2012 at 4:27 PM, Greta Yorsh <Greta.Yorsh@arm.com>
>> wrote:
>> >> Richard Guenther wrote:
>> >>> On Wed, Apr 25, 2012 at 3:34 PM, Greta Yorsh <Greta.Yorsh@arm.com>
>> >>> wrote:
>> >>>> Richard Guenther wrote:
>> >>>>> On Wed, Apr 25, 2012 at 1:51 PM, Greta Yorsh
>> <Greta.Yorsh@arm.com>
>> >>>>> wrote:
>> >>>>>> The test gcc.dg/vect/slp-perm-8.c fails on arm-none-eabi with
>> neon
>> >>>>> enabled:
>> >>>>>> FAIL: gcc.dg/vect/slp-perm-8.c scan-tree-dump-times vect
>> >>> "vectorized
>> >>>>> 1
>> >>>>>> loops" 2
>> >>>>>>
>> >>>>>> The test expects 2 loops to be vectorized, while gcc
>> successfully
>> >>>>> vectorizes
>> >>>>>> 3 loops in this test using neon on arm. This patch adjusts the
>> >>>>> expected
>> >>>>>> output. Fixed test passes on qemu for arm and powerpc.
>> >>>>>>
>> >>>>>> OK for trunk?
>> >>>>>
>> >>>>> I think the proper fix is to instead of
>> >>>>>
>> >>>>>   for (i = 0; i < N; i++)
>> >>>>>     {
>> >>>>>       input[i] = i;
>> >>>>>       output[i] = 0;
>> >>>>>       if (input[i] > 256)
>> >>>>>         abort ();
>> >>>>>     }
>> >>>>>
>> >>>>> use
>> >>>>>
>> >>>>>   for (i = 0; i < N; i++)
>> >>>>>     {
>> >>>>>       input[i] = i;
>> >>>>>       output[i] = 0;
>> >>>>>       __asm__ volatile ("");
>> >>>>>     }
>> >>>>>
>> >>>>> to prevent vectorization of initialization loops.
>> >>>>
>> >>>> Actually, it looks like both arm and powerpc vectorize this
>> >>> initialization loop (line 31), because the control flow is hoisted
>> >>> outside the loop by previous optimizations. In addition, arm with
>> neon
>> >>> vectorizes the second loop (line 39), but powerpc does not:
>> >>>>
>> >>>> 39: not vectorized: relevant stmt not supported: D.2163_8 = i_40 *
>> 9;
>> >>>>
>> >>>> If this is the expected behaviour for powerpc, then the patch I
>> >>> proposed is still needed to fix the test failure on arm. Also,
>> there
>> >>> would be no need to disable vectorization of the initialization
>> loop,
>> >>> right?
>> >>>
>> >>> Ah, I thought that was what changed.  Btw, the if () abort () tries
>> to
>> >>> disable
>> >>> vectorization but does not succeed in doing so.
>> >>>
>> >>> Richard.
>> >>
>> >> Here is an updated patch. It prevents vectorization of the
>> initialization
>> >> loop, as Richard suggested, and updates the expected number of
>> vectorized
>> >> loops accordingly. This patch assumes that the second loop in main
>> (line 39)
>> >> should only be vectorized on arm with neon.  The test passes for arm
>> and
>> >> powerpc.
>> >>
>> >> OK for trunk?
>> >
>> > If arm cannot handle 9 * i then the approrpiate condition would be
>> > vect_int_mult, not arm_neon_ok.
>> >
>>
>> The issue is that arm has (well, should be marked has having)
>> vect_char_mult.  The difference in count of vectorized loops is based
>> on
>> that.
>>
>> R.
>>
>> > Ok with that change.
>> >
>> > Richard.
>> >
>> >> Thank you,
>> >> Greta
>> >>
>> >> gcc/testsuite/ChangeLog
>> >>
>> >> 2012-04-25  Greta Yorsh  <Greta.Yorsh@arm.com>
>> >>
>> >>        * gcc.dg/vect/slp-perm-8.c (main): Prevent
>> >>        vectorization of initialization loop.
>> >>        (dg-final): Adjust the expected number of
>> >>        vectorized loops.
>> >>
>> >>
>> >>
>> >>
>> >
>>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Patch, testsuite] fix failure in test gcc.dg/vect/slp-perm-8.c
@ 2012-04-25 11:50 Greta Yorsh
  0 siblings, 0 replies; 8+ messages in thread
From: Greta Yorsh @ 2012-04-25 11:50 UTC (permalink / raw)
  To: gcc-patches; +Cc: mikestump, ro, Richard Earnshaw

[-- Attachment #1: Type: text/plain, Size: 601 bytes --]

The test gcc.dg/vect/slp-perm-8.c fails on arm-none-eabi with neon enabled:
FAIL: gcc.dg/vect/slp-perm-8.c scan-tree-dump-times vect "vectorized 1
loops" 2

The test expects 2 loops to be vectorized, while gcc successfully vectorizes
3 loops in this test using neon on arm. This patch adjusts the expected
output. Fixed test passes on qemu for arm and powerpc.

OK for trunk?

Thanks,
Greta

gcc/testsuite/ChangeLog

2012-04-23  Greta Yorsh  <Greta.Yorsh@arm.com>

        * gcc.dg/vect/slp-perm-8.c (dg-final): Adjust expected number
        of vectorized loops for arm with neon.

[-- Attachment #2: test-slp-perm-8.patch.txt --]
[-- Type: text/plain, Size: 926 bytes --]

diff --git a/gcc/testsuite/gcc.dg/vect/slp-perm-8.c b/gcc/testsuite/gcc.dg/vect/slp-perm-8.c
index d211ef9..beaa96c 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-perm-8.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-perm-8.c
@@ -52,7 +52,9 @@ int main (int argc, const char* argv[])
   return 0;
 }

-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_perm_byte } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_perm_byte && arm_neon_ok } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target { vect_perm_byte && arm_neon_ok } } } }*/
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target { vect_perm_byte && {! arm_neon_ok } } } } } */
 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_perm_byte } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-05-31  9:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <4f97e516.e3063c0a.17ba.0b21SMTPIN_ADDED@mx.google.com>
2012-04-25 11:57 ` [Patch, testsuite] fix failure in test gcc.dg/vect/slp-perm-8.c Richard Guenther
     [not found]   ` <B393A6715F47FC43935D96EA15105EFF25D62F6D04@GEORGE.Emea.Arm.com>
     [not found]     ` <CAFiYyc1nn9=JkQZm+pJWM5ahfwGdw_Ga96to1hpKC_G5HHrvHQ@mail.gmail.com>
2012-04-25 14:27       ` Greta Yorsh
     [not found]       ` <4f9809c3.e308b40a.7a8a.ffffea4dSMTPIN_ADDED@mx.google.com>
2012-04-25 14:32         ` Richard Guenther
2012-04-25 14:51           ` Greta Yorsh
2012-04-25 16:30           ` Richard Earnshaw
2012-05-30 17:46             ` Greta Yorsh
     [not found]             ` <4fc65d12.6ae1440a.6ecf.ffffbbabSMTPIN_ADDED@mx.google.com>
2012-05-31  9:01               ` Richard Guenther
2012-04-25 11:50 Greta Yorsh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).