public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Siddhesh Poyarekar <siddhesh@gotplt.org>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH v2] tree-object-size: Make unknown a computation
Date: Tue, 19 Oct 2021 09:45:57 +0200	[thread overview]
Message-ID: <20211019074557.GK304296@tucnak> (raw)
In-Reply-To: <20211019073830.303140-1-siddhesh@gotplt.org>

On Tue, Oct 19, 2021 at 01:08:30PM +0530, Siddhesh Poyarekar wrote:
> Compute the unknown size value as a function of the min/max bit of
> object_size_type.  This transforms into a neat little branchless
> sequence on x86_64:
> 
> 	movl	%edi, %eax
> 	sarl	%eax
> 	xorl	$1, %eax
> 	negl	%eax
> 	cltq
> 
> which should be faster than loading the value from memory.  A quick
> unscientific test using
> 
> `time make check-gcc RUNTESTFLAGS="dg.exp=builtin*"`
> 
> shaves about half a second off execution time with this.  Also simplify
> implementation of unknown_object_size.
> 
> gcc/ChangeLog:
> 
> 	* tree-object-size.c (unknown): Make into a function.  Adjust
> 	all uses.
> 	(unknown_object_size): Simplify implementation.
> 
> Signed-off-by: Siddhesh Poyarekar <siddhesh@gotplt.org>

Ok for trunk if it passes bootstrap/regtest.

	Jakub


  reply	other threads:[~2021-10-19  7:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-19  4:17 [PATCH] " Siddhesh Poyarekar
2021-10-19  6:58 ` Jakub Jelinek
2021-10-19  7:28   ` Siddhesh Poyarekar
2021-10-19  7:38   ` [PATCH v2] " Siddhesh Poyarekar
2021-10-19  7:45     ` Jakub Jelinek [this message]
2021-10-20  3:00       ` Siddhesh Poyarekar

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=20211019074557.GK304296@tucnak \
    --to=jakub@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=siddhesh@gotplt.org \
    /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).