[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using __builtin_expect (likely/unlikely macros)

From: Paul Eggert
Subject: Re: Using __builtin_expect (likely/unlikely macros)
Date: Thu, 18 Apr 2019 01:25:31 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

Konstantin Kharlamov wrote:
I was told that e.g. "cold" attribute can sometimes produce unbearably slow code https://gcc.gnu.org/ml/gcc-help/2019-01/msg00035.html

Although cold functions can be slow, it appears that overall it's a win for Emacs to mark _Noreturn error function declarations as cold: on my platform, 'make compile-always' ran about 1.3% faster. So I installed the attached patch into master. (Like Stefan, I'm wary of marking functions 'hot' so I didn't do that.)

This patch also adds a convenience macro AVOID for the now-common pattern '_Noreturn ATTRIBUTE_COLD void'.

Attachment: 0001-Mark-_Noreturn-error-functions-as-cold.txt
Description: Text document

reply via email to

[Prev in Thread] Current Thread [Next in Thread]