Loop fusion in gcc

Richard Biener richard.guenther@gmail.com
Sun Sep 24 06:35:17 GMT 2023


On Sat, Sep 23, 2023 at 2:54 PM Hanke Zhang via Gcc <gcc@gcc.gnu.org> 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 have any plans to implement this
> optimization? In addition, I also found that there is a function
> called `fuse_loop` in gcc/gimple-loop-jam.cc. Can it achieve the
> purpose of loop fusion?

I do not know of anybody implementing loop fusion.  The fuse_loop
function in unroll-and-jam might be able to fuse two loops in the IL
but it does not perform the required checking for correctness of
such transform and instead relies on the two loops being formed
by unrolling the loop containing them.

Richard.

>
> Hanke Zhang.


More information about the Gcc mailing list