public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
To: Gabriel Dos Reis <gdr@integrable-solutions.net>
Cc: Martin Reinecke <martin@MPA-Garching.MPG.DE>, gcc@gcc.gnu.org
Subject: Re: std::pow implementation
Date: Mon, 04 Aug 2003 14:32:00 -0000	[thread overview]
Message-ID: <200308041351.h74DpZIw005089@mururoa.inria.fr> (raw)
In-Reply-To: <m31xw1shul.fsf@uniton.integrable-solutions.net>



gdr@integrable-solutions.net said:
> listing the (new) standard library in this discussion will create more
> confusion than helps sort out the issue.

That was not my point, I listed some of the big (necessary and/or good) changes
in the C++ context. The bigger library was often associated with bigger compile times, 
but as I said the list is certainly not changes that have to be 
accused for the compile times.

> | So saying that KCC was better than gcc because it inlined more was
> | simply not true (at the time where this story begins), KCC was still
>  | often better than gcc and gcc was inlining everything it could (ie
> | marked as inline either explicit or implicit).

> Please do be careful in your rephrasing.  I'm specifically concerned
> about honouring the inline request and -not- "inlining more".  And I'm
> not saying GCC should inline everything.  Part of the confusion in
> this debate came from the fact that people are considering that
> honouring the inline request means inlining everything.

Agreed. But, at that time gcc was "honouring the inline request" even 
better than KCC was. That is what the more refers to... When I say 
that gcc inlined everything it could means that it was "honouring the
inline request in all places where it could".

> | - The inlining strategy plays some important role. In the function 
> Equally important is considering the language-specific semantics.

Totally agreeing. I think, I basically say the same things somewhere 
else in the text.

> | Final point: it has been reported here (and it is also my  |
> experience), that for some C++ code, sometimes -Os (which I believe  |
> restricts the amount of inlining) results with more efficient code  |
> than all over -O[0123] choices.
> You seem to be confusing "inline" with "optimize".

Well, I agree that the example is not as clear as I would have wished...
Certainly -Os has consequences on the inlining limits but I agree 
this might be drawn in many other program transformations.

> I'll send in a moment a text I intended to send some time ago. 

I'll read it.


Note that my point was not to discuss how inline should be honoured. 
I gave just many contradicting facts:

- when gcc honored inline like you would like it did, it worked and 
was faster than it is now (not sure about the compiled code speed but 
it was not that bad in my recollections).

- Some limits on the "honoring" just have to exist.

- on the other hand, as mentioned elsewhere in the thread, just 
saying that the programmer knows what it does is simply not quite 
true... And the portability makes things even worse.

My guess (but this is just that) is that the situtation is bad for 
C++ because:

- inlining is now tree-based but most other optimizations are 
RTL-based.

- general speed has decreased (at least up to recently).

- most inlining limits were set based on too narrow testing (I 
believe it was mostly C programs). I agree that C and C++ need 
different treatment.

Now if I have to say something abou the topic, I believe that, 
unfortunately, because of the compilation times, I not quite sure that gcc is 
ready for the old "honor mostly every inline up to some extremely 
high limit"... that is why I said that the current situation is just 
a pragmatic move rather than a definitive answer.

