This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Compilation flags in libgfortran
- From: Janne Blomqvist <blomqvist dot janne at gmail dot com>
- To: Igor Zamyatin <izamyatin at gmail dot com>
- Cc: gcc mailing list <gcc at gcc dot gnu dot org>, Yuri Rumyantsev <ysrumyan at gmail dot com>, Fortran List <fortran at gcc dot gnu dot org>
- Date: Tue, 15 Oct 2013 22:46:25 +0300
- Subject: Re: Compilation flags in libgfortran
- Authentication-results: sourceware.org; auth=none
- References: <CAKdSQZk4gBwLOXPNL+Z+Nc8476S0acuFMKYS3QLG=hkzzLCqbQ at mail dot gmail dot com>
On Tue, Oct 15, 2013 at 4:58 PM, Igor Zamyatin <izamyatin@gmail.com> wrote:
> Hi All!
>
> Is there any particular reason that matmul* modules from libgfortran
> are compiled with -O2 -ftree-vectorize?
Yes, testing showed that it improved performance compared to the
default options. See the thread starting at
http://gcc.gnu.org/ml/fortran/2005-11/msg00366.html
In the almost 8 years (!!) since the patch was merged, I believe the
importance of vectorization for utilizing current processors has only
increased.
[snip]
> Why not just use O3 for those modules?
Back when the change was made, -ftree-vectorize wasn't enabled by -O3.
IIRC I did some tests, and -O3 didn't really improve things beyond
what "-O2 -funroll-loops -ftree-vectorize" already did. That was a
while ago however, so if somebody (*wink*) would care to redo the
benchmarks things might look different with today's GCC on today's
hardware.
Hope this helps,
--
Janne Blomqvist