public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Aldy Hernandez <aldyh@redhat.com>
To: Jeff Law <jeffreyalaw@gmail.com>, GCC patches <gcc-patches@gcc.gnu.org>
Cc: Andrew MacLeod <amacleod@redhat.com>
Subject: Re: [COMMITTED] [range-op] Take known set bits into account in popcount [PR107053]
Date: Fri, 14 Jul 2023 13:21:51 +0200	[thread overview]
Message-ID: <50d66243-f247-b91f-9fba-5c44b68a6f2a@redhat.com> (raw)
In-Reply-To: <f9a7585c-66a9-0efd-6403-b0e0d2283c2d@gmail.com>



On 7/12/23 23:50, Jeff Law wrote:
> 
> 
> On 7/12/23 15:15, Aldy Hernandez via Gcc-patches wrote:
>> This patch teaches popcount about known set bits which are now
>> available in the irange.
>>
>>     PR tree-optimization/107053
>>
>> gcc/ChangeLog:
>>
>>     * gimple-range-op.cc (cfn_popcount): Use known set bits.
>>
>> gcc/testsuite/ChangeLog:
>>
>>     * gcc.dg/tree-ssa/pr107053.c: New test.
> You could probably play similar games with ctz/clz, though it's hard to 
> know if it's worth the effort.
> 
> One way to find out might be to build jemalloc which uses those idioms 
> heavily.  Similarly for deepsjeng from spec2017.
> 
> Jeff
> 

See class cfn_clz and class cfn_ctz in gimple-range-op.cc.  There's 
already code for both of these, although they're throwback from the VRP 
era, so there's definitely room for improvement.  I think they came from 
vr-values.cc.

Aldy


      reply	other threads:[~2023-07-14 11:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-12 21:15 Aldy Hernandez
2023-07-12 21:15 ` [COMMITTED] [range-op] Take known mask into account for bitwise ands [PR107043] Aldy Hernandez
2023-07-12 21:50 ` [COMMITTED] [range-op] Take known set bits into account in popcount [PR107053] Jeff Law
2023-07-14 11:21   ` Aldy Hernandez [this message]

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=50d66243-f247-b91f-9fba-5c44b68a6f2a@redhat.com \
    --to=aldyh@redhat.com \
    --cc=amacleod@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jeffreyalaw@gmail.com \
    /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).