From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by sourceware.org (Postfix) with ESMTPS id AF72C385800D for ; Sat, 13 Nov 2021 13:26:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AF72C385800D Received: by mail-wr1-x42f.google.com with SMTP id w29so20578738wra.12 for ; Sat, 13 Nov 2021 05:26:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:user-agent:in-reply-to :references:message-id:mime-version:content-transfer-encoding; bh=XzfTDec0bT6NKdPGWnzMm2AcJdDTkzHRcZZTykj4v+w=; b=rYR7MlgU0b6J1TMvE6bQyxGuXTVBr8NbuUSBqyp/Cq0hk2gUDrCICB/+ReN1TOfPLz XnQCAetiAf7Gk6kbBlKoSgLgB9UMHaqjbXet0AnQ30DYn+IBG85LVIBj2wQEXEczWrvQ CpZrkLbpZyLSs6UgcOLyTvM1tMdfzbt8A64Eg35IqvQSpUlG0f4VwPgLi7V/MAjEQjRQ ilN8g5n5FSfy9p5oAbOiUg0no6yug0ceRWL2oxTGlwUtQ9c3GL4HMiNaT8g5ABLLTHl4 bZnzUR+mXM5Ee4GCshwTyjdSCdCl7qLjs0nXsiuZC2TXTI2TiQGC6zkXTuLw/cWwnhXc BA0Q== X-Gm-Message-State: AOAM5331m9AqRoFCe6D5Uu2s6U++AiRb5yuybITZ3SojNDdMtnIKozsy N6rjtK5y8Uvdi2aWNFnvIcU= X-Google-Smtp-Source: ABdhPJxSXmbe3fnT+SinesG97aisgSArOykFKgJUKKvqWcYAuHUKLxwa2CUtnKAoj65T4uHyudDqCg== X-Received: by 2002:a5d:694a:: with SMTP id r10mr27595035wrw.170.1636809981734; Sat, 13 Nov 2021 05:26:21 -0800 (PST) Received: from [127.0.0.1] (dynamic-095-117-006-082.95.117.pool.telefonica.de. [95.117.6.82]) by smtp.gmail.com with ESMTPSA id l15sm8363399wme.47.2021.11.13.05.26.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 13 Nov 2021 05:26:21 -0800 (PST) Date: Sat, 13 Nov 2021 14:26:17 +0100 From: Richard Biener To: Aldy Hernandez , Andrew MacLeod CC: Aldy Hernandez via Gcc-patches Subject: Re: [COMMITTED] path solver: Solve PHI imports first for ranges. User-Agent: K-9 Mail for Android In-Reply-To: References: <20211112194625.1021072-1-aldyh@redhat.com> <92701e4b-0f9f-bdcf-63cb-9c57237b85ac@redhat.com> Message-ID: <2F193A1A-2BE7-4CAF-8E04-C60C8F14DF01@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_SHORT, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2021 13:26:24 -0000 On November 13, 2021 10:41:02 AM GMT+01:00, Aldy Hernandez wrote: >On Sat, Nov 13, 2021 at 1:51 AM Andrew MacLeod wr= ote: >> >> On 11/12/21 14:50, Richard Biener via Gcc-patches wrote: >> > On November 12, 2021 8:46:25 PM GMT+01:00, Aldy Hernandez via Gcc-pat= ches wrote: >> >> PHIs must be resolved first while solving ranges in a block, >> >> regardless of where they appear in the import bitmap=2E We went thr= ough >> >> a similar exercise for the relational code, but missed these=2E >> > Must not all stmts be resolved in program order (for optimality at le= ast)? >> >> Generally,Imports are live on entry values to a block, so their order i= s >> not particularly important=2E=2E they are all simultaneous=2E PHIs are = also >> considered imports for data flow purposes, but they happen before the >> first stmt, all simultaneously=2E=2E=2E they need to be distinguished b= ecause >> phi arguments can refer to other phi defs which may be in this block >> live around a back edge, and we need to be sure we get the right versio= n=2E >> >> we should look closer to be sure this isn't an accidental fix that >> leaves the root problem =2E we need to be sure *all* the PHI argument= s >> are resolved from outside this block=2E whats the testcase? > >The testcase is the simpler testcase from the PR: > >https://gcc=2Egnu=2Eorg/bugzilla/attachment=2Ecgi?id=3D51776 > >The gist is on a path coming in from BB13: > > # n_42 =3D PHI > # m_31 =3D PHI <0(13), m_16(4)> > >We were solving m_31 first and putting it in the cache, and then the >calculation for n_42 picked up this cached m_31 incorrectly=2E > >With my patch we do the PHIs first, in whatever gphi_iterator order >uses, which I assume is the order in the IL above=2E > >However, if PHIs must be resolved simultaneously, then perhaps we need >to tweak this=2E Suppose we flip the definitions: > > # m_31 =3D PHI <0(13), m_16(4)> > # n_42 =3D PHI > >I assume the definition of n_42 should pick up the incoming m_31(13), >not one defined in the other PHI=2E In which case, we could resolve all >the PHIs first, but put them in the cache after we're done with all of >them=2E PHI order is irrelevant, they are executed in parallel, thus arguments pic= k up the old value irrespective of order=2E=20 Richard=2E=20 > >Thoughts? >Aldy >