From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by sourceware.org (Postfix) with ESMTP id 55EF13856974 for ; Fri, 21 Oct 2022 18:01:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 55EF13856974 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.crashing.org Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 29LI0UXd005272; Fri, 21 Oct 2022 13:00:30 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 29LI0URt005271; Fri, 21 Oct 2022 13:00:30 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Fri, 21 Oct 2022 13:00:29 -0500 From: Segher Boessenkool To: Jakub Jelinek Cc: Aldy Hernandez , GCC patches Subject: Re: [PATCH] Rename nonzero_bits to known_zero_bits. Message-ID: <20221021180029.GY25951@gate.crashing.org> References: <20221021131426.308205-1-aldyh@redhat.com> <20221021164533.GW25951@gate.crashing.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=no 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 Fri, Oct 21, 2022 at 06:54:32PM +0200, Jakub Jelinek wrote: > On Fri, Oct 21, 2022 at 06:51:19PM +0200, Jakub Jelinek wrote: > > Agreed. > > > > I think maybe_nonzero_bits would be fine. > > Or yet another option is to change what we track and instead of > having just one bitmask have 2 as tree-ssa-ccp.cc does, > one bitmask says which bits are known to be always the same > and the other which specifies the values of those bits. > "For X with a CONSTANT lattice value X & ~mask == value & ~mask. The > zero bits in the mask cover constant values. The ones mean no > information." I am still working on making the RTL nonzero_bits use DF (and indeed I do a known_zero instead :-) ). This makes the special version in combine unnecessary: instead of working better than the generic version it is strictly weaker then. This change then makes it possible to use nonzero_bits in instruction conditions (without causing ICEs as now -- passes after combine return a subset of the nonzero_bits the version in combine does, which can make insns no longer match in later passes). My fear is tracking twice as many bits might become expensive. OTOH ideally we can get rid of combine's reg_stat completely at some point in the future (which has all the same problems as combine's version of nonzero_bits: the values it returns depend on the order combine tried possible combinations). Storage requirements are the same for known_zero_bits and known_one_bits vs. known_bits and known_bit_values, but the latter is a bit more costly to compute, but more importantly it is usually a lot less convenient in use. (A third option is known_bits and known_zero_bits?) Segher