From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id A398D3858D20 for ; Fri, 5 May 2023 15:10:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A398D3858D20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=suse.cz Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id CCED422140; Fri, 5 May 2023 15:10:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1683299424; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=RKCOoMLA8YsznRIs8CXPbzi5tXcCamXrR87WDIiTRfI=; b=FYNGsOfFwmMepZwjZWyhrxLoBRyjQVhMkYGHBFOfYrQSxfUli7LPOebBXS0lKTPnQpFumJ AcaxK7BoBhmCTQFfd2P6/E11P2p9VdpiDvQZ/XUIQRMcIacemDJvhRyZOm0YSSbRFCiZCt S3I+sa2d62ChaCX+4TEQD0LStpzAt1E= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1683299424; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=RKCOoMLA8YsznRIs8CXPbzi5tXcCamXrR87WDIiTRfI=; b=vttCCyCku7Xd6I1BoyOL+grWtq023iu4Dl9lsqikdmg71z5UyGnDrKW9nf3anM73R5vBRW C4cI1Kqc7nLxFeDw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id BB93E13513; Fri, 5 May 2023 15:10:24 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Bp3YLWAcVWRJCAAAMHmgww (envelope-from ); Fri, 05 May 2023 15:10:24 +0000 From: Martin Jambor To: GCC patches Cc: Andrew MacLeod , Aldy Hernandez Subject: Re: [COMMITTED] Remove deprecated range_fold_{unary, binary}_expr uses from ipa-*. In-Reply-To: <20230426083328.313566-4-aldyh@redhat.com> References: <20230426083328.313566-1-aldyh@redhat.com> <20230426083328.313566-4-aldyh@redhat.com> User-Agent: Notmuch/0.37 (https://notmuchmail.org) Emacs/28.2 (x86_64-suse-linux-gnu) Date: Fri, 05 May 2023 17:10:24 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_NONE,SPF_SOFTFAIL,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: Hello, On Wed, Apr 26 2023, Aldy Hernandez via Gcc-patches wrote: > gcc/ChangeLog: > > * ipa-cp.cc (ipa_vr_operation_and_type_effects): Convert to ranger API. > (ipa_value_range_from_jfunc): Same. > (propagate_vr_across_jump_function): Same. > * ipa-fnsummary.cc (evaluate_conditions_for_known_args): Same. > * ipa-prop.cc (ipa_compute_jump_functions_for_edge): Same. > * vr-values.cc (bounds_of_var_in_loop): Same. thanks for taking care of the value range uses in IPA. > --- > gcc/ipa-cp.cc | 28 +++++++++++++++++++++------ > gcc/ipa-fnsummary.cc | 45 ++++++++++++++++++++++++++++---------------- > gcc/ipa-prop.cc | 5 ++--- > gcc/vr-values.cc | 6 ++++-- > 4 files changed, 57 insertions(+), 27 deletions(-) > > diff --git a/gcc/ipa-cp.cc b/gcc/ipa-cp.cc > index 65c49558b58..6788883c40b 100644 > --- a/gcc/ipa-cp.cc > +++ b/gcc/ipa-cp.cc > @@ -128,6 +128,7 @@ along with GCC; see the file COPYING3. If not see > #include "attribs.h" > #include "dbgcnt.h" > #include "symtab-clones.h" > +#include "gimple-range.h" > > template class ipcp_value; > > @@ -1900,10 +1901,15 @@ ipa_vr_operation_and_type_effects (value_range *dst_vr, > enum tree_code operation, > tree dst_type, tree src_type) > { > - range_fold_unary_expr (dst_vr, operation, dst_type, src_vr, src_type); > - if (dst_vr->varying_p () || dst_vr->undefined_p ()) > + if (!irange::supports_p (dst_type) || !irange::supports_p (src_type)) > return false; > - return true; > + > + range_op_handler handler (operation, dst_type); Would it be possible to document the range_op_handler class somewhat? > + return (handler > + && handler.fold_range (*dst_vr, dst_type, > + *src_vr, value_range (dst_type)) > + && !dst_vr->varying_p () > + && !dst_vr->undefined_p ()); It looks important but the class is not documented at all. Although the use of fold_range is probably hopefully mostly clear from its uses in this patch, the meaning of the return value of this method and what other methods do is less obvious. For example, I am curious why (not in this patch, but in the code as it is now in the repo), uses of fold_range seem to be always preceeded with a check for supports_type_p, even though the type is then also fed into fold_range itself. Does the return value of fold_range mean something slightly different from "could not deduce anything?" Thanks! Martin