Message ID | 1279304978.3166.1105.camel@otta |
---|---|
State | New |
Headers | show |
On Fri, Jul 16, 2010 at 8:29 PM, Peter Bergner <bergner@vnet.ibm.com> wrote: > Sometime recently (r161984?) the compiler is now vectorizing the > initialization loops for slp-perm.[123].c on powerpc64-linux. I copied > the method of really disabling vectorization in the initialization loops > used in PR testsuite/44538 by adding a asm ("") into the loops we don't > want vectorized. For safety, I did the same for the check_results loops. > Looking closer, I also noticed the loop limits for the check_results > loop were bogus for slp-perm-[34].c, so I fixed those too. > > Ok for mainline? Ok. Thanks, Richard. > Peter > > > * gcc.dg/vect/slp-perm-1.c (main): Make sure loops aren't vectorized. > * gcc.dg/vect/slp-perm-2.c (main): Likewise. > * gcc.dg/vect/slp-perm-3.c (main): Likewise. Fix loop limit. > * gcc.dg/vect/slp-perm-4.c (main): Fix loop limit. > > Index: gcc.dg/vect/slp-perm-1.c > =================================================================== > --- gcc.dg/vect/slp-perm-1.c (revision 162190) > +++ gcc.dg/vect/slp-perm-1.c (working copy) > @@ -42,16 +42,18 @@ int main (int argc, const char* argv[]) > for (i = 0; i < N; i++) > { > input[i] = i%256; > - if (input[i] > 200) > - abort(); > output[i] = 0; > + __asm__ volatile (""); > } > > foo (input, output); > > for (i = 0; i < N; i++) > - if (output[i] != check_results[i]) > - abort (); > + { > + if (output[i] != check_results[i]) > + abort (); > + __asm__ volatile (""); > + } > > return 0; > } > Index: gcc.dg/vect/slp-perm-2.c > =================================================================== > --- gcc.dg/vect/slp-perm-2.c (revision 162190) > +++ gcc.dg/vect/slp-perm-2.c (working copy) > @@ -37,16 +37,18 @@ int main (int argc, const char* argv[]) > for (i = 0; i < N; i++) > { > input[i] = i%256; > - if (input[i] > 200) > - abort(); > output[i] = 0; > + __asm__ volatile (""); > } > > foo (input, output); > > for (i = 0; i < N; i++) > - if (output[i] != check_results[i]) > - abort (); > + { > + if (output[i] != check_results[i]) > + abort (); > + __asm__ volatile (""); > + } > > return 0; > } > Index: gcc.dg/vect/slp-perm-3.c > =================================================================== > --- gcc.dg/vect/slp-perm-3.c (revision 162190) > +++ gcc.dg/vect/slp-perm-3.c (working copy) > @@ -51,16 +51,18 @@ int main (int argc, const char* argv[]) > for (i = 0; i < N; i++) > { > input[i] = i%256; > - if (input[i] > 200) > - abort(); > output[i] = 0; > + __asm__ volatile (""); > } > > foo (input, output); > > - for (i = 0; i < N - N; i++) > - if (output[i] != check_results[i]) > - abort (); > + for (i = 0; i < N; i++) > + { > + if (output[i] != check_results[i]) > + abort (); > + __asm__ volatile (""); > + } > > return 0; > } > Index: gcc.dg/vect/slp-perm-4.c > =================================================================== > --- gcc.dg/vect/slp-perm-4.c (revision 162190) > +++ gcc.dg/vect/slp-perm-4.c (working copy) > @@ -74,7 +74,7 @@ int main (int argc, const char* argv[]) > > foo (input, output); > > - for (i = 0; i < N - N; i++) > + for (i = 0; i < N; i++) > if (output[i] != check_results[i]) > abort (); > > > >
On Sun, 2010-07-18 at 20:02 +0200, Richard Guenther wrote: > On Fri, Jul 16, 2010 at 8:29 PM, Peter Bergner <bergner@vnet.ibm.com> wrote: > > Sometime recently (r161984?) the compiler is now vectorizing the > > initialization loops for slp-perm.[123].c on powerpc64-linux. I copied > > the method of really disabling vectorization in the initialization loops > > used in PR testsuite/44538 by adding a asm ("") into the loops we don't > > want vectorized. For safety, I did the same for the check_results loops. > > Looking closer, I also noticed the loop limits for the check_results > > loop were bogus for slp-perm-[34].c, so I fixed those too. > > > > Ok for mainline? > > Ok. Thanks, committed as revision 162311. Peter
Index: gcc.dg/vect/slp-perm-1.c =================================================================== --- gcc.dg/vect/slp-perm-1.c (revision 162190) +++ gcc.dg/vect/slp-perm-1.c (working copy) @@ -42,16 +42,18 @@ int main (int argc, const char* argv[]) for (i = 0; i < N; i++) { input[i] = i%256; - if (input[i] > 200) - abort(); output[i] = 0; + __asm__ volatile (""); } foo (input, output); for (i = 0; i < N; i++) - if (output[i] != check_results[i]) - abort (); + { + if (output[i] != check_results[i]) + abort (); + __asm__ volatile (""); + } return 0; } Index: gcc.dg/vect/slp-perm-2.c =================================================================== --- gcc.dg/vect/slp-perm-2.c (revision 162190) +++ gcc.dg/vect/slp-perm-2.c (working copy) @@ -37,16 +37,18 @@ int main (int argc, const char* argv[]) for (i = 0; i < N; i++) { input[i] = i%256; - if (input[i] > 200) - abort(); output[i] = 0; + __asm__ volatile (""); } foo (input, output); for (i = 0; i < N; i++) - if (output[i] != check_results[i]) - abort (); + { + if (output[i] != check_results[i]) + abort (); + __asm__ volatile (""); + } return 0; } Index: gcc.dg/vect/slp-perm-3.c =================================================================== --- gcc.dg/vect/slp-perm-3.c (revision 162190) +++ gcc.dg/vect/slp-perm-3.c (working copy) @@ -51,16 +51,18 @@ int main (int argc, const char* argv[]) for (i = 0; i < N; i++) { input[i] = i%256; - if (input[i] > 200) - abort(); output[i] = 0; + __asm__ volatile (""); } foo (input, output); - for (i = 0; i < N - N; i++) - if (output[i] != check_results[i]) - abort (); + for (i = 0; i < N; i++) + { + if (output[i] != check_results[i]) + abort (); + __asm__ volatile (""); + } return 0; } Index: gcc.dg/vect/slp-perm-4.c =================================================================== --- gcc.dg/vect/slp-perm-4.c (revision 162190) +++ gcc.dg/vect/slp-perm-4.c (working copy) @@ -74,7 +74,7 @@ int main (int argc, const char* argv[]) foo (input, output); - for (i = 0; i < N - N; i++) + for (i = 0; i < N; i++) if (output[i] != check_results[i]) abort ();