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 64AD83858D35 for ; Fri, 11 Nov 2022 23:17:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 64AD83858D35 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=1668208670; 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=elQGng2MxJgAm8MmMQLTsftd3vqeUojvHCyN7H5IwGI=; b=DwlRsidJ/fdTx4daslrXmb0qwnK926PQ3vxsEWBOyFrsJE0I5iMTTxlHa7SMU87QlTjNaZ W+vv6jhc/bGvMLLGoXVQhSOvTIegvu/gww/wckUlhryteWtuq13G8HEej+8WJBa7oResRI 8avTEqkYj2hY7wlmjDhp4vYf+DYg8io= Received: from mail-io1-f69.google.com (mail-io1-f69.google.com [209.85.166.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-486-sP5h1Z_XNlqpQWLVNLXUlg-1; Fri, 11 Nov 2022 18:17:49 -0500 X-MC-Unique: sP5h1Z_XNlqpQWLVNLXUlg-1 Received: by mail-io1-f69.google.com with SMTP id bf14-20020a056602368e00b006ce86e80414so3869778iob.7 for ; Fri, 11 Nov 2022 15:17:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=elQGng2MxJgAm8MmMQLTsftd3vqeUojvHCyN7H5IwGI=; b=ykugzi8DJiE1J+imdDBH0YBDd54lJcoZd4BMNMZLSrgnChMC/p58WY0FELK7qNO8/x rjot3c2f8EMGIuC5VMfi4UnpgwJU2aC9VufIcKNIrQslorOJ2rDk/M9hJ5Eefbr8INB1 0cYfiZsGoAgy/aIinYijL7FPT+xgF6KK0sHphzorZLguk70bZRDTpe4bIZhFIy52RNCD QwloJb2w1tLCSaXmGp8TxncBsBAMoJ3LZUd8dURxqDPAIauJbWXOQ55V7gJfeAJkDNAZ urY5VM8nXLqYYHn3FoFb1QoQxEA1fDlwu4e5cn8IcCVoidGEOxrMd9pXyQuYNA4WxpSJ jD0A== X-Gm-Message-State: ANoB5pnSGntp5VDAc0X9kh1Qq/eqyRtnbLWF4MiH88w4TRUYzBaIOLtL A6j7afj9ydaSFR+OgQvfRfE44naPB3dR9hshNEy60yoFcxjAQiEMGj3UGo3kgrbEfvN5oKrrQcf L01tSYij+PQVsBHuQFw== X-Received: by 2002:a92:c509:0:b0:300:e232:e0c3 with SMTP id r9-20020a92c509000000b00300e232e0c3mr1939909ilg.320.1668208668467; Fri, 11 Nov 2022 15:17:48 -0800 (PST) X-Google-Smtp-Source: AA0mqf6mDObLnwnqbQJ5nayWqKO4380BCA6zeWQ9/o6ptUGfQLRGGqSOymEtkmMqAXC4NJ0MDc3YOA== X-Received: by 2002:a92:c509:0:b0:300:e232:e0c3 with SMTP id r9-20020a92c509000000b00300e232e0c3mr1939904ilg.320.1668208668199; Fri, 11 Nov 2022 15:17:48 -0800 (PST) Received: from ?IPV6:2607:fea8:a263:f600::b081? ([2607:fea8:a263:f600::b081]) by smtp.gmail.com with ESMTPSA id q11-20020a05663810cb00b0036ce87bfd0fsm1186358jad.98.2022.11.11.15.17.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 11 Nov 2022 15:17:47 -0800 (PST) Message-ID: <3f2de5e6-027f-5669-b656-e4377d9cd2a8@redhat.com> Date: Fri, 11 Nov 2022 18:17:46 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.1 Subject: Re: [COMMITTED] process transitive inferred ranges in pre_fold_stmt. To: Bernhard Reutner-Fischer , Andrew MacLeod via Gcc-patches Cc: "hernandez, aldy" References: <3c68cb87-a088-85a0-0379-6aa893e36796@redhat.com> <20221111225641.66bfbad2@nbbrfq> From: Andrew MacLeod In-Reply-To: <20221111225641.66bfbad2@nbbrfq> 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=-12.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP 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 11/11/22 16:56, Bernhard Reutner-Fischer wrote: > On Fri, 11 Nov 2022 11:17:17 -0500 > Andrew MacLeod via Gcc-patches wrote: > >> diff --git a/gcc/tree-vrp.cc b/gcc/tree-vrp.cc >> index 3393c73a7db..a474d9d11e5 100644 >> --- a/gcc/tree-vrp.cc >> +++ b/gcc/tree-vrp.cc >> @@ -4485,6 +4486,7 @@ public: >> for (gphi_iterator gsi = gsi_start_phis (bb); !gsi_end_p (gsi); >> gsi_next (&gsi)) >> m_ranger->register_inferred_ranges (gsi.phi ()); >> + m_last_bb_stmt = last_stmt (bb); >> } >> >> void post_fold_bb (basic_block bb) override >> @@ -4497,19 +4499,14 @@ public: >> void pre_fold_stmt (gimple *stmt) override >> { >> m_pta->visit_stmt (stmt); >> + // If this is the last stmt and there are inferred ranges, reparse the >> + // block for transitive inferred ranges that occur earlier in the block. >> + if (stmt == m_last_bb_stmt) >> + m_ranger->register_transitive_inferred_ranges (gimple_bb (stmt)); >> } > So of course it doesn't really matter what that stmt was, a non_debug > is as good as a debug one AFAIU, it's just a marker, as good as any SSA > version or id, i suppose. So gsi_last_nondebug_bb(bb) is not strictly > needed, fine. It is important. It needs to be the last non-debug statement so that we can properly feed values into the final stmt of the block.. be it a conditional, switch or a return. > > But since it's last_stmt(), do you have an opinion on 1) in > https://gcc.gnu.org/pipermail/gcc-help/2021-November/140908.html > by chance, as you seem to use it.. Not really.  It possible that there is a slightly more efficient way to do it, not sure how measurable it would be.  Patches always welcome :-) Andrew