public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "burnus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/46900] [4.6 Regression] 50% slowdown when linking with LTO in a single step
Date: Sun, 12 Dec 2010 10:50:00 -0000	[thread overview]
Message-ID: <bug-46900-4-Ss3iVAu1jE@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-46900-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46900

--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> 2010-12-12 10:50:09 UTC ---
(In reply to comment #3)
> (I don't understand why the MATMUL part differs that much - it should call the
> same BLAS function [via the same GCC 4.6 libgfortran.so wrapper] and LTO should
> not affect it.)

Seemingly, LTO is crucial for 4.5 - without LTO dgemm gets slower but the
libgfortran version gets faster:

$ gfortran-4.5 -fexternal-blas -O3 -ffast-math -march=native test.f90 dgemm.f
lsame.f xerbla.f && ./a.out
 Time, MATMUL:    1.3200819       53.480084765505403     
 dgemm:    1.3120821       56.452265589399069

$ gfortran-4.5 -c -flto -fexternal-blas -O3 -ffast-math -march=native test.f90
dgemm.f lsame.f xerbla.f 
$ gfortran-4.5 -flto -O3 -ffast-math -march=native test.o dgemm.o lsame.o
xerbla.o
$ ./a.out
 Time, MATMUL:    1.3080810       53.480084765505403     
 dgemm:    1.0800680       56.452265589399069     

Here, for GCC 4.5, one sees that for the direct call of dgemm, LTO improves the
performance - and doing a single step compilation+linkage or in two steps does
not matter.
However, also for GCC 4.5 the single-step pessimizes the performance of the
libgfortran MATMUL (which is a wrapper for dgemm).


  parent reply	other threads:[~2010-12-12 10:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-12 10:31 [Bug fortran/46900] New: " burnus at gcc dot gnu.org
2010-12-12 10:33 ` [Bug middle-end/46900] " burnus at gcc dot gnu.org
2010-12-12 10:34 ` burnus at gcc dot gnu.org
2010-12-12 10:39 ` [Bug middle-end/46900] [4.6 Regression] " burnus at gcc dot gnu.org
2010-12-12 10:50 ` burnus at gcc dot gnu.org [this message]
2010-12-16 14:40 ` rguenth at gcc dot gnu.org
2010-12-16 15:24 ` burnus at gcc dot gnu.org
2010-12-17 12:14 ` d.g.gorbachev at gmail dot com
2011-01-19 17:10 ` rguenth at gcc dot gnu.org
2011-01-19 22:11 ` burnus at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-46900-4-Ss3iVAu1jE@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).