[RFC] A memory gathering optimization for loop

2021-01-13 Thread Feng Xue OS via Gcc
1. Background In a loop, it is optimal if only one memory stream is activated, that is, all memory operations sequentially access one data region. But that is always not the case, such as traversing link list and manipulating discrete arrays. In this scenario, the loop would contain multiple scatt

[RFC] A memory gathering optimization for loop

2021-01-13 Thread Feng Xue OS via Gcc
1. Background In a loop, it is optimal if only one memory stream is activated, that is, all memory operations sequentially access one data region. But that is always not the case, such as traversing link list and manipulating discrete arrays. In this scenario, the loop would contain multiple scatt

RE: [RFC] A memory gathering optimization for loop

2021-01-16 Thread JiangNing OS via Gcc
> -Original Message- > From: Feng Xue OS > Sent: Thursday, January 14, 2021 12:28 PM > To: gcc@gcc.gnu.org > Cc: JiangNing OS ; Hao Liu OS > > Subject: [RFC] A memory gathering optimization for loop > > 1. Background > > In a loop, it is optimal if on

RE: [RFC] A memory gathering optimization for loop

2021-01-17 Thread Richard Biener via Gcc
On January 17, 2021 2:23:55 AM GMT+01:00, JiangNing OS via Gcc wrote: >> -Original Message- >> From: Feng Xue OS >> Sent: Thursday, January 14, 2021 12:28 PM >> To: gcc@gcc.gnu.org >> Cc: JiangNing OS ; Hao Liu OS >> >> Subject: [RFC] A memor

Re: [RFC] A memory gathering optimization for loop

2021-01-17 Thread Feng Xue OS via Gcc
>> -Original Message- >> From: Feng Xue OS >> Sent: Thursday, January 14, 2021 12:28 PM >> To: gcc@gcc.gnu.org >> Cc: JiangNing OS ; Hao Liu OS >> >> Subject: [RFC] A memory gathering optimization for loop >> >> 1. Background >&

Re: [RFC] A memory gathering optimization for loop

2021-04-29 Thread Florian Weimer via Gcc
* Feng Xue: > To simplify explanation of this memory gathering optimization, pseudo > code on original nested loops is given as: > > outer-loop ( ) { /* data in inner loop are also invariant in outer loop. */ > ... > inner-loop (iter, iter_count) { /* inner loop to apply MGO */ > >

Re: [RFC] A memory gathering optimization for loop

2021-04-30 Thread Richard Biener via Gcc
On Fri, Apr 30, 2021 at 9:51 AM Florian Weimer via Gcc wrote: > > * Feng Xue: > > > To simplify explanation of this memory gathering optimization, pseudo > > code on original nested loops is given as: > > > > outer-loop ( ) { /* data in inner loop are also invariant in outer loop. > > */ > >

Re: [RFC] A memory gathering optimization for loop

2021-04-30 Thread Florian Weimer via Gcc
* Richard Biener: >> Can you change this optimization so that it can use a fixed-size buffer? >> This would avoid all issues around calling calloc. If iter_count can be >> very large, allocating that much extra memory might not be beneficial >> anyway. > > It would need to be TLS storage though o

Re: [RFC] A memory gathering optimization for loop

2021-05-06 Thread Feng Xue OS via Gcc
>> To simplify explanation of this memory gathering optimization, pseudo >> code on original nested loops is given as: >> >> outer-loop ( ) { /* data in inner loop are also invariant in outer loop. >> */ >> ... >> inner-loop (iter, iter_count) { /* inner loop to apply MGO */ >> >>