This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch, libfortran] Mark some codepaths as likely/unlikely


Thomas Koenig wrote:
> On Wed, 2008-10-15 at 13:53 +0200, Tobias Burnus wrote:
>> Thomas Koenig wrote:
>>> - A codepath that reaches generate_error() is assumed to be unlikely
>>>   
>> I think this is not needed. Functions which are marked as not returning
>> ("__attribute__ ((noreturn))") are automatically regarded as unlikely
>
> generate_error() isn't thus tagged, and it should not be, because it
> does return when ERR or IOSTAT are set.

Ups. Missed that.


Jane Blomqvist wrote:
> On Wed, Oct 15, 2008 at 1:55 PM, Thomas Koenig <tkoenig@netcologne.de> wrote:
>> > here's a straightforward patch to mark some codepaths as
>> > likely/unlikely, depending on two criteria:
>> > - A codepath that reaches generate_error() is assumed to be unlikely
>> > - A test for GFC_CONVERT_NATIVE is assumed to be likely
> 
> Uh? Do you have benchmark results showing an improvement? My gut
> instinct would be that the IO library is limited by [...]


I also believe that Thomas' patch will not help much, but even if it
only improves once CPU cycle per I/O statement I think there is no
reason not to include it. Especially as GFC_CONVERT_NATIVE is really the
default and generate_error most of the time should not be called - a
useful call could be to count lines but then it only returns an error
for the last try while it improves the runtime for all the other lines.

As likely/unlikely tagging should not increase the runtime (except that
one bets wrong, which is unlikely here) - it should only reduce the run
time or keep it the same - I think there is nothing wrong to accept it
without doing an extensive benchmark.

Thus: OK for the trunk.

Tobias


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]