From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Konstantin Kharlamov Newsgroups: gmane.emacs.devel Subject: Re: Using __builtin_expect (likely/unlikely macros) Date: Thu, 18 Apr 2019 11:43:33 +0300 Message-ID: <1555577013.12550.0@yandex.ru> References: <87a7gst973.fsf@gmail.com> <875zrgt12q.fsf@gmail.com> <6919a4c8-df76-ea1e-34db-1fa62a360e5a@cs.ucla.edu> <87h8aykdod.fsf@gmail.com> <4fa7885e-8c66-c7c4-ff71-a013505863af@cs.ucla.edu> <2dfb837d-989d-c736-b6e6-b20c0e940596@cs.ucla.edu> <87o956c4n4.fsf@gmail.com> <1fbd2fca-18f0-0a90-7a45-58419a9e11ee@cs.ucla.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-5; format=flowed Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="53287"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Stefan Monnier , Alex Gramiak , emacs-devel@gnu.org To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Apr 18 10:46:25 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hH2gX-000DbF-9v for ged-emacs-devel@m.gmane.org; Thu, 18 Apr 2019 10:46:21 +0200 Original-Received: from localhost ([127.0.0.1]:38097 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hH2gV-0004iI-Qx for ged-emacs-devel@m.gmane.org; Thu, 18 Apr 2019 04:46:19 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:48287) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hH2fq-0004hv-3V for emacs-devel@gnu.org; Thu, 18 Apr 2019 04:45:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hH2fp-0001P2-1v for emacs-devel@gnu.org; Thu, 18 Apr 2019 04:45:38 -0400 Original-Received: from forward105o.mail.yandex.net ([2a02:6b8:0:1a2d::608]:56722) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hH2fo-0001Iu-BK for emacs-devel@gnu.org; Thu, 18 Apr 2019 04:45:36 -0400 Original-Received: from mxback2j.mail.yandex.net (mxback2j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10b]) by forward105o.mail.yandex.net (Yandex) with ESMTP id BD89A420293C; Thu, 18 Apr 2019 11:45:30 +0300 (MSK) Original-Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback2j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id FBtj59ez86-jU6ekaVC; Thu, 18 Apr 2019 11:45:30 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1555577130; bh=oSd/O2VDO0SznrvVMOtW31bb6KuS0w7LVjSz8xDMcSo=; h=In-Reply-To:Cc:To:Subject:From:References:Date:Message-Id; b=g2FevSpOydVM82LHKLrJTTuVhpR4Gc4YSALO7UK8h36+hF9yhWZfdcfvrQWFXpjYY 4/bojcGtXdnDLxpu1HUHmME5mBobNKuTBm1g2+b0nMsakH1erb2ePdXsthOCBSFOK9 YkNgaiWvRlfKKhHMg88pT8RDWupTKlpVDbd0FSGw= Authentication-Results: mxback2j.mail.yandex.net; dkim=pass header.i=@yandex.ru Original-Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id DuTMaotP0b-jTAuwqTT; Thu, 18 Apr 2019 11:45:29 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) In-Reply-To: <66b74701-012a-902e-4a5b-6bc30efa87c0@cs.ucla.edu> X-Mailer: geary/mainline~g7970b668 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a02:6b8:0:1a2d::608 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:235616 Archived-At: Thanks. I wonder if "AVOID" macro may sound more clear about its=20 intended use as "NEVER_RETURN" or "DIE"? On =C7=E2, Apr 18, 2019 at 01:25, Paul Eggert wrote: > Konstantin Kharlamov wrote: >> I was told that e.g. "cold" =7Fattribute can sometimes produce=20 >> unbearably slow code=20 >> =7Fhttps://gcc.gnu.org/ml/gcc-help/2019-01/msg00035.html >=20 > Although cold functions can be slow, it appears that overall it's a=20 > win for Emacs to mark _Noreturn error function declarations as cold:=20 > on my platform, 'make compile-always' ran about 1.3% faster. So I=20 > installed the attached patch into master. (Like Stefan, I'm wary of=20 > marking functions 'hot' so I didn't do that.) >=20 > This patch also adds a convenience macro AVOID for the now-common=20 > pattern '_Noreturn ATTRIBUTE_COLD void'. =