Re: Loop fusion in gcc

2023-09-23 Thread Richard Biener via Gcc
On Sat, Sep 23, 2023 at 2:54 PM Hanke Zhang via Gcc wrote: > > Hi, I have been very interested in loop fusion recently. I found that > both LLVM and icc have implemented this optimization. I also noticed > that gcc does not seem to implement it. > > I would like to ask if gcc

Loop fusion in gcc

2023-09-23 Thread Hanke Zhang via Gcc
Hi, I have been very interested in loop fusion recently. I found that both LLVM and icc have implemented this optimization. I also noticed that gcc does not seem to implement it. I would like to ask if gcc have any plans to implement this optimization? In addition, I also found that there is a

Re: Loop fusion.

2018-04-24 Thread Toon Moene
On 04/24/2018 09:18 AM, Richard Biener wrote: On Mon, Apr 23, 2018 at 8:35 PM, Toon Moene wrote: On 04/23/2018 01:00 PM, Richard Biener wrote: Note that while it looks "obvious" in the above source fragment the IL that is presented to optimizers may make things a lot less "low-hanging".

Re: Loop fusion.

2018-04-24 Thread Richard Biener
>>> compiler): >>> >>> 'And multiple consecutive array statements with the same shape are >>> “fused” >>> exactly so that the compiler can generate good cache use. This sort of >>> optimization is pretty low hanging fruit.' >>&g

Re: Loop fusion.

2018-04-23 Thread Toon Moene
tion from one of the members of the committee (about "their" compiler): 'And multiple consecutive array statements with the same shape are “fused” exactly so that the compiler can generate good cache use. This sort of optimization is pretty low hanging fruit.' As far as I can see l

Re: Loop fusion.

2018-04-23 Thread Richard Biener
LEVG) = PGFL(1:NPROMA,1:NFLEVG,YS%MP) >> >> >> >> The reaction from one of the members of the committee (about "their" >> >> compiler): >> >> >> >> 'And multiple consecutive array statements with the same shape are >> >

Re: Loop fusion.

2018-04-23 Thread Janne Blomqvist
ot; > >> compiler): > >> > >> 'And multiple consecutive array statements with the same shape are > “fused” > >> exactly so that the compiler can generate good cache use. This sort of > >> optimization is pretty low hanging fruit.' > >&

Re: Loop fusion.

2018-04-23 Thread Richard Biener
y so that the compiler can generate good cache use. This sort of >> optimization is pretty low hanging fruit.' >> >> As far as I can see loop fusion as a stand-alone optimization is not >> supported as yet, although some mention is made in the context of graphite. >>

Re: Loop fusion.

2018-04-23 Thread Richard Biener
rom one of the members of the committee (about "their" > compiler): > > 'And multiple consecutive array statements with the same shape are “fused” > exactly so that the compiler can generate good cache use. This sort of > optimization is pretty low hanging fruit.'

Re: Loop fusion.

2018-04-23 Thread Bin.Cheng
rom one of the members of the committee (about "their" > compiler): > > 'And multiple consecutive array statements with the same shape are “fused” > exactly so that the compiler can generate good cache use. This sort of > optimization is pretty low hanging fruit.'

Loop fusion.

2018-04-22 Thread Toon Moene
nsecutive array statements with the same shape are “fused” exactly so that the compiler can generate good cache use. This sort of optimization is pretty low hanging fruit.' As far as I can see loop fusion as a stand-alone optimization is not supported as yet, although some mention is ma

Re: More of a Loop fusion

2015-08-16 Thread Richard Biener
On August 16, 2015 1:21:22 PM GMT+02:00, Ajit Kumar Agarwal wrote: >All: > >Loop fusion is an important optimizations that fuses the set of Loops >if the following condition is valid. GCC does not implement loop fusion at all. Richard. >1) Loops are conformant ( i.e. they have

More of a Loop fusion

2015-08-16 Thread Ajit Kumar Agarwal
All: Loop fusion is an important optimizations that fuses the set of Loops if the following condition is valid. 1) Loops are conformant ( i.e. they have same iteration count). 2. Loops are control equivalent. The control equivalence of the loops can be identified with the dominator and post

Re: Loop fusion.

2015-04-23 Thread Richard Biener
On Wed, Apr 22, 2015 at 10:05 PM, Toon Moene wrote: > On 04/22/2015 09:10 PM, Steven Bosscher wrote: > >> On Wed, Apr 22, 2015 at 6:59 PM, Toon Moene wrote: > > >>> Why is loop fusion important, especially in Fortran 90 and later programs >>> ? >>> &

Re: Loop fusion.

2015-04-22 Thread Toon Moene
On 04/22/2015 09:10 PM, Steven Bosscher wrote: On Wed, Apr 22, 2015 at 6:59 PM, Toon Moene wrote: Why is loop fusion important, especially in Fortran 90 and later programs ? Because without it, every array assignment is a single loop nest, isolated from related, same-shape assignments

Re: Loop fusion.

2015-04-22 Thread Steven Bosscher
On Wed, Apr 22, 2015 at 6:59 PM, Toon Moene wrote: > Why is loop fusion important, especially in Fortran 90 and later programs ? > > Because without it, every array assignment is a single loop nest, isolated > from related, same-shape assignments. Why is this a bad thing? When yo

Loop fusion.

2015-04-22 Thread Toon Moene
/computing/our-facilities). In the context of GCC this is relevant, because one of the three compilers is gfortran (version 4.9.2). One of his slides discussed the differences in optimizations that the three compilers offer; I was surprised to learn that GCC/gfortran doesn't do loop f

Re: Graphite and Loop fusion.

2009-11-30 Thread Toon Moene
Sebastian Pop wrote: Hi Toon, On Mon, Nov 30, 2009 at 13:51, Toon Moene wrote: Sebastian, Obviously, this could benefit from loop fusion, by combining the four assignments in one loop. Is that on the horizon ? Yes, that's for gcc-4.6. Thanks ! -- Toon Moene - e-ma

Re: Graphite and Loop fusion.

2009-11-30 Thread Sebastian Pop
Hi Toon, On Mon, Nov 30, 2009 at 13:51, Toon Moene wrote: > Sebastian, > > I saw you updated the Graphite Wiki page, and I wondered if there are any > concrete plans on loop fusion. > > The reason I ask is because in Fortran (as of Fortran 90) one often sees > assig

Re: Graphite and Loop fusion.

2009-11-30 Thread Tim Prince
) where the four assignments all have the structure of loops like: DO I = 1, N DO J = 1, N X(J,I) = OP(A(J,I), B(J,I)) ENDDO ENDDO Obviously, this could benefit from loop fusion, by combining the four assignments in one loop. Provided that it were still possible to vectorize suitable

Graphite and Loop fusion.

2009-11-30 Thread Toon Moene
Sebastian, I saw you updated the Graphite Wiki page, and I wondered if there are any concrete plans on loop fusion. The reason I ask is because in Fortran (as of Fortran 90) one often sees assignments like: REAL, ALLOCATABLE :: A(:,:), B(:,:), C(:,:), D(:,:), E(:,:), F(:,:) ! ... READ IN