public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* LTO and the inlining of functions only called once.
@ 2009-10-10 11:00 Toon Moene
  2009-10-10 11:34 ` Richard Guenther
  0 siblings, 1 reply; 33+ messages in thread
From: Toon Moene @ 2009-10-10 11:00 UTC (permalink / raw)
  To: Jan Hubicka, gcc mailing list

Gcc's man page says:

        -finline-functions-called-once
            Consider all "static" functions called once for inlining into
            their caller even if they are not marked "inline".  If a call
            to a given function is integrated, then the function is not
            output as assembler code in its own right.

            Enabled at levels -O1, -O2, -O3 and -Os.

Now, when using -flto -fwhole-program, *all* functions (that the user 
provided) will be "static inline", no ? - so *all* functions only called 
once in that program will be inlined ?

I am asking because our most important programs often consist of a chain 
of "routines-that-do-all-the-work" which are all only called once. 
However, in general they are (certainly when viewed from the perspective 
of a C programmer) *huge*.

E.g., our forecast program:

      HLPROG (small "main" program)
         |
         | calls
         V
      GEMINI (read input files, write output files, and:)
         |
         V
      SL2TIM (time stepping, and:)
         |
         V
      PHCALL (subgrid scale computations)
         |
         V
      PHTASK (split them into tasks over model domain)
         |
         V
      PHYS   (actually hand out the work to:)
         |
      ----------------------
      |    |    |     |    |
      LSP  CVP  RADIA TURB SOIL

      (large scale precipitation, convective precipitation,
       radiation, turbulence, soil processes)

      The last five are each around 2,000 lines of Fortran, the P 
routines are each several hundreds of lines, as is SL2TIM.  GEMINI is 
more than 2,000 lines.

My question is: How can I be sure that all of them are integrated (note 
that the man page says they are "considered") ?  Does -Winline help here 
?  Perhaps I should scan the assembler output (HAH!).

Kind regards,

-- 
Toon Moene - e-mail: toon@moene.org - phone: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
At home: http://moene.org/~toon/
Progress of GNU Fortran: http://gcc.gnu.org/gcc-4.5/changes.html

^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2009-10-14 18:58 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-10 11:00 LTO and the inlining of functions only called once Toon Moene
2009-10-10 11:34 ` Richard Guenther
2009-10-10 11:47   ` Toon Moene
2009-10-10 11:50     ` Richard Guenther
2009-10-10 12:18       ` Richard Guenther
2009-10-10 12:31         ` Toon Moene
2009-10-10 14:25           ` Toon Moene
2009-10-10 15:10             ` Richard Guenther
2009-10-10 13:40   ` Jan Hubicka
2009-10-10 15:27     ` Daniel Jacobowitz
2009-10-10 15:28       ` Jan Hubicka
2009-10-11 13:30         ` Toon Moene
2009-10-10 15:33       ` Diego Novillo
2009-10-10 17:26         ` Joseph S. Myers
2009-10-14 20:07           ` Paolo Bonzini
2009-10-10 16:40       ` Jeff Law
2009-10-10 17:16         ` Richard Guenther
2009-10-13  1:05           ` Jeff Law
2009-10-13  1:29             ` Michael Matz
2009-10-13  6:39               ` Jeff Law
2009-10-13 12:05                 ` Paul Brook
2009-10-13 13:30                   ` Daniel Jacobowitz
2009-10-13 15:15                   ` Jeff Law
2009-10-13 18:31                   ` Adam Nemet
2009-10-13 18:43         ` Toon Moene
2009-10-14 10:05           ` Richard Guenther
2009-10-14 13:48             ` Toon Moene
2009-10-14 14:04             ` Toon Moene
2009-10-14 14:43               ` Jan Hubicka
2009-10-14 16:49                 ` Daniel Jacobowitz
2009-10-14 18:20                 ` Toon Moene
2009-10-14 18:58   ` Paolo Bonzini
2009-10-14 19:09     ` Paolo Bonzini

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).