This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Loop Unroll
- From: Alexander Monakov <amonakov at ispras dot ru>
- To: Francis Girard <francis dot girard07 at gmail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Thu, 5 May 2011 17:53:12 +0400 (MSD)
- Subject: Re: Loop Unroll
- References: <BANLkTi=M1YMRTSW1vwEdGg-LpNs0bOMVgw@mail.gmail.com> <BANLkTimdEuzQdj+9hVL791pO3Kedm_i5qg@mail.gmail.com>
On Thu, 5 May 2011, Francis Girard wrote:
> How may we _easily_ know whether the compiler did indeed unroll a loop
> or not in C/C++ ?
In case of GCC, you can add -fdump-rtl-loop2_unroll-slim to compiler command
line and examine the resulting dump file (look for ";; Unrolled loop"),
although there is no easy way to tell to which loop the compiler is referring
to. It is still usable in case there is only one loop in the function you're
interested in.
Alexander