As you said, to really realize the full benefits of inlining, one has 
to embed somehow inlining with other optimizations (cprop, dce, ...), 
currently (correct me if I'm wrong), the situation is doomed because 
inlining decisions are made on trees and most of these optimisations 
come later on RTL so that the metrics used to decide if inlining is 
a profitable choice cannot take account of the further optimizations
the inlining may allow. As I said my hope is that the SSA stuff will 
change the overall picture and will made the "compiler made" 
decisions a better alternative than it is now. Will the code size 
decrease (and hopefully the memory consumption and speed) be enough to 
"honour" all inline hints as you argue (provided it is better than 
the choices made by the compiler) I do not know.

My main conclusion is that inlining limits are just a trick to make 
the compiler fast enough to convince people to use it. They must be 
reconsidered regularly and IMHO made specific to each language (to 
better cope with the language expectations).
This is unfortunate and just a pragmatic conclusion and I place my 
hopes in SSA for a better answer to the problem.

Please correct me if I'm wrong in my expectations !!!




--------------------------------------------------------------------
Theodore Papadopoulo
Email: Theodore.Papadopoulo@sophia.inria.fr Tel: (33) 04 92 38 76 01
 --------------------------------------------------------------------


  reply	other threads:[~2003-08-04 13:51 UTC|newest]

Thread overview: 212+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-30 13:13 Martin Reinecke
2003-07-30 13:30 ` Gabriel Dos Reis
2003-07-30 13:40   ` Martin Reinecke
2003-07-30 13:46     ` Andrew Pinski
2003-07-30 13:47       ` Steven Bosscher
2003-07-30 14:32         ` Martin Reinecke
2003-07-30 13:53     ` Gabriel Dos Reis
2003-07-30 14:14       ` Martin Reinecke
2003-07-30 14:33         ` Gabriel Dos Reis
2003-07-30 15:27           ` Martin Reinecke
2003-07-30 15:42             ` Gabriel Dos Reis
2003-07-30 17:38               ` Martin Reinecke
2003-08-04 12:55           ` Theodore Papadopoulo
2003-08-04 13:11             ` Gabriel Dos Reis
2003-08-04 14:32               ` Theodore Papadopoulo [this message]
2003-08-04 14:50                 ` Gabriel Dos Reis
2003-08-04 14:58                   ` Daniel Berlin
2003-08-04 15:13                     ` The Zen of Optimizing C++ - What is the sound of one compiler inlining? Gabriel Dos Reis
2003-07-30 15:56 ` std::pow implementation Scott Robert Ladd
2003-07-30 16:16   ` Steven Bosscher
2003-07-30 16:47     ` Scott Robert Ladd
  -- strict thread matches above, loose matches on Subject: below --
2003-08-04 22:57 Robert Dewar
2003-08-04 18:42 Robert Dewar
2003-08-04 18:46 ` Gabriel Dos Reis
2003-08-04 18:22 Robert Dewar
2003-08-04 18:29 ` Gabriel Dos Reis
2003-08-04 18:21 Robert Dewar
2003-08-04 18:08 Robert Dewar
2003-08-04 18:17 ` Gabriel Dos Reis
2003-08-04 17:48 Robert Dewar
2003-08-04 17:57 ` Gabriel Dos Reis
2003-08-04 18:14   ` Joe Buck
2003-08-04 17:43 Robert Dewar
2003-08-04 17:53 ` Gabriel Dos Reis
2003-08-04 17:33 Robert Dewar
2003-08-04 17:36 ` Joe Buck
2003-08-04 17:38 ` Gabriel Dos Reis
2003-08-04 22:28 ` Mark Hahn
2003-08-04 22:49   ` tm_gccmail
2003-08-04 17:03 Robert Dewar
2003-08-04 17:23 ` Joe Buck
2003-08-04 18:05   ` Richard Earnshaw
2003-08-04 18:15     ` Gabriel Dos Reis
2003-08-04 19:00     ` Bernd Schmidt
2003-08-04 19:12       ` Richard Guenther
2003-07-31 12:05 Robert Dewar
2003-07-31 13:00 ` Gabriel Dos Reis
2003-07-31 11:50 Robert Dewar
2003-07-31 10:54 Richard Guenther
2003-07-31 11:08 ` Gabriel Dos Reis
2003-07-31 11:31 ` Rob Taylor
2003-07-31 14:13   ` Scott Robert Ladd
2003-07-31 14:44     ` Gabriel Dos Reis
2003-07-31 17:24     ` Steven Bosscher
2003-07-31 18:45       ` Scott Robert Ladd
2003-07-31 10:19 Martin Reinecke
2003-07-31 10:38 ` Gabriel Dos Reis
2003-07-30 22:49 Robert Dewar
2003-07-30 22:28 Robert Dewar
2003-07-30 21:49 Robert Dewar
2003-07-30 16:36 Robert Dewar
2003-07-30 16:49 ` Gabriel Dos Reis
2003-07-30 16:55 ` Scott Robert Ladd
2003-07-30 19:21 ` Felix Lee
2003-07-30 16:08 Robert Dewar
2003-07-30 16:06 Richard Guenther
2003-07-30 16:37 ` Martin Reinecke
2003-07-30 14:25 Robert Dewar
2003-07-30 14:49 ` Gabriel Dos Reis
2003-07-30 14:21 Robert Dewar
2003-07-30 14:44 ` Gabriel Dos Reis
2003-07-30 14:51   ` Paolo Carlini
2003-07-30 16:59     ` Joe Buck
2003-07-30 17:35       ` Richard Earnshaw
2003-07-30 14:18 Robert Dewar
2003-07-30 14:31 ` Richard Earnshaw
2003-07-30 14:36 ` Richard Guenther
2003-07-30 14:11 Robert Dewar
2003-07-30 14:29 ` Richard Guenther
2003-07-30 14:05 Robert Dewar
2003-07-30 14:14 ` Gabriel Dos Reis
2003-07-30 14:04 Robert Dewar
2003-07-30 14:10 ` Gabriel Dos Reis
2003-07-30 13:56 Robert Dewar
2003-07-30 14:04 ` Richard Guenther
2003-07-30 14:08 ` Gabriel Dos Reis
2003-07-31  2:10   ` Alexandre Oliva
2003-07-31  2:46     ` Gabriel Dos Reis
2003-07-31  6:49       ` Alexandre Oliva
2003-07-31  7:58         ` Gabriel Dos Reis
2003-07-31  8:14         ` Gabriel Dos Reis
2003-07-30 13:52 Robert Dewar
2003-07-30 14:02 ` Richard Guenther
2003-07-30 13:25 Robert Dewar
2003-07-30 12:55 Stephan T. Lavavej
2003-07-30 12:59 ` Gabriel Dos Reis
2003-07-29 11:57 Richard Guenther
2003-07-29 12:10 ` Gabriel Dos Reis
2003-07-29 12:10   ` Richard Guenther
2003-07-29 12:14     ` Gabriel Dos Reis
2003-07-29 12:25       ` Richard Guenther
2003-07-29 12:38         ` Gabriel Dos Reis
2003-07-29 12:44           ` Richard Guenther
2003-07-29 12:49             ` Gabriel Dos Reis
2003-07-30  5:18               ` Alexandre Oliva
2003-07-30  5:26                 ` Gabriel Dos Reis
2003-07-30  6:57                   ` Alexandre Oliva
2003-07-30 10:11                     ` Gabriel Dos Reis
2003-07-30 11:58                       ` Richard Earnshaw
2003-07-30 12:11                         ` Gabriel Dos Reis
2003-07-30 12:13                           ` Steven Bosscher
2003-07-30 12:23                             ` Gabriel Dos Reis
2003-07-30 12:31                               ` Steven Bosscher
2003-07-30 12:47                                 ` Gabriel Dos Reis
2003-07-30 13:06                                   ` Steven Bosscher
2003-07-30 13:22                                     ` Gabriel Dos Reis
2003-07-30 12:42                               ` Richard Guenther
2003-07-30 12:46                                 ` Gabriel Dos Reis
2003-07-30 13:01                                   ` Richard Guenther
2003-07-30 13:26                                     ` Steven Bosscher
2003-07-30 13:38                                       ` Richard Guenther
2003-07-30 13:49                                         ` Gabriel Dos Reis
2003-07-30 13:19                           ` Karel Gardas
2003-07-30 13:24                             ` Gabriel Dos Reis
2003-07-30 13:41                             ` Richard Earnshaw
2003-07-30 13:51                               ` Gabriel Dos Reis
2003-07-30 13:51                                 ` Richard Earnshaw
2003-07-30 13:59                                   ` Gabriel Dos Reis
2003-07-30 14:08                                     ` Richard Guenther
2003-07-30 14:19                                       ` Richard Guenther
2003-07-30 14:24                                       ` Gabriel Dos Reis
2003-07-30 14:48                                         ` Richard Guenther
2003-07-30 14:55                                           ` Gabriel Dos Reis
2003-07-30 15:29                                             ` Richard Guenther
2003-07-31  0:30                                       ` Richard B. Kreckel
2003-07-30 14:11                                     ` Richard Earnshaw
2003-07-30 14:26                                       ` Gabriel Dos Reis
2003-07-30 16:25                                   ` Scott Robert Ladd
2003-07-30 13:59                                 ` Richard Guenther
2003-07-30 14:01                                   ` Gabriel Dos Reis
2003-07-30 15:45                         ` Scott Robert Ladd
2003-07-30 16:50                           ` Richard Earnshaw
2003-07-30 16:57                             ` Gabriel Dos Reis
2003-07-30 17:42                               ` Richard Earnshaw
2003-07-30 18:06                                 ` Gabriel Dos Reis
2003-07-30 17:02                             ` Scott Robert Ladd
2003-07-30 19:31                             ` tm_gccmail
2003-07-30 17:32                         ` Joe Buck
2003-07-29 12:53           ` Steven Bosscher
2003-07-29 12:53             ` Gabriel Dos Reis
2003-07-29 12:58               ` Richard Guenther
2003-07-29 12:59                 ` Steven Bosscher
2003-07-29 13:05                   ` Paolo Carlini
2003-07-29 13:22                     ` Richard Guenther
2003-07-29 13:36                       ` Steven Bosscher
2003-07-29 14:14                         ` Richard Guenther
2003-07-29 14:22                         ` Richard Guenther
2003-07-29 13:00                 ` Andrew Pinski
2003-07-29 13:28                   ` Richard Guenther
2003-07-29 13:59                     ` Andrew Pinski
2003-07-29 14:17                       ` Gabriel Dos Reis
2003-07-29 13:14                 ` Gabriel Dos Reis
2003-07-29 13:14               ` Steven Bosscher
2003-07-29 14:08                 ` Gabriel Dos Reis
2003-07-29 14:24                   ` Steven Bosscher
2003-07-29 14:24                     ` Gabriel Dos Reis
2003-07-29 14:31                     ` Gabriel Dos Reis
2003-07-29 14:40                       ` Steven Bosscher
2003-07-29 15:11                         ` Gabriel Dos Reis
2003-07-29 15:37                           ` Michael Matz
2003-07-29 15:59                             ` Gabriel Dos Reis
2003-07-29 15:59                               ` Michael Matz
2003-07-29 16:05                                 ` Gabriel Dos Reis
2003-07-29 16:20                                   ` Rob Taylor
2003-07-29 14:36                     ` Gabriel Dos Reis
2003-07-29 15:24                       ` Richard Guenther
2003-07-29 16:30                         ` Gabriel Dos Reis
2003-07-29 18:35                           ` Richard Guenther
2003-07-29 14:51                     ` Gabriel Dos Reis
2003-07-29 15:33                       ` Steven Bosscher
2003-07-30  5:24                       ` Alexandre Oliva
2003-07-30  5:33                         ` Gabriel Dos Reis
2003-07-30  6:38                           ` Alexandre Oliva
2003-07-30 10:32                             ` Gabriel Dos Reis
2003-07-30 10:33                               ` Alexandre Oliva
2003-07-30 10:46                                 ` Gabriel Dos Reis
2003-07-30 11:57                                   ` Alexandre Oliva
2003-07-30 12:20                                     ` Gabriel Dos Reis
2003-07-30 15:50                                     ` Scott Robert Ladd
2003-07-30 15:53                                       ` Steven Bosscher
2003-07-30 15:53                                         ` Richard Guenther
2003-07-30 16:01                                         ` Gabriel Dos Reis
2003-07-30 16:09                                           ` Steven Bosscher
2003-07-30 16:39                                             ` Gabriel Dos Reis
2003-07-30 16:17                                           ` Richard Guenther
2003-07-30 16:24                                             ` Steven Bosscher
2003-08-04 16:55                                     ` Bernd Schmidt
2003-08-04 17:08                                       ` Alexandre Oliva
2003-07-30 10:37                               ` Steven Bosscher
2003-07-30 11:31                                 ` Gabriel Dos Reis
2003-07-30 15:44                               ` Scott Robert Ladd
2003-07-30 17:10                                 ` Joe Buck
2003-07-30 17:32                                   ` Richard Guenther
2003-07-30 18:22                                     ` Daniel Berlin
2003-07-30 19:08                                       ` Richard Guenther
2003-07-30 19:12                                         ` Daniel Berlin
2003-07-30 17:06                           ` Joe Buck
2003-07-30 17:26                             ` Gabriel Dos Reis
2003-07-29 19:58   ` Neil Booth
2003-07-29 20:14     ` Gabriel Dos Reis
2003-07-29 20:33       ` Richard Guenther
2003-07-29 20:49         ` Gabriel Dos Reis

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=200308041351.h74DpZIw005089@mururoa.inria.fr \
    --to=theodore.papadopoulo@sophia.inria.fr \
    --cc=gcc@gcc.gnu.org \
    --cc=gdr@integrable-solutions.net \
    --cc=martin@MPA-Garching.MPG.DE \
    /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).