Re: [RFC] Using main loop's updated IV as base_address for epilogue vectorization

2021-06-16 Thread Richard Biener
On Wed, 16 Jun 2021, Andre Vieira (lists) wrote: > > On 14/06/2021 11:57, Richard Biener wrote: > > On Mon, 14 Jun 2021, Richard Biener wrote: > > > >> Indeed. For example a simple > >> int a[1024], b[1024], c[1024]; > >> > >> void foo(int n) > >> { > >>for (int i = 0; i < n; ++i) > >>

Re: [RFC] Using main loop's updated IV as base_address for epilogue vectorization

2021-06-16 Thread Andre Vieira (lists) via Gcc-patches
On 14/06/2021 11:57, Richard Biener wrote: On Mon, 14 Jun 2021, Richard Biener wrote: Indeed. For example a simple int a[1024], b[1024], c[1024]; void foo(int n) { for (int i = 0; i < n; ++i) a[i+1] += c[i+i] ? b[i+1] : 0; } should usually see peeling for alignment (though on x86

Re: [RFC] Using main loop's updated IV as base_address for epilogue vectorization

2021-06-14 Thread Richard Biener
On Mon, 14 Jun 2021, Richard Biener wrote: > On Mon, 14 Jun 2021, Andre Vieira (lists) wrote: > > > Hi, > > > > > > On 20/05/2021 11:22, Richard Biener wrote: > > > On Mon, 17 May 2021, Andre Vieira (lists) wrote: > > > > > >> Hi, > > >> > > >> So this is my second attempt at finding a way to

Re: [RFC] Using main loop's updated IV as base_address for epilogue vectorization

2021-06-14 Thread Richard Biener
On Mon, 14 Jun 2021, Andre Vieira (lists) wrote: > Hi, > > > On 20/05/2021 11:22, Richard Biener wrote: > > On Mon, 17 May 2021, Andre Vieira (lists) wrote: > > > >> Hi, > >> > >> So this is my second attempt at finding a way to improve how we generate > >> the > >> vector IV's and teach the

Re: [RFC] Using main loop's updated IV as base_address for epilogue vectorization

2021-06-14 Thread Andre Vieira (lists) via Gcc-patches
Hi, On 20/05/2021 11:22, Richard Biener wrote: On Mon, 17 May 2021, Andre Vieira (lists) wrote: Hi, So this is my second attempt at finding a way to improve how we generate the vector IV's and teach the vectorizer to share them between main loop and epilogues. On IRC we discussed my idea to

Re: [RFC] Using main loop's updated IV as base_address for epilogue vectorization

2021-05-20 Thread Richard Biener
On Mon, 17 May 2021, Andre Vieira (lists) wrote: > Hi, > > So this is my second attempt at finding a way to improve how we generate the > vector IV's and teach the vectorizer to share them between main loop and > epilogues. On IRC we discussed my idea to use the loop's control_iv, but that > was

Re: [RFC] Using main loop's updated IV as base_address for epilogue vectorization

2021-05-17 Thread Andre Vieira (lists) via Gcc-patches
Hi, So this is my second attempt at finding a way to improve how we generate the vector IV's and teach the vectorizer to share them between main loop and epilogues. On IRC we discussed my idea to use the loop's control_iv, but that was a terrible idea and I quickly threw it in the bin. The

Re: [RFC] Using main loop's updated IV as base_address for epilogue vectorization

2021-05-07 Thread Richard Biener
On Wed, 5 May 2021, Andre Vieira (lists) wrote: > > On 05/05/2021 13:34, Richard Biener wrote: > > On Wed, 5 May 2021, Andre Vieira (lists) wrote: > > > >> I tried to see what IVOPTs would make of this and it is able to analyze the > >> IVs but it doesn't realize (not even sure it tries) that

Re: [RFC] Using main loop's updated IV as base_address for epilogue vectorization

2021-05-05 Thread Andre Vieira (lists) via Gcc-patches
On 05/05/2021 13:34, Richard Biener wrote: On Wed, 5 May 2021, Andre Vieira (lists) wrote: I tried to see what IVOPTs would make of this and it is able to analyze the IVs but it doesn't realize (not even sure it tries) that one IV's end (loop 1) could be used as the base for the other (loop

Re: [RFC] Using main loop's updated IV as base_address for epilogue vectorization

2021-05-05 Thread Richard Biener
On Wed, 5 May 2021, Andre Vieira (lists) wrote: > Hi Richi, > > So I'm trying to look at what IVOPTs does right now and how it might be able > to help us. Looking at these two code examples: > #include > #if 0 > int foo(short * a, short * b, unsigned int n) > { >     int sum = 0; >     for

Re: [RFC] Using main loop's updated IV as base_address for epilogue vectorization

2021-05-05 Thread Andre Vieira (lists) via Gcc-patches
Hi Richi, So I'm trying to look at what IVOPTs does right now and how it might be able to help us. Looking at these two code examples: #include #if 0 int foo(short * a, short * b, unsigned int n) {     int sum = 0;     for (unsigned int i = 0; i < n; ++i)     sum += a[i] + b[i];    

Re: [RFC] Using main loop's updated IV as base_address for epilogue vectorization

2021-05-04 Thread Richard Biener
On Fri, 30 Apr 2021, Andre Vieira (lists) wrote: > Hi, > > The aim of this RFC is to explore a way of cleaning up the codegen around > data_references.  To be specific, I'd like to reuse the main-loop's updated > data_reference as the base_address for the epilogue's corresponding >

[RFC] Using main loop's updated IV as base_address for epilogue vectorization

2021-04-30 Thread Andre Vieira (lists) via Gcc-patches
Hi, The aim of this RFC is to explore a way of cleaning up the codegen around data_references.  To be specific, I'd like to reuse the main-loop's updated data_reference as the base_address for the epilogue's corresponding data_reference, rather than use the niters.  We have found this leads