From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ua1-x92b.google.com (mail-ua1-x92b.google.com [IPv6:2607:f8b0:4864:20::92b]) by sourceware.org (Postfix) with ESMTPS id 3FE083858D20 for ; Tue, 1 Feb 2022 05:31:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3FE083858D20 Received: by mail-ua1-x92b.google.com with SMTP id w21so13187151uan.7 for ; Mon, 31 Jan 2022 21:31:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=OO8KpZrIpOSSXChUqA96vqwJt9UQQl5r5eeagOeV5iE=; b=aldV9BVSDfEVKdvHmqX2xgsaXklkLNOuc5AswHBsOmulHOPhogGJ1qHnl1MpI+Mjmd Jj/DaRQtUjOnQeCKYy3I/fI7TVZgis1p2rxG9R7Z3lr9MHLzA0VJykiU3jE3yN7b8z0f fEpoqWJq83nJ6vPwEe6gmYr3SSNlZXnzHkpZks0rgWSsGz598QuQUzsVw1DndAQZzbYu jktTwPlHBKnQq5j48dlQCvLLflt3zF//E96zgIQFhpQkRyoptLkJ3vjEPFKN7t7ej4JC irRa1eXdgs3KzpEy3iChKnixv9hHqv+A1h16jZScBoR3Zi+L0gY2AJrhlQMjdTxPVCbZ YvHQ== X-Gm-Message-State: AOAM533EGxLaiVUuN9AY4ty6A629LYVats+FmV+lBVaTRegh2wJowjX3 LJE64e+ELh0mv5biXZT2zuOiHzQFPIsqjnHp1rU= X-Google-Smtp-Source: ABdhPJx/DTIoUJRrrYxGXYXz1ko77ZgHLKZ8sL0D3fWnAPnVA+heT759so8hih943SYTfYJztk68oqd+IkTR8y5dWss= X-Received: by 2002:ab0:30b6:: with SMTP id b22mr9572636uam.133.1643693515811; Mon, 31 Jan 2022 21:31:55 -0800 (PST) MIME-Version: 1.0 References: <20220129164609.GX2646553@tucnak> <20220131101249.GI2646553@tucnak> In-Reply-To: <20220131101249.GI2646553@tucnak> From: Andrew Pinski Date: Mon, 31 Jan 2022 21:31:43 -0800 Message-ID: Subject: Re: [EXTERNAL] [PATCH] testsuite: Fix up tree-ssa/pr103514.c testcase [PR103514] To: Jakub Jelinek Cc: Navid Rahimi , Richard Biener , Jeff Law , "gcc-patches@gcc.gnu.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham 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: Tue, 01 Feb 2022 05:31:59 -0000 On Mon, Jan 31, 2022 at 2:13 AM Jakub Jelinek wrote: > > On Sun, Jan 30, 2022 at 10:16:44AM +0000, Navid Rahimi via Gcc-patches wr= ote: > > Thanks Jakob for the correction. Sadly, I didn=E2=80=99t have any acces= s to any non x86 architecture. But x86 was fully tested and there was no re= gression. > > > > In my spare time I will look at implementation of this for short-circui= t targets. > > Note, it isn't just about those targets. > If you write the code as: > _Bool > g (_Bool a, _Bool b) > { > _Bool c; > if (!a) > c =3D 0; > else if (!b) > c =3D 0; > else > c =3D 1; > return c =3D=3D (a ^ b); > } > instead, it will not match either, not even on x86, even when it is > equivalent. > > Though, maybe for non-short-circuiting targets we should recognize this > somewhere and turn into c =3D a & b; > > Since phiopt2 it is: > [local count: 1073741824]: > if (a_4(D) !=3D 0) > goto ; [50.00%] > else > goto ; [50.00%] > > [local count: 536870913]: > _8 =3D (int) b_5(D); > > [local count: 1073741824]: > # iftmp.0_3 =3D PHI <_8(3), 0(2)> > and phiopt3 makes > [local count: 1073741824]: > if (a_4(D) !=3D 0) > goto ; [50.00%] > else > goto ; [50.00%] > > [local count: 536870913]: > > [local count: 1073741824]: > # _9 =3D PHI > iftmp.0_3 =3D (int) _9; > out of that. > > CCing Andrew if he'd like to have a look for GCC 13. Yes I have a patch to recognize: if (a_3(D) !=3D 0) goto ; [50.00%] else goto ; [50.00%] [local count: 536870912]: [local count: 1073741824]: # c_2 =3D PHI <0(3), b_4(D)(2)> already (a ? b : 0) into a & b. This is already recorded as PR 89263. Thanks, Andrew Pinski > > Jakub >