From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id B2C773858C53 for ; Fri, 14 Jul 2023 11:21:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B2C773858C53 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689333716; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gjs/znCBnkXJQ/ZkRsqn30N1vwM9c9laa/Sk2rTFoOU=; b=KTCpe+wNjnLaAQbrIOPw2Bz50SMvpEPKn4xHDZqU6svyNTQ8Wvq2j143Gy/3tC4y6izRRb hDJTtRyDTYmoqsKDn5U7uzF6Jo51Ltk+J0PwW06hn88hSUbR7Q3zqpLykQdWW5XziL+a1D isyn2X2eApgan9zeZ5N76YPfiaXib58= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-594-CUgsLAzIOKCdUo13Ikk2LQ-1; Fri, 14 Jul 2023 07:21:54 -0400 X-MC-Unique: CUgsLAzIOKCdUo13Ikk2LQ-1 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-3fbb34f7224so8968795e9.2 for ; Fri, 14 Jul 2023 04:21:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689333713; x=1691925713; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=gjs/znCBnkXJQ/ZkRsqn30N1vwM9c9laa/Sk2rTFoOU=; b=ZttiueMSyCjWsaWj6ADnQ7So+w11D7YzNHGSERlyoTW7qoqpYCysNQs71FFFmwrXjo qHFlTzxi7CsP9z7xM2wsCacJcyBljZC1ABqmPyFLskkKyFAKH6cyRS7k0R07SXOJt0/l zB4XuIhBfhF2V9h7xGT2E5CPwMb4kCPCXTpa0iJyD6R6X+cc0VBF0ytEa8zSd4obSVKP XrBd4OEcloOOresErSLfIxgHVfnpLifzznBQRuUB89qgEXMrdaHD4yyjlmFaHSvVkUiu MUTHztPoL2fEIxLOhEXvndK4sl4eHaMJB+XO0zSAiv+dyjBPcxLnn2yChu1DmtTTP6vf KfqQ== X-Gm-Message-State: ABy/qLbkvs+aAkinIh5xyBp1dsI5CSyl3oger681q5JcvPr90gsLPiBn RqyvDyCjyZ+Vjdo0qvW3BFvL7qwSqM6qxMw3s+ctHbRC72mJWJIVB78zuDK4pNmFhzAQwe792le GAG0buAAZT2voC38wPg== X-Received: by 2002:a05:600c:286:b0:3fb:a1d9:ede8 with SMTP id 6-20020a05600c028600b003fba1d9ede8mr3871550wmk.10.1689333713442; Fri, 14 Jul 2023 04:21:53 -0700 (PDT) X-Google-Smtp-Source: APBJJlFqYSkrFatorjecxY82z81vmS0FqVyoAsd0lALY/4/21lMMicd2nBMqqfYjRsfp4W9oeZ8oYA== X-Received: by 2002:a05:600c:286:b0:3fb:a1d9:ede8 with SMTP id 6-20020a05600c028600b003fba1d9ede8mr3871540wmk.10.1689333713167; Fri, 14 Jul 2023 04:21:53 -0700 (PDT) Received: from [192.168.1.100] ([139.47.41.96]) by smtp.gmail.com with ESMTPSA id w19-20020a1cf613000000b003fa96fe2bd9sm1187124wmc.22.2023.07.14.04.21.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 14 Jul 2023 04:21:52 -0700 (PDT) Message-ID: <50d66243-f247-b91f-9fba-5c44b68a6f2a@redhat.com> Date: Fri, 14 Jul 2023 13:21:51 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [COMMITTED] [range-op] Take known set bits into account in popcount [PR107053] To: Jeff Law , GCC patches Cc: Andrew MacLeod References: <20230712211528.65888-1-aldyh@redhat.com> From: Aldy Hernandez In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,BODY_8BITS,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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