autovectorization in gcc

2019-01-09 Thread Kay F. Jahnke
Hi there! I am developing software which tries to deliberately exploit the compiler's autovectorization facilities by feeding data in autovectorization-friendly loops. I'm currently using both g++ and clang++ to see how well this approach works. Using simple arithmetic, I often get good resul

Re: autovectorization in gcc

2019-01-09 Thread Kyrill Tkachov
Hi Kay, On 09/01/19 08:29, Kay F. Jahnke wrote: Hi there! I am developing software which tries to deliberately exploit the compiler's autovectorization facilities by feeding data in autovectorization-friendly loops. I'm currently using both g++ and clang++ to see how well this approach works. U

Re: autovectorization in gcc

2019-01-09 Thread Andrew Haley
On 1/9/19 9:45 AM, Kyrill Tkachov wrote: > Hi Kay, > > On 09/01/19 08:29, Kay F. Jahnke wrote: >> Hi there! >> >> I am developing software which tries to deliberately exploit the >> compiler's autovectorization facilities by feeding data in >> autovectorization-friendly loops. I'm currently using

Re: autovectorization in gcc

2019-01-09 Thread Jonathan Wakely
On Wed, 9 Jan 2019 at 09:50, Andrew Haley wrote: > I don't agree. Sometimes vectorization is critical. It would be nice > to have a warning which would fire if vectorization failed. That would > surely help the OP. Dave Malcolm has been working on something like that: https://gcc.gnu.org/ml/gcc-pa

Re: autovectorization in gcc

2019-01-09 Thread Ramana Radhakrishnan
On Wed, Jan 9, 2019 at 9:50 AM Andrew Haley wrote: > > On 1/9/19 9:45 AM, Kyrill Tkachov wrote: > > Hi Kay, > > > > On 09/01/19 08:29, Kay F. Jahnke wrote: > >> Hi there! > >> > >> I am developing software which tries to deliberately exploit the > >> compiler's autovectorization facilities by feed

Re: autovectorization in gcc

2019-01-09 Thread Kay F. Jahnke
On 09.01.19 10:45, Kyrill Tkachov wrote: There's plenty of work being done on auto-vectorisation in GCC. Auto-vectorisation is a performance optimisation and as such is not really a user-visible feature that absolutely requires user documentation. Since I'm trying to deliberately exploit it, a

Re: autovectorization in gcc

2019-01-09 Thread Jakub Jelinek
On Wed, Jan 09, 2019 at 11:56:03AM +0100, Kay F. Jahnke wrote: > The above is a typical example. So, to give a complete source 'vec_sqrt.cc': > > #include > > extern float data [ 32768 ] ; > > extern void vf1() > { > #pragma vectorize enable > for ( int i = 0 ; i < 32768 ; i++ ) > data

Re: autovectorization in gcc

2019-01-09 Thread Jakub Jelinek
On Wed, Jan 09, 2019 at 12:03:45PM +0100, Jakub Jelinek wrote: > > The above is a typical example. So, to give a complete source 'vec_sqrt.cc': > > > > #include > > > > extern float data [ 32768 ] ; > > > > extern void vf1() > > { > > #pragma vectorize enable > > for ( int i = 0 ; i < 32768

Re: autovectorization in gcc

2019-01-09 Thread David Malcolm
On Wed, 2019-01-09 at 09:56 +, Jonathan Wakely wrote: > On Wed, 9 Jan 2019 at 09:50, Andrew Haley wrote: > > I don't agree. Sometimes vectorization is critical. It would be > > nice > > to have a warning which would fire if vectorization failed. That > > would > > surely help the OP. > > Dave

Re: autovectorization in gcc

2019-01-09 Thread Jakub Jelinek
On Wed, Jan 09, 2019 at 11:10:25AM -0500, David Malcolm wrote: > extern void vf1() > { >#pragma vectorize enable >for ( int i = 0 ; i < 32768 ; i++ ) > data [ i ] = std::sqrt ( data [ i ] ) ; > } > > Compiling on this x86_64 box with -fopt-info-vec-missed shows the > _7 = .SQRT (_1

Re: autovectorization in gcc

2019-01-09 Thread David Malcolm
On Wed, 2019-01-09 at 11:10 -0500, David Malcolm wrote: > On Wed, 2019-01-09 at 09:56 +, Jonathan Wakely wrote: > > On Wed, 9 Jan 2019 at 09:50, Andrew Haley wrote: > > > I don't agree. Sometimes vectorization is critical. It would be > > > nice > > > to have a warning which would fire if vecto

Re: autovectorization in gcc

2019-01-10 Thread Richard Biener
On Wed, 9 Jan 2019, Jakub Jelinek wrote: > On Wed, Jan 09, 2019 at 11:10:25AM -0500, David Malcolm wrote: > > extern void vf1() > > { > >#pragma vectorize enable > >for ( int i = 0 ; i < 32768 ; i++ ) > > data [ i ] = std::sqrt ( data [ i ] ) ; > > } > > > > Compiling on this x86_64

Re: autovectorization in gcc

2019-01-10 Thread Kay F. Jahnke
d wasting resources. Now I may be missing things here because I haven't dug deeply enough to find documentation about autovectorization in gcc. This was why I have asked to be pointed to 'where the action is'. I was hoping to maybe get some helpful hints. My main objective is, after all,

Re: autovectorization in gcc

2019-01-10 Thread Szabolcs Nagy
On 10/01/2019 08:19, Richard Biener wrote: > On Wed, 9 Jan 2019, Jakub Jelinek wrote: > >> On Wed, Jan 09, 2019 at 11:10:25AM -0500, David Malcolm wrote: >>> extern void vf1() >>> { >>>#pragma vectorize enable >>>for ( int i = 0 ; i < 32768 ; i++ ) >>> data [ i ] = std::sqrt ( data [

Re: autovectorization in gcc

2019-01-10 Thread Jonathan Wakely
On Thu, 10 Jan 2019 at 09:25, Kay F. Jahnke wrote: > Documentation is absolutely essential. If there is lots of development > in autovectorization, not documenting this work in a way users can > simply find is - in my eyes - a grave omission. The text > 'Auto-vectorization in GCC' looks like it has

[wwwdocs PATCH] for Re: autovectorization in gcc

2019-08-18 Thread Gerald Pfeifer
On Thu, 10 Jan 2019, Jonathan Wakely wrote: >> [ https://gcc.gnu.org/projects/tree-ssa/vectorization.html ] > I'm not disputing that there could be better documentation, but that > page is not the place to find it. That page should probably get a > notice added saying that the project is complete